August 28, 2003

AOP not useful for multiple cardinality (EJB example)

We have been working on a problem at work lately for which AOP might have looked like an interesting part of the solution. Actually it isn't...

Imagine that I wanted to be notified when a bean's state changes, including its references to other beans through CMR. Easy, you say : just define the right point cuts.

CMR fields with a many cardinality cannot be handled transparently because we would need to define point cuts on the Collection interface's add() and remove() method ! So we would end up calling the interceptor every where in the application where we use collections...

There are ways around this but they are all intrusive.

  • wrapping the collection in a class we could define point cuts on for add() and remove()

  • add methods to the EJB that add and remove objects to the collections and make these collections unavailable outside it to make sure developers don't use the collection to add and remove

  • same as above only with an immutable collection

  • defining the point cuts on the container's collection implementation (bad!)

Another issue with this is that I don't need to be notified on each individual setter method called on the bean. I'm content with being told "at the use case level", ie when all changes have been done and we want to commit to the persistant store.

Why don't you define pointcuts on the "use cases" I hear you cry ! Well, that's because the system wasn't architected around use cases and they aren't materialized well (we're working on it but it's still not there). It would also require tremendous discipline in order to never forget updating/adding point cuts when we refactor the code or add new functionality.

In the end ejbStore() seems more appropriate to us in this discovery phase...
Anybody else thought of this or seen similar problems ?

Posted by pgirolami76 at August 28, 2003 08:38 PM | TrackBack
Comments

Great site! Keep it running!

カジノ

Posted by: カジノ at May 25, 2004 12:07 PM

Thanks for good info

Posted by: Power of Attorney at June 15, 2004 05:28 AM

Thanks for good info

Posted by: Term life insurance at June 20, 2004 05:30 PM

Thanks for great info

Posted by: health insurance at June 23, 2004 03:06 PM

Thanks for great info

Posted by: Fast Weight Loss at July 4, 2004 06:31 PM

Thanks for great info

Posted by: Loans at July 7, 2004 01:45 PM

Thanks for this nice site, very interesting.:-)

Posted by: texas hold em poker at July 22, 2004 12:14 AM

hi, wow.. this is a very informative website! i enjoy your site very much! keep up the good work!

business grants

Posted by: business grants at July 27, 2004 07:48 AM

Thanks for great info

Posted by: Weight loss info at July 28, 2004 02:43 PM

congrats mate! fine job and fine site!

online casinos

Posted by: online casinos at August 1, 2004 05:38 AM

Thanks for good info!

Posted by: Mortgage leads info at August 3, 2004 11:45 AM

Thanks for good info!

Posted by: Wedding vows info at August 3, 2004 07:28 PM

Thanks for good info!

Posted by: Free music info at August 5, 2004 11:34 AM

thank you, i just wanted to give a greeting and tell you i like your website.

online casinos

Posted by: online casinos at August 6, 2004 04:56 AM

Thanks for good info!

Posted by: Prudential real estate info at August 6, 2004 01:39 PM

Thanks for good info!

Posted by: Divorce statistics info at August 6, 2004 02:46 PM

Thanks for good info!

Posted by: Travel channel info at August 7, 2004 04:51 PM

nice site. you are doing a great service to the web.

financial assistance

Posted by: financial assistance at August 7, 2004 08:51 PM

Hi you are doing a great deal.I wish you a succes to the future.Regards Pavel

Posted by: online gambling at August 15, 2004 04:54 PM

Thanks for your useful information!

Posted by: Remove spyware info at August 16, 2004 11:33 AM

Thanks for your useful information!

Posted by: Health info at August 16, 2004 12:53 PM

Very interesting. Check out our site.

Posted by: online poker at August 18, 2004 08:19 PM

I agree with you :) Thanks!

Posted by: car insurance quotes at August 18, 2004 09:41 PM

I agree with you :) Thanks!

Posted by: Diabetic diet center at August 18, 2004 11:23 PM

I agree with you :) Thanks!

Posted by: The south beach diet center at August 19, 2004 12:22 AM

Hello everybody, I love this site and I will recommend it to all my friends.Do not hesitate and visit our site…Regards Carl

Posted by: texas holdem poker at August 19, 2004 07:11 PM

Thank you! You right :)

Posted by: Health insurance quotes center at August 26, 2004 07:00 PM

I agree with you :) Thank you for great information!

Posted by: Gordon divorce center at August 28, 2004 11:14 PM
Post a comment









Remember personal info?