• Post Reply Bookmark Topic Watch Topic
  • New Topic

Pattern: converters.  RSS feed

 
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Partners!
Please help with architectural decision.
I have 2 converters:

How to abstract from concrete converters to add new implementations in future?
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi surlac,

I'm not sure if I got your question properly, but (especially in case of converters), I would use Abstract-Factory pattern - that is - an abstract factory - which will create a concrete factory (XMLConverterFactory or JSONConverterFactory) which will further create relevant concrete objects (XMLConverter or JSONConverter).

To make it even better, I would use an interface for converter (which will be implemented by all converters), an interface for node and so on.

I hope this helps.
 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anayonkar Shivalkar wrote:
I'm not sure if I got your question properly, but (especially in case of converters), I would use Abstract-Factory pattern

You've got it right. Thanks for your advice.
So it can be used to load additional concrete converters from external jars, right? Separate from abstract factory jar.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!