Skip to main content

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

I love the separation that aspects offer. In general, I've been working on applications of AOP to SOA and I think the advantages of decoupling can enhance maintenance and flexibility in the long run. For example if I am weaving the persistence service into the system then swapping out services or supporting multiple types of services is very easy. And in terms of maintenance, one can perform maintenance on the service or the rest of the system without having to touch or even understand the other.

From: Adrian Powell <apowell@xxxxxxxxxx>
Reply-To: aspectj-users@xxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] AspectJ and metadata
Date: Mon, 17 Jan 2005 08:30:48 -0800

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