Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Suggest a pattern  RSS feed

 
Ramu Nur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stephan van Hulst
Saloon Keeper
Posts: 6973
109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with each method sending the request, and then just returning a different type?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!