• Post Reply Bookmark Topic Watch Topic
  • New Topic

Business logic in Factory class

 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a J2EE application when we create a factory class is it advisable to place business logic inside the factory class ?Although i havent come across a doc which strictly prohibits this, have not seen business logic placed in Factory methods either.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not really what the factory is for. The factory is just there to supply business logic, which is changeable at run time. If you've got some common logic, put it in a base class from which all your factory classes extend, not in the factory class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!