This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Suggest a pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Suggest a pattern" Watch "Suggest a pattern" New topic
Author

Suggest a pattern

Ramu Nur
Greenhorn

Joined: Aug 21, 2010
Posts: 22
Hi,
I'm working on some exercises on patterns. I've a requirement wherein the request object is same for 8 methods which invoke a webserice but the response object vary. In responses, some are objects, some of boolean, some are void. The legacy webservice is designed in such a way that response depends on request xml name.

What can be a better design pattern to consider. I thought of template method, but the template method response has to be Object and I don't want to cast it back based on request name. I can have 8 methods, but is there any alternative?

Thanks in adv.
kumar naresh
Ranch Hand

Joined: Mar 12, 2011
Posts: 118
    
    1
I think the choice of having a template method is fine and if you want to type cast it back, Use factory pattern.


OCMJEA 5 |
http://sceacertification.blogspot.in/2011_12_01_archive.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Suggest a pattern
 
Similar Threads
404 Not Found - Servlet runs locally (GlassFish), but Not Found on web site
Question on Pattern
Suggest a pattern
sending email in servlet
when extend a class