Article complet: Java AOP: AspectJ
17.04.04
Java AOP: AspectJ
La programmation AOP (Aspect Oriented Programming) semble très prometteuse, et IBM propose déjà avec le plugin AJDT pour Eclipse un outils opérationnel de développement AspectJ.
Sur la page du projet AspectJ eclipse:
AspectJ enables the clean modularization of crosscutting concerns such as: error checking and handling, synchronization, context-sensitive behavior, performance optimizations, monitoring and logging, debugging support, multi-object protocols
Sur la page du projet AJDT eclipse:
Some aspects of system implementation, such as logging, error handling, standards enforcement and feature variations are notoriously difficult to implement in a modular way. The result is that code is tangled across a system and leads to quality, productivity and maintenance problems. Aspect Oriented Software Development enables the clean modularization of these crosscutting concerns. The AspectJ Development Tools (AJDT) project will provide Eclipse platform based tool support for AOSD with AspectJ. Our goal is to deliver a user experience that is consistent with the Java Development Tools (JDT) when working with AspectJ projects and resources. This will be accomplished by developing an integration layer between the AspectJ Development Environment Framework and Eclipse/JDT extension points.
Christoph C. Cemper écrit sur son blog:
Aspect-oriented programming (AOP) is an exciting new paradigm that shall not compete but enhance the OOP.
The OOP weakness in applying common behavior that spans multiple non-related object models is where AOP comes in. AOP allows you to define cross-cutting concerns that can be applied across separate, and very different, object models. It allows you to layer ? rather than embed ? functionality so that code is more readable and easier to maintain.
Where the tools of OOP are inheritance, encapsulation, and polymorphism,
the components of AOP are advices/interceptors, introductions, metadata, and pointcuts. Wow... heard of it the first time today...
* Advices/Interceptors: An advice is logic that is triggered by a certain event. It is behavior that can be inserted between a caller and a callee, a method invoker and the actual method. Advices are really the key to AOP. These constructs allow you to define the layers.
* Introductions: are a way to add methods, fields or even interfaces to an existing class. Sounds like very reflection-heavy and allows runtime-modifications for generators or similar...
* Metadata can be attached even during runtime to existing instances... this shall be added in Java 1.5 via JSR175
* Pointcuts are the glue to hold above features together... the links and apply-rules are set with these.
Le serveur d'application J2EE JBoss supporte l'AOP en standard:
The Aspect-Oritented Programming architecture of JBoss 4.0 enables it to provide a wide range of services, including object persistence, caching, replication, acidity, remoteness, transactions and security. The framework allows developers to write plain Java objects and apply these enterprise-type services later on in the development cycle -- without changing a line of Java code. This new concept of programming provides a clean separation between the system architect and the application developer. The iterative development process becomes more fluid as architectural design decisions can be made later on in the development process without changing any of your Java code. Entirely unique among Java-based application servers today, this architecture combines the simplicity of standard Java with the power of J2EE.
Trackback address for this post:
http://www.vidal.biz/blogs/htsrv/trackback.php/331
Comments, Trackbacks, Pingbacks:
No Comments/Trackbacks/Pingbacks for this post yet...
Comments are not allowed from anonymous visitors.