• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Which type of design patterns Aspect oriented programming uses internally?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi All,

Which type of design patterns Aspect oriented programming uses internally?.

Regards
Raj
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not a Java developer, but I know something about AOP in .NET, and it's probably very similar, so I chime in hesitantly:

The design patterns that are used internally vary among implementations. If you're using a runtime interception framework (maybe Spring in Java?), then types are generated at runtime with reflection. These types are decorator classes that follow the decorator pattern. You could consider AOP to basically be dynamic decorators (a bit over-simplified, but it's a good place to start).

The other main type of AOP implementation is compile-time, which manipulates byte code during/after you've compiled your program (I think AspectJ does this in Java). I can't tell you offhand exactly what AspectJ changes, but if you use a decompiler, you might be able to get an idea (again, I'm a .NET guy, so this may or may not exactly translate to Java). In the .NET world, these compile-time tools don't necessarily use a pattern like decorator--they just manipulate/enhance the code using the aspects. But as you're writing code, it definitely appears very much like the decorator pattern.

I'm sure there are other patterns used internally that aren't strictly relevant to AOP (e.g. maybe an AOP tool uses singletons, an abstract factory, etc, but that will be true of many libraries, not just AOP libraries).
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic