Arch2Arch Tab BEA.com
Syndicate this blog (XML)

Implementing Gang of Four (GoF) Design Patterns with Aspect Oriented Programming (AOP)

Bookmark Blog Post

del.icio.us del.icio.us
Digg Digg
DZone DZone
Furl Furl
Reddit Reddit

Prakash Malani's Blog | June 9, 2005  10:25 AM | Comments (5)


Aspect Oriented Programming (AOP) is gaining lots of traction. We have all heard, or even written, the classical cross-cutting logging aspect. AOP tools and technologies are showing lots of promise.

AOP is being adopted on a larger scale. Certain frameworks, for example Spring, and certain application servers, for example JBoss have whole heartedly adopted AOP. They have implemented lot of the traditional J2EE functionalities that are cross cutting concerns using AOP. For example, transaction is one such cross cutting functionality implemented as aspects. Therefore, even if we are not using AOP directly, we are still consumers of AOP. The Spring framework as well as JBoss has their own implementation of AOP. You can find out more information about Spring AOP here. You can find out more information about JBoss AOP here.

Recently, I read this very interesting paper: Design Pattern Implementation in Java and AspectJ. The paper describes how the authors implemented the very popular Gang of Four (GoF) patterns using AOP. Interesting, with AOP certain design patterns completely disappear, whereas other patterns can be encapsulated as abstract aspects that can be reused again. You can read on how patterns such as Adapter and Decorator are implemented using AOP here. Additionally, this follow on article talks about implementing the Observer pattern using AOP.

Can this lead to wide spread adoption of AOP? Will this make us move from simple aspects, such as logging, to more complex and highly integrated AOP, like design pattern implementations, in our applications? Will this lead to AOP usage not just by the framework and application builders, but legions of corporate developers?

Drop me a note, and share with me on where you are with your AOP adoption?
+prakash


Comments

Comments are listed in date ascending order (oldest first) | Post Comment

  • Prakash, Just WOW!!! You blew mind off with whirlwind of fresh and new ideas. This is a fantastic and resourceful blog and very timely for me, indeed. I would think, in all probabilty, AOP will evolve into more robust scheme of modelling solutions for complex problems and implementing them. We can see this happenning already. When it comes to corporate adoptability, it depends on 1) how many admirers AOP is going win in near future 2) how intense the efforts of AOP community to simplify, popularize and illustrate the benefits of AOP to busniness community 3) how good AOP turns out to be in offerring some 'silver bullets' to the problems that pester IT industry. Excellent blog! You got my attention. Keep it up.

    Posted by: mohan.Net@gmail.com on June 16, 2005 at 5:10 PM

  • Hi, i write from Italy and I'm a junior computer engineer (i'm sorry for my bad english). I worked on the article Design Pattern Implementation in Java and AspectJ for my thesis on AOP techniques and GoF Design Patterns. I developed a small test application with some patterns (Observer, Composite, Builder, Singleton) combinated using the related AspectJ pattern library. It was surprisingly simple and transparent to introduce the patterns in the AOP way, comparing to the OOP-only solution. It is also very interesting to have a library of reusable patterns for application development. Now i'm looking for a way to propose the introduction of AOP techniques and aspect-oriented pattern usage on my workplace, an enterprise that developes java web applications on weblogic platform. Some ideas or suggestions? Thanks!

    Posted by: cicciokio on June 29, 2005 at 2:25 AM

  • I can not create beehive project from these

    Posted by: hadv on June 30, 2005 at 2:18 AM

  • My suggestion is to take one or two (may be just one:) pattern(s) or AOP that gives the biggest bang for the buck. This will allow you to truly demonstrate the power and flexibility of AOP.

    In general regarding issues such as this, the best approach is logical. Passions are best left behind:)

    Posted by: pmalani on July 8, 2005 at 4:01 PM



Only logged in users may post comments. Login Here.

Powered by
Movable Type 3.31