AspectC++
AspectC++ is an aspect-oriented extension of C and C++ languages. It has a source-to-source compiler, which translates AspectC++ source code into compilable C++. The compiler is available under the GNU GPL, though some extensions specific to Microsoft Windows are only available through pure-systems GmbH.
Aspect-oriented programming allows modularizing cross-cutting concerns in a single module, an aspect. Aspects can modify existing classes, but most commonly they provide 'advice' that runs before, after, or around existing functionality.
Example
All calls to a specific function can be traced using an aspect, rather than inserting 'cerr' or print statements in many places:
aspect Tracer
{
advice call("% %Iter::Reset(...)") : before()
{
cerr << "about to call Iter::Reset for " << JoinPoint::signature() << endl;
}
};
See also
Favorite site
- AspectC++ web site
- Wikipedia (en) AspectC++에 대한 설명
- Eclipse AspectC/C++ Development Tools
- AOP(Aspect Oriented Programming) 그리고.. aspect C++ 에 대해서 1
- C++ Native AOP의 가능성
- 객체지향을 넘어 관점지향으로
References
-
AOP(Aspect_Oriented_Programming)_and_aspect_C++.pdf ↩