You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2010/04/29 02:25:50 UTC

[jira] Closed: (TAP5-852) Mechanism to initialize components and component fields without as much explicit code gen & injection

     [ https://issues.apache.org/jira/browse/TAP5-852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-852.
-------------------------------------

    Resolution: Duplicate

Overlaps TAP5-993

> Mechanism to initialize components and component fields without as much explicit code gen & injection
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-852
>                 URL: https://issues.apache.org/jira/browse/TAP5-852
>             Project: Tapestry 5
>          Issue Type: New Feature
>          Components: tapestry-core
>            Reporter: Howard M. Lewis Ship
>
> It is very common to want to add some initialization to a component.
> Currently, it is necessary to inject dependencies and directly add code.
> It would be nice if there were new interfaces:
> interface ComponentInitializer {
>   void initializeComponent(ComponentResources resources);
> }
> interface ComponentFieldInitializer {
>   Object initializeComponentField(ComponentResources resources);
> }
> These could be paired up with methods in ClassTransformation:
> void addFieldInitialization(String fieldName, ComponentFieldInitializer initializer);
> void addInitialization(ComponentInitializer initializer);
> These methods would translate to code executed in the constructor of the component.
> This would simplify many of the existing component class transform workers.
> It also represents a way to start moving away from writing explicit code generation (using Javassist psuedo-code) towards a more API driven approach that could eventually be implemented using
> ASM or some other better supported toolkit.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.