File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please suggest a design pattern you think might help

 
Roshni Chandrashekar
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic