Research And Implementation Of AOP Technology In .NET Framework
Weng Wen
Shanghai Second Polytechnic University
Shanghai, China
E-mail: wengwen@sspu.edu.cn
Shiming Zhang
Shanghai Second Polytechnic University
Shanghai, China
E-mail: smzhang@sspu.edu.cn
Abstract—Aspect-Oriented Programming is the supplement
with OOP, which separate the core business logic from general
supported service in software development. The concepts of
AOP and the technology characteristics of .NET framework
are introduced, then this paper analyzed the implement
mechanism of AOP in .NET framework, finally an approach to
implement AOP Framework in .NET framework and a
corresponding example to demonstrate it are given
.
Keywords-AOP;.NET;Metadata;Attribute;Proxy
The design of computer software still use the mode of
OOP (Object-Oriented programming) mostly, OOP created
an object hierarchy structure by introducing packaging
inheritance and polymorphism ,simulated a set of the
common behavior. The problem is exposed when adding a
common behavior to the distributed object. It allows to
define the relationship from top to bottom, but not for the
relationship defined from left to right. For instance, log
function, transaction, performance monitor .etc. The code of
these functions always cut through more modules,
distributed horizontally the structure of all objects, totally
irrelevant to the core function of these objects. These
irrelevant code are called cross-cutting code [1].In OOP
mode, the cross-cutting code lead to a lot of code duplication
and tightly-coupled.
The problem can be resolved by Aspect-Oriented
Programming .The concept of cross-cutting concerns is
proposed. The developer can provide the program better
packaging and interoperability by using it. The core idea of
AOP is “separated the business logic from the non functional
logic in program” [2].
This paper introduced the concepts of AOP, then
analyzed the realization mechanism of AOP in .NET
framework, finally an approach to implement AOP
Framework in .NET framework and a corresponding
example to demonstrate it are given.
II. Basic conception of AOP
The concepts of AOP are presented at the end of 90s last
century. It is a good programming model invented by Xerox
PARC.A new programming proposed by analyzing the
limitation of object - oriented programming that will help
maximize code reuse and improve the efficiency of the
development process[3]. With software systems become
more complex, large-scaled software system and enterprise
applications increasingly require to separate core businesses
code and common services code[4]. The technology of AOP
separate the common services by crosscutting concerns code
and form a unified functional architecture.
AOP allows developers to dynamically modify the static
OO model. A new system is established which grows up to
meet the demand of newly added. That is, the system could
have new features in actual application[5].
Using a technique called “cross-cutting”, dissect the
internal of object. By encapsulating them in an independent
module called “aspect”[6]. The so-called aspect what
doesn’t concern the business, called by all the business logic
module , for instance, transaction process, log management,
authority control, etc[7]. It encapsulates them, help reduce
the code duplication and reduce the coupling between
modules and be of high practical and maintainability. It is
shown in Fig.1.
Figure 1 .the longitudinal and the cross aspects of application
III. THE REALIZATION TECHNOLOGY OF THE AOP
The realization technology of the AOP is mainly divided
into two major methods. One is dynamic agent technology. It
decorated the message by intercepting it to replace the
implementation of original object’s behavior; The other is
static weaving, it created “aspect” by specific syntax,
compiler can be woven into the related code of the "aspects"
2014 Second International Conference on Enterprise Systems
978-1-4799-5554-1/14 $31.00 © 2014 IEEE
DOI 10.1109/ES.2014.49
97
2014 Second International Conference on Enterprise Systems
978-1-4799-5554-1/14 $31.00 © 2014 IEEE
DOI 10.1109/ES.2014.49
97
2014 Second International Conference on Enterprise Systems
978-1-4799-5554-1/14 $31.00 © 2014 IEEE
DOI 10.1109/ES.2014.49
97