-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Newbie: Design / Polymorphism
PostPosted: Fri Jul 22, 2005 9:19 am 
Newbie

Joined: Fri Jul 22, 2005 3:38 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Newbie: Design / Polymorphism
PostPosted: Fri Jul 22, 2005 10:12 am 
Newbie

Joined: Tue Mar 08, 2005 4:54 pm
Posts: 9
Location: GHANA WEST-AFRICA
Hello i am trying to get to the link you provided but am getting an error on the page.so am suggesting you send it to me at pkamos@yahoo.com so i help with you with this.

PKKAMOS


quote="pokkie"]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[/quote]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.