aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Please suggest a design pattern you think might help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Please suggest a design pattern you think might help" Watch "Please suggest a design pattern you think might help" New topic
Author

Please suggest a design pattern you think might help

Roshni Chandrashekar
Greenhorn

Joined: Jan 14, 2012
Posts: 5
Hi All,

I am trying to build domain objects based on different products returned back in a web service response. Currently 4 products are being returned but it might grow to be 20 something in the future. I want to use design patterns to make the design flexible and strong. Is there anything out there I can use?

Rosh
Murali Ranga
Ranch Hand

Joined: Dec 16, 2011
Posts: 38
May be I did not understand question proprely
different products means each product object represents different class?
or each product object has property/attribute as a product type or something else

you may not required to create domain object for each product.

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4387
    
    8

Hi Roshni. Welcome to The Ranch!

Difficult to say without more information. How do the products differ (in terms of data and behaviour)? As Murali suggests, you might be able to use a single Product class.
Vivekkk Singh
Greenhorn

Joined: Feb 20, 2009
Posts: 16
For you Factory Pattern would be good. As i understood the problem based on the output received from web service objectType. you will be creating some new Domains.
Now the type of objects main increase Hence you may have to create new Domains. So Factory pattern would be good.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please suggest a design pattern you think might help