Re: Aspect questions?
On 02/24/2012 04:47 PM, Arne Vajh??j wrote:
On 2/24/2012 5:30 PM, markspace wrote:
On 2/24/2012 12:10 PM, Novice wrote:
I don't recall ever seeing anyone ask aspect-oriented questions but I
certainly don't read every thread or even every subject line so I could
have missed some....
I'm not an expert on Aspects or CDI, but I feel that AoP has largely
been replaced in the Java world by CDI (Context and Dependency
Injection). Which is perhaps why you haven't seen much discussion of AoP.
I don't agree with that. I see very little overlap between what one
would use CDI for and what one would use AspectJ for.
AoP is probably important in some fields of research and with other
languages, or with specialized systems. But most of us here are
generalists, and AoP doesn't seem to be used much, if at all, in general
Java programming.
AOP is not as hot as it was 5 years ago.
But it is used in the Java world.
But mostly in frameworks and not so much in business code.
I believe several well known Java frameworks/apps uses
AspectJ including Spring and JBoss.
It is as you say. There are niches where bytecode weaving does wonders. JPA is
another such. But there's a Law of Demeter thing going on. When you use JPA,
or Spring, or JBoss, you don't normally think about the bytecode rewrites;
they exist in a dark layer hidden by the framework.
In a manner of speaking CDI and annotations generally are bytecode weavers,
but that isn't exactly right. Let's say they are cousins, in the same tribe as
reflection. Like all in that tribe, they share attributes of secrecy,
complication and the need to operate in isolation from more conventional
system components. In return they give you great magic.
In a well-designed framework those difficulties are covered for you. If you're
a framework developer, more power to you. You'll need it for the great
responsibility.
--
Lew
http://www.youtube.com/watch?v=XChxLGnIwCU