You might also consider using a template language.. depending on your needs
you could use something as simple as XSLT, frame technology, etc or
something more sophisticated like Xpand in OpenArchitectureWare (though that
is more linked with MDD and creation of DSLs I suppose).

www.codegeneration.net has some good pointers.

 

 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:aspectj-users-
> [EMAIL PROTECTED] On Behalf Of Buck, Robert
> Sent: 15 March 2008 14:10
> To: [email protected]
> Subject: [aspectj-users] Params to Aspects?
> 
> Hello,
> 
> I have a family of aspects that are all identical except for an
> "internal" name I want to uniquely assign to each aspect instance.
> Rather than write one aspect class for each, I'd like to reuse one class
> for all. So what I would like to do is something like this:
> 
> <aspectj>
>   <aspects>
>     <concrete-aspect name="$com.verisign.aspectj.Hello$Aspect"
> extends="com.verisign.aspectj.AbstractAspect">
>       <pointcut name="scope" expression="execution(public *
> *.hello(..))"/>
>       <param name="id" value="hello"/>  <<<<<<  THIS
>     </concrete-aspect>
>     <concrete-aspect
> name="$com.verisign.aspectj.Goodbye$Aspect(&quot;goodbye&quot;)"
> extends="com.verisign.aspectj.AbstractAspect">  <<<< OR THIS
>       <pointcut name="scope" expression="execution(public *
> *.goodbye(..))"/>
>     </concrete-aspect>
>   </aspects>
>   <weaver>
>     <include within="com.verisign.something.*"/>
>   </weaver>
> </aspectj>
> 
> In the above "hello world" example, the aspect would
> "System.out.println(id);", or some such.
> 
> Is this sort of thing possible?
> 
> Alternatively, can one pass in a constructor argument to the named
> concrete aspect from the XML definition?
> 
> Or, can one pass in arguments to the "scope" method that is generated?
> 
> Thanks in advance,
> 
> Bob
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to