axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <atma...@gmail.com>
Subject Re: Best Practice for providing Web Services for existing classes
Date Sat, 21 May 2005 12:08:13 GMT
3 -- refactor it. 

On 5/20/05, Michael Oliver <oliverm@sourceonenet.com> wrote:
>  
>  
> 
> Let's say I have an existing web application, and it has a number of
> behaviors that I want to expose via web services.  These behaviors are
> implemented in classes that are designed to handle web events like post and
> get.  
> 
>   
> 
> If these classes have a method I want to expose such as the following: 
> 
>   
> 
> public ActionForward execute(ActionMapping mapping, 
> 
>                               ActionForm form, 
> 
>                               HttpServletRequest request,                   
>                          HttpServletResponse response) throws Exception 
> 
>         
> 
> (yes some would recognize this is a Struts action class and its default
> execute method) 
> 
>   
> 
> The question is.... 
> 
>   
> 
> 1.    Is it better/easier to take the guts of this class and copy it to a
> class without the request and response and mapping which normally have
> nothing to do with the processing of the form? 
> 
> 2.    Is it better/easier to just do a Java2WSDL from this class? 
> 
> 3.    Or… refactor the meat of this class into a separate class and call
> this new refactored class from from it and then run Java2WSDL from the new
> refactored class? 
> 
>   
> 
>   
> 
> Michael Oliver 
> 
> CTO 
> 
> Alarius Systems LLC 
> 
> 6800 E. Lake Mead Blvd, #1096 
> 
> Las Vegas, NV 89156 
> 
> Phone:(702)643-7425 
> 
> Fax:(702)974-0341 
> 
> *Note new email changed from oliverm@matrix-media.com 
> 
>
Mime
View raw message