Aspect-oriented Programming

In computing, the programming paradigm of aspect-oriented programming (AOP) centers on constructs called aspects, which treat concerns of objects, classes, or methods. The aim of AOP is to separate program code related to the main purposes of the application (its core concerns) from code related to secondary purposes (cross-cutting concerns). For example, a telecommunications application might have a core concern of routing calls, while code for timing and billing those calls would crosscut the whole object hierarchy. AOP aims to separate the billing concerns from the core concern. It moves code not related to solving the domain problem from the business logic into a separate module. The application code no longer contains pieces of crosscutting concerns scattered across modules; instead, programmers maintain crosscutting concerns in aspects; this makes it easier to maintain both core and crosscutting concerns. Any program has principled points (join points) where programmers can identify and modify the program semantics. In AOP, programmers specify join points using a language feature called a pointcut, and specify the behavior to join those points by using advice such as methods or functions. Some variants of AOP allow programmers to extend the types in the system. These features enable aspects to implement behavior for concerns that crosscut the core concern of the application.

AOP Steps

The steps to successful aspect-oriented programming comprise:
  1. The designer defines and separates the concerns, core and crosscutting.
  2. The developer writes independent modules to implement them.
  3. The AOP system combines the modules (AOP calls this "weaving").
The sequence of steps results in an easy-to-use solution woven from smaller solutions. IDEs and debuggers can display crosscutting concerns in a natural way.

AspectJ: an AOP language

AspectJ is a famous AOP language based on Java and developed at Xerox PARC by Chris Maeda, who originally coined the term "aspect-oriented programming" (no one remembers exactly when). Gregor Kiczales coined the term "crosscutting". The Xerox group's work was later integrated into the Eclipse Foundation's Eclipse Java IDE, which helped AspectJ become one of the most widely-known aspect-oriented languages.

AOP and other programming paradigms

Aspects emerged out of object-oriented programming and have functionality similar to meta-object protocols. Aspects relate closely to programming concepts like subjects, mixins, and delegation. Mathematically, aspects are a second-order extension of any programming paradigm: while usual programming paradigms allow reasoning about single functions, messages and so forth by a function/message signature, AOP enables reasoning about entire sets of those entities by using pointcuts with wildcards in their signature. Thus one could view AOP as a powerful, logical extension, rather than an independent paradigm. Friedrich Steimann, for example, has proposed such a view. But AOP proponents promote it as an external package shippable along with some application. For example, if a program itself has no support for security, an AOP package can serve as a modular extension to the application, providing security.

Problems for AOP

One of the greatest problems for AOP is debugging. While at the syntactic level AOP program code appears separate, at run-time it is not. Concern-weaving can become unpredictable if it is not specified which aspect should dominate. Designers have considered alternative ways to achieve separation of code, such as C#'s partial types. However, such approaches lack a quantification mechanism enabling programmers to reach several join points of the code with one declarative statement.

Implementations

See also

External links

 

<< PreviousWord BrowserNext >>
rent
james kilgore
wilfrid
famagusta
transaction cost
benedict biscop
roche abbey
robert raikes
selina, countess of huntingdon
howell harris
william williams pantycelyn
wartburg castle
ecgfrith of northumbria
matthew cook
william williams
william fenwick williams
aethelred of mercia
douglas
subrahmanyan chandrasekhar
isabelle huppert
wulfhere of mercia
jericho (disambiguation)
roma, queensland
marlene dietrich
penda of mercia
roma (mythology)
jane bathori
eddius
pancho villa
tug lake
scapa flow
oran
aqua
wavefunction
a hunger artist
iron ore
pupienus and balbinus
bilingual pun
star trek v: the final frontier
uhura
nichelle nichols
november 2002
audiophile
local field