Please suggest a design pattern you think might help
Joined: Jan 14, 2012
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?
Joined: Dec 16, 2011
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.
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.
Joined: Feb 20, 2009
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.