One Line Answer.. Check Factory Design Pattern.
On Thu, Aug 2, 2012 at 10:13 PM, teja bala <pawanjalsa.t...@gmail.com>wrote: > I had a java class(acts as a database class) which got a method which > returns the respective object of the class based on given data(instance > variable) .. eg: given customer id and 3 classes clerk,manager,salesperson > like that .. method should return the instance associated with the customer > id.. > can anyone suggest how to approach this?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.