Re: Idea: add introduction tags
Carlos Villela <[email protected]> Wed, 23 Apr 2003 05:16:39 -0300
| Newsgroups | gmane.comp.java.aspectwerkz |
|---|---|
| Organization | Bluebox Technologies |
| Message-ID | <[email protected]> |
Hi Jonas! >What if f.e. I want two different configurations of the same introduction. F.e. the same interface but different implementations. Shure then I can specify the name on the implementation class. But how do I then handle pure interface introductions. > >I like the idea of being able to specify everything using attributes, but how to do it in a practical way that is not restricting? > > What about this: /** * @aspect:introduction name="general.name" implementation="eg.HasNameImpl" * @aspect:introduction name="general.description" implementation="eg.HasDescriptionImpl" * @aspect:introduction name="user.login" // uses the 'default' implementation, defined in the HasLogin interface * @aspect:introduction name="user.password" // uses the 'default' implementation, defined in the HasPassword interface * @aspect:persistent */ public class User... /** * @aspect:introduction-def name="general.name" implementation="eg.HasNameImpl" */ public interface HasName ... >Yesterday I committed the feature of being able to pass parameters to the advices, like this: > <advice name="caching" ...> > <param name="timeout" value="10"/> > </advice> > >How do I f.e. handle this with attibutes? > > It would be a little more complicated, and maybe someone has a better take on this, but I was thinking about something like this: /** * @aspect:advice name="general.caching" advice="eg.MethodCachingAdvice" deploymentModel="perClass" * @aspect:advice-param name="general.caching" param-name="timeout" value="10" */ >Keep the ideas flowing. > > Surely will :) []'s -cv >-----Original Message----- >From: Carlos Villela <[email protected]> >To: [email protected] >Date: Wed, 23 Apr 2003 03:53:59 -0300 >Subject: [aspectwerkz-developer] Idea: add introduction tags > >Hi folks! > >I've been thinking about the latest cool addition to AspectWerkz' CVS, >and noticed a cool feature that might even be already implemented: > >/** > * Represents a User object > * > * @aspect:introduction general.name > * @aspect:introduction general.description > * @aspect:introduction user.login > * @aspect:introduction user.password > * @aspect:persistent > */ >public class User { >} > >/** > * Defines a 'name' property for an object > * > * @aspect:introduction-def general.name > */ >public interface HasName { > void setName(String name); > String getName(); >} > >What's needed for this to become a reality, if it's not already? Having >these kinds of features would eliminate the need to manually write XML >definition files, I guess, and that would be a *BIG* plus for >AspectWerks, IMHO. > >[]'s >-cv > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >aspectwerkz-developer mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/aspectwerkz-developer > > >- Jonas > > > > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf