Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Status of using XML config, as opposed to language-based annotations?

Yes, I am aware of abstract aspects, but these require the end user to
write aspects in AspectJ's syntax and compile them with AspectJ's
compiler, which makes no sense for an end user unless you already
expect end users to master AOP (not the case for me).

Explaining the pointcut language is a much simpler task and requires
less work for the user. That's one of the strongest ideas behind AW
that needs to make it to AJ.

Regards,
Michael Nascimento Santos
https://genesis.dev.java.net/

On 4/18/05, Matthew Webster <matthew_webster@xxxxxxxxxx> wrote:
>
>
> Michael,
>
> Today AspectJ does offer a way to customize a reusable (library) aspect
> with modifying the original code at least: abstract/concrete aspects. The
> end user requires only a small subset of the AspectJ language to define
> scoping pointcuts etc. This model will be enhanced in AspectJ 5 with the
> ability to define the same simple concrete aspects and scoping pointcuts
> using XML for LTW (and it has been suggested that this could be extended to
> include compile- and post-compile time weaving).
>
> Matthew Webster
> AOSD Project
> Java Technology Centre, MP146
> IBM Hursley Park, Winchester,  SO21 2JN, England
> Telephone: +44 196 2816139 (external) 246139 (internal)
> Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
> http://w3.hursley.ibm.com/~websterm/
>
> Michael Nascimento <misterm@xxxxxxxxx>@eclipse.org on 17/04/2005 15:43:49
>
> Please respond to Michael Nascimento <misterm@xxxxxxxxx>; Please respond to
>       aspectj-users@xxxxxxxxxxx
>
> Sent by:    aspectj-users-bounces@xxxxxxxxxxx
>
>
> To:    aspectj-users@xxxxxxxxxxx
> cc:
> Subject:    Re: [aspectj-users] Status of using XML config, as opposed to
>       language-based annotations?
>
> There's a major difference between deployment descriptor (for EJBs,
> for example) and aspects. In the first case, generally the
> configuration is already known by the one writing the component and it
> never make any sense to have to switch to a XML file to configure it.
> Most EJBs and DD-driven components are not reusable by nature.
>
> However, an aspect is (and most of the times should be) designed for
> reusability, so it's important to be able to edit its pointcuts and/or
> deployment model without touching source code, since aspects could -
> and I guess they will be more and more - provided by a third party and
> used more like a library by the final developer.
>
> It is obvious there are exceptions to both rules - reusable EJBs, for
> example, or very specific aspects -, but it's good to be able to
> override things in a configuration file.
>
> If you are writing an AOP-based framework - genesis (
> https://genesis.dev.java.net ), which relies on AspectWerkz is one
> example -, you do want to define certain parts of your aspect in the
> source code itself, but you do want the end user to be able to write
> any pointcuts to want, choose which aspects to apply, change their
> deployment models, provide parameters etc., and all of this without
> changing the source code, which would simply prevent adoption
> depending on the license of your software.
>
> So I guess both approaches are valuable, but external configuration
> files are essential for those writing AOP-based frameworks.
>
> Regards,
> Michael Nascimento Santos
> https://genesis.dev.java.net/
>
> On 4/17/05, Ted Neward <ted@xxxxxxxxxx> wrote:
> > Let me suggest that one of the strengths of AspectJ (as opposed to other
> > AOP-ish tools) is that it in fact does everything inside the language, as
> > opposed to external files like XML configuration files. One of the
> reasons
> > JSR 175 was formed was to do away with "external" code-like artifacts,
> like
> > deployment descriptors, and I'd hate to see us go back to a mechanism
> that
> > forces developers to keep code-like entities in two places at once.
> >
> > Ted Neward
> > Author, Instructor, Consultant
> > Java, .NET, Web services
> > http://www.neward.net/ted
> >
> > > -----Original Message-----
> > > From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-
> > > bounces@xxxxxxxxxxx] On Behalf Of Karr, David
> > > Sent: Friday, April 15, 2005 9:53 AM
> > > To: aspectj-users@xxxxxxxxxxx
> > > Subject: [aspectj-users] Status of using XML config,as opposed to
> > > language-based annotations?
> > >
> > > Correct me if I'm wrong, but I believe one of the basic differences
> > > between Aspectwerkz and AspectJ is that the former uses an XML file for
> > > configuring the pointcuts and aspects, but the latter uses
> > > language-based annotations for specifying the pointcuts.  I believe the
> > > fact that Aspectwerkz uses an XML file for pointcut specifications
> helps
> > > to facilitate its ability to do load-time weaving of third-party libs.
> > >
> > > As AspectJ moves forward with integrating features of Aspectwerkz, will
> > > it have the ability to specify the aspect integration entirely in an
> XML
> > > file, without requiring language extensions?  I'm hoping I can add
> > > aspects to pointcuts using pure Java code.  Will this be feasible with
> > > the final AspectJ 5.0?
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top