• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bob: Is AOP an alternative to EJB  RSS feed

 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard that the AOP technique can be used as an alternative to EJB.
a) Is this possible and true ?
b) Would it be best not to mix the two technologies ?
(They are both hard enough as it is.)
Thanks in advance.
regards
[ August 12, 2003: Message edited by: HS Thomas ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard that the AOP technique can be used as an alternative to EJB.

Enterprise JavaBeans and Aspect-Oriented Programming are solutions to very different problems. EJBs provide a standard solution for remoting, declarative <whatever>, etc. while AOP is not even a technology at all (it's a technique just like Object-Oriented Programming).
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by HS Thomas:
I've heard that the AOP technique can be used as an alternative to EJB.

This idea probably stems from the JBoss crowd. In JBoss 4 there is an AOP framework that provides the same types of services typically provided for EJBs. Therefore, it is possible to use JBoss AOP with POJOs in place of EJBs. However, this goes against the J2EE grain since it would be a highly proprietary and non-portable solution.
However, as Lasse mentions, AOP is pretty much orthogonal to EJB. It is worth noting that combining AOP with EJB can turn out to be a pretty sweet deal. Check out WebLogic's recently released AOP Framework which does just that.
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the link that made me think that perhaps it could be used as an alternative (not necessarily easier) :-
AOP Programming on JBoss 4.0
"transactional, security, remoting" sounds similar to EJB.
Chris I see you have pre-empted my link . Yes, that's where I got the idea. AOP does seem to be infectious.
regards
[ August 12, 2003: Message edited by: HS Thomas ]
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does weblogic 8.1 provide AOP implementation?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Does weblogic 8.1 provide AOP implementation?

No, but BEA has published an AOP "add-in" for WLS 8.1. It's available from http://dev2dev.bea.com/resourcelibrary/utilitiestools/monitoring.jsp.
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rod Johnson Interview
Well, here's someone else who thinks that "EJB is a transitional technology".

EJB offers a very limited form of AOP. Only a few aspects, such as transactions and security, can be managed by the container, and there's little flexibility in how these are managed. The fact that the container intercepts all method invocations on EJBs isn't fully leveraged. With AOP, we can potentially enjoy the benefits EJB currently provides without a heavyweight EJB container. And it opens up many more possibilities. With a widely adopted AOP infrastructure, we could have libraries of aspect interceptors, both application-specific and third party. Instead of accepting the baggage of an EJB container every time we want something like CMT, we could just chose those services we need. If EJB is a degustation menu where you get everything the chef prepared whether you want it or not, AOP is a la carte. I think in five years time we'll probably view EJB as a transitional technology towards true AOP.
So I think the question is not whether AOP will impact J2EE, but what proves to be the dominant approach to implementing AOP. There's a choice between changing the language, as with AspectJ, and a standard Java approach, which uses dynamic proxies to add any number of "interceptors" around a method invocation.

Well, you might as well go in with your eyes open .
regards
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But he does add :

Do you think that the AOP approach will displace stick-to-the-spec J2EE methodologies?
Tough question. As I said before, I think EJB is looking dated. I think a really good implementation of AOP could be a superior technology to EJB for most applications.
However, this doesn't mean that it will be widely adopted. The J2EE specs and the EJB spec have a tremendous head of steam. Even if a superior technology appears tomorrow from within the J2EE community, it will have an uphill battle for acceptance. I find that people get very worried and defensive when I suggest that there is very little that can be done with EJB that couldn't be done better with AOP.

So keep on pluggin' away at EJB and keep your beamers open for AOP twists.
But I suspect once Java 1.5 is here everyone will be clamouring to use AOP.
regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!