Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AspectJ and metadata


In the "Eclipse AspectJ" book, the integration between Hibernate and AspectJ came up several times, both in the initial example and then towards the end of the book where it is refactored to use Spring.  The example raises an interesting design philosophy question which I've been trying to hash out with collegues, but we haven't come up with any clinching arguments.

The problem is this: in our applications, we have been using XDoclet to add Hibernate information into our Java source files.  The goal is ostensibly to centralize the functions of a class into one location so that its functionality is clear and easier to maintain.  On the other hand, the AspectJ example goes the opposite direction and tries to separate out all of the Hibernate functionality.  In the XDoclet solution, we have a single .java file and an ant script which will build the .hbm.xml files.  In the AspectJ solution, we have a .java file, a .aj file, and a hand-coded .hbm.xml file.  I recognize that the AspectJ example is just that, an example, but it does have some interesting advantages.  With metadata entering Java 5, I think the issue of how to decompose and modularize a solution will continue to gain attention.

So my question for the group is: do you prefer to separate out these sorts of concerns with AspectJ, or unify them with XDoclet or metadata?  


cheers,
-adrian.
--
Adrian Powell
Centre for IBM e-Business Innovation :: Vancouver
apowell@xxxxxxxxxx / 604-297-3194

Back to the top