Hello,
Well I am currently in the process in designing an application that will be using the following dataschema :
http://www.grosslers.com/dbschema4.jpg
(A product can have many suppliers in case somebody wants to know why there is a link between SupplierProducts and OrderProducts)
Anyway, I am working my way through Hibernate in Action, and one of the intresting things that was mentioned is that the way that Objects are worked with are entirely different from working with Relational data.
So, my question is as follows: At the top of the link there is 3 tables.
- Users (store information about each user, such as login, password, etc)
- Customers (users that will be using the site)
- Suppliers (information about the suppliers, thou the suppliers are never customers)
Ok, so if I was to implement my java application, would it be better to work with all 3 classes indepentantly. For example , 1 Concerete class per table or would it better if I have User as a superclass, then I can subclass Suppliers and Customers (since the information in Suppliers and customers are basically the same) , and then I can at run time (via polymorphism) establish if I need to have a Customer , Supplier or User Object?
Thanks,
-- Izak