Hi, 
Thanks for the info on PlugIn.
We are doing something like below:
 
public class ServiceFactory implements PlugIn

{

        public ServiceInterface createService() throws ClassNotFoundException, 
IllegalAccessException, InstantiationException{

        String className = servlet.getInitParameter(ServiceConst.SERVICE_CLASS_KEY);

        className = (className != null) ? className : ServiceConst.SERVICE_CLASS_NAME;

        return (ServiceInterface) Class.forName(className).newInstance();

        }

}

So, it means the ServiceFactory is available in the application scope, and possible to 
access it as below:

ServiceFactory serviceFactory = 
(ServiceFactory)getApplicationObject(ServiceConst.SERVICE_FACTORY_KEY);

Now, the question is, where do we set up the Key-Value, for accessing the application 
scope objects?

and what is the "servlet" object used in this example?

and another question is, (un-related to above topic), will there be any performance 
hit, if the java file is growing larger?

I appreciate your help,

Thanks & Regards,

Gopal

        -----Original Message----- 
        From: Ted Husted [mailto:[EMAIL PROTECTED] 
        Sent: Thu 12/11/2003 12:39 PM 
        To: Struts Users Mailing List 
        Cc: 
        Subject: Re: PlugIn Interface implementation
        
        

        The purpose of the plugin interface is to give people a chance to
        initialize their own resources without subclassing ActionServlet or
        creating their own.
        
        Typically, you would not use the PlugIn class directly, but whatever
        resources it initialized (and then placed in Application scope under a
        known name).
        
        In any event, you should definately remove any service methods from the
        Action class and place these on some other object. A very good candidate
        for a service layer is the Chain of Command package, now in the Jakarta
          Commons Sandbox. Another likely suspect is HiveMind (also in the
        Sandbox).
        
        HTH, Ted.
        
        Gopal Venkata Achi wrote:
        > Hi All,
        > 
        > Has anyone experienced with PlugIn interface implementation?
        > We are thinking of abstracting the service calls from the action class and 
creating the service layer which implements PlugIn. 
        > Please suggest me on what is the advantage that we get by implementing this 
PlugIn, and is this PlugIn is a kind of marker interface, does it allow me to create 
different methods while implementing?
        > In implementing class, what are all objects that we have access to?
        > 
        > I appreciate any help/suggestions in this regard.
        > 
        > Regards,
        > Gopal
        > 
        >
        >
        > ------------------------------------------------------------------------
        >
        > ---------------------------------------------------------------------
        > To unsubscribe, e-mail: [EMAIL PROTECTED]
        > For additional commands, e-mail: [EMAIL PROTECTED]
        
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        

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

Reply via email to