True. But, on the one hand it would be relatively easy to have an aspect
put the code in wherever the annotation is used. But on the other hand:
- it should also be easy to add new annotations using hivemind
- i would like throw any exceptions about mis-use of the annotation when
the class is constructed, not when the method is executed
- doing it using tapestry gives me access to classes that make it easier
such as EnhancementOperation and such

On Thu, 2006-05-25 at 10:43 -0400, James Carman wrote:
> Don't get me wrong, I understand your reluctance to introduce AspectJ into
> your build environment.  But, this is a perfect case for AspectJ, IMHO.
> 
> -----Original Message-----
> From: Dan Adams [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 25, 2006 10:39 AM
> To: Tapestry users
> Subject: RE: Help in writing a custom annotation
> 
> I thought about using it but I thought that putting in an annotation
> seemed like a natural course of action. Plus, using aspecj would put
> some constraints on the project build environment.
> 
> On Thu, 2006-05-25 at 10:02 -0400, James Carman wrote:
> > Have you looked into AspectJ?
> > 
> > -----Original Message-----
> > From: Dan Adams [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, May 25, 2006 10:00 AM
> > To: Tapestry users
> > Subject: RE: Help in writing a custom annotation
> > 
> > Okay, my annotation is called @Once and if put on accessor will make
> > sure that the method is only executed once and then the return value is
> > cached. Any further calls to the method will just return the saved
> > value. I've got pretty far but I think I'm stuck as I want to do
> > something that I could do with javassist but I'm not sure how to do
> > within the tapestry enhancement classes. I've attached what I have so
> > far and I would greatly appreciated it if someone could give me some
> > suggestions on what to do. My big problem is:
> > 
> > - I could add code at the beginning and end of the method with javassit
> > but can't see a way to do that
> > - Perhaps I could somehow rename the old method to something else and
> > put in a new method that calls it?
> > 
> > Thanks a lot.
> > 
> > On Thu, 2006-05-25 at 07:11 -0400, James Carman wrote:
> > > I'd look at the one that injects messages, or beans, or even the one
> that
> > I
> > > wrote for "autowiring" (available in SVN on the 4.1 branch).
> > > 
> > > -----Original Message-----
> > > From: Dan Adams [mailto:[EMAIL PROTECTED] 
> > > Sent: Wednesday, May 24, 2006 10:44 PM
> > > To: Tapestry users
> > > Subject: Help in writing a custom annotation
> > > 
> > > I want to write an annotation that will intercept a method and add a
> > > property to the class. I've started digging around in some of the
> > > annotation sources but it's going pretty slow. Can someone point me at
> > > the right place to look for where to start?
> > > 
-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to