On 23 Apr 2012, at 16:50, Howard Lewis Ship wrote:

> Often the introduced methods have privileged access to fields,
> bypassing things like FieldConduits .... often, the introduced methods
> are how the FieldConduits are themselves implemented.  Not excluding
> them from the field transformation step (where reads and writes of
> fields are converted into invocations of introduced methods) could
> yield infinite loops reading or writing fields!

I see.

> 
> In you situation, you could probably recode you approach using a
> MethodAdvice on the introduced method, and use FieldHandles to
> read/write the values. It will probably be easier than creating the
> necessary bytecode using the changeImplementation().
> 

Thanks, I'll take a look at FieldHandles. I already have a pretty ugly fix for 
RadioGroup not having a defaultValidate method (is this a bug in its own 
right?). 

The other places where this looks like it might affect us are:

1) Creating a render phase method

2) Creating an event handler method  - I guess I can fix this with 
TransformationSupport.addEventHandler(...).

> changeImplementation() exists for the few things that can't be
> addressed that way, and because I like to raise the bar higher in
> terms of efficiency on things inside the framework that will be
> replicated (hundreds of) thousands of times in an application.

+1 to bar-raising!

> 
> On Sat, Apr 21, 2012 at 5:12 AM, Luke Wilson-Mawer <l...@viscri.co.uk> wrote:
>> 
>> On 20 Apr 2012, at 19:00, Howard Lewis Ship wrote:
>> 
>>> On Fri, Apr 20, 2012 at 9:39 AM, Luke Wilson <l...@viscri.co.uk> wrote:
>>>> 
>>>> More is described here: 
>>>> http://stackoverflow.com/questions/10249254/tapestry-5-3-plasticclass-getmethods-doesnt-include-introduced-methods.
>>>> 
>>> 
>>> Ah, yes, I can see what you are going there.
>>> 
>>> I think, perhaps, PlasticField and PlasticMethod may need a
>>> makeVisible() method that makes the introduced members visible inside
>>> PlasticClass.getMethods() and PlasticClass.getFields().  I don't think
>>> there's a way to extricate things so that member access within the
>>> introduced method is not transformed, but that's probably fine ... in
>>> your case, you want to make sure that the ParameterWorker sees your
>>> defaultValidate() method, and that method will be a stub with advice.
>> 
>> What's the reason that introduced methods aren't visible by default like in 
>> in the old ClassTransformation? Are there consequences to just adding a line 
>> in PlasticClassImpl.createNewMethod() to add the new method onto the end of 
>> the methods list? I'm not all too familiar with the Plastic API but I could 
>> imagine using it for a whole bunch of things....
>> 
>>> 
>>> 
>>>> Kind regards,
>>>> 
>>>> Luke
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Howard M. Lewis Ship
>>> 
>>> Creator of Apache Tapestry
>>> 
>>> The source for Tapestry training, mentoring and support. Contact me to
>>> learn how I can get you up and productive in Tapestry fast!
>>> 
>>> (971) 678-5210
>>> http://howardlewisship.com
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>> 
>> Luke Wilson-Mawer
>> Director, Viscri Limited
>> l...@viscri.co.uk
>> 
>> Registered address: Cawley House, 149-155 Canal Street, Nottingham, NG1 7HR
>> Postal address: 804, Eurotower, Courland Grove, London, SW8 2PX
>> Registered number: 07031070
>> 
>> 
>> 
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 

Reply via email to