• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use of Helper classes  RSS feed

 
Mohankumar G
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one help me in explaining the need of helper classes and where we can use it?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean Helper classes for EJB?
 
Mohankumar G
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. for EJB
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One example that I have come across is :
Order and OrderlineItems. These need not be 2 different Entity Beans.
The design could have only 1 EJB, the OrderEJB containing a Collection of
OrderlineItems, which are just simple java classes, called as Helper Classes. Orders and OrderlineItems are still stored in different tables.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could have a helper class for sending confirmation emails to Customers.
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Helper classes can be used as dependent objects(OrderlineItems of vishkumar) or may be as Value Object POJO's or as Utility classes (like email sender of pradeep).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!