I am going to be a pain and bring back the request for the ability to
specify a factory for components.

I think this is a Good Idea (tm) and provides great flexability for
component developers.

The reason that I want it is :

I currently have an application factory that is the factory for my business
methods.  Currently we use a simple interceptor model using cglib proxies
that extend the business objects to provide transaction management.

We obtain refrences to the business methods using a static registry pattern,
which I want to get rid of.
E.g.

class MyAction
{
        public String execute()
        {
                BusinessObject bo = ApplicationFactory.newBusinessObject();
                setOutput(bo.performBusinessOperation(getActionProperty()));
        }
}

Now, I want to use IoC in webwork2 to provide these objects to my actions -
or to other components.

Currently, I would need to create a component manager almost identicle to
the existing xwork component manager, just adding in factoreies.

I don't see how this will complicate the component system for novice users,
as they can just use a default BeanFactory which just creates a new
instance.

I see it working something like this :

In components.xml keep the scope and enabler node, and instead of having
<class>, specify <factory>.

The factoy is a simple interface

interface Factory
{
        public Object createComponent();
}



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Pat Lightbody
> Sent: Saturday, 19 July 2003 1:33 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] Xwork Components in WebWork2
> 
> 
> Components in XWork's IoC container are constructed lazily -- 
> so yes, an ActionContext should exist. Configuration is 
> looked up from the classpath -- you'll need to override the 
> ApplicationLifecycleListener to change that.
> 
> -Pat
> 
> ----- Original Message -----
> From: "Cameron Braid" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 17, 2003 7:33 AM
> Subject: [OS-webwork] Xwork Components in WebWork2
> 
> 
> > I want to use an IoC approach within webwork2 to provide my manager 
> > components to my actions.
> >
> > I have created the managers and enablers, now the problem 
> is - how do 
> > I configure my manager components ?
> >
> > I need to be able to work out a path relative to /WEB-INF
> > I want to have a config file, either a properties file, or 
> in web.xml 
> > to allow me to spefity this path. Then I was going to get 
> the value of 
> > request.getRealPath("/WEB-INF/" + path), and set it onto my manager 
> > component.
> >
> > Also, when are application scoped components constructed ? 
> when they 
> > are first needed, or on initialization of the component manager ?
> >
> > I need to know this to determine if an ActionContext will always be 
> > availible when the component is constructed.
> >
> > Thanks.
> >
> > Cam
> >
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a 
> single machine. WITHOUT REBOOTING! Mix Linux / Windows / 
> Novell virtual machines at the same time. Free trial click 
> here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> Opensymphony-webwork mailing list 
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to