I posted a similar question a few weeks ago -- I decided to post again,
because I find myself creating another StateObjectFactory.
>From time to time I need to generate an ASO that contains some
preconfigured state. It is my understanding that in order to do this I
need to use the <invoke-factory> element in my
tapestry.state.ApplicationObjects contribution. <invoke-factory> in
turn points to an impl of StateObjectFactory:
<state-object name="mySessionBean" scope="session">
<invoke-factory object="service:factoryThatBuildsBeans"/>
</state-object>
<service-point id="factoryThatBuildsBeans"
interface="org.apache.tapestry.engine.state.StateObjectFactory">
<invoke-factory>
<construct class="gov.usitc.BeanBuilderFactory">
<set property="propName" value="some
value"/>
</construct>
</invoke-factory>
</service-point>
My StateObjectFactories tend to just copy/inject their immutable state
to the new instance they are generating.
Is there a simpler way to do this?
The factory code I write mimics, in a very inflexible and watered down
way, the DI facilities provided by Hivemind. Avoiding the need for this
factory code, and the tests that come with it ;), is a reason why I like
DI so much.
Which makes me think I am not using Hivemind properly.
Carlos
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]