PDA

View Full Version : database design from OO perspective ..HELP!!?


premesh
03-06-03, 14:59
So im having some trouble designing a database i want to use.
here is an example of my object design
[a] - abstract class
int ID_NUMBER
String NAME

[a.1] extends [a] abstract class



[a.2] extends [a] abstract class



[b] extends [a.1] abstract class


[c] extends [a.1] abstract class


[d] extends [b]
[e] extends [b]
.
.
.
[h] extends [b[

so i have this tree type object design in which they all have an ID and a name... and ultaimatly a type .
at first we had a table with a list of ID's names and "types" being some character that represented a type ( could possibly be looked up in some sort of a typeCode table") but since every object has a string of type associated with is it seems messy to store a bunch of tables just to m ap each object ( instance of) to its type..
example
u have a instance of type e... then u know its also of type b and not c as well as type a.1 and not a.2 ... is there a good source to look for as far as books or documentation to map these objects to database tables well?

am328
03-19-03, 08:43
Try using 'Beginning Java Databases'. However you don't necessarily need to map the java objects to mirror your relational database tables.
What are you trying to do? Is this a personal project or for a commercial client?
am328
Originally posted by premesh
So im having some trouble designing a database i want to use.
here is an example of my object design
[a] - abstract class
int ID_NUMBER
String NAME

[a.1] extends [a] abstract class



[a.2] extends [a] abstract class



[b] extends [a.1] abstract class


[c] extends [a.1] abstract class


[d] extends [b]
[e] extends [b]
.
.
.
[h] extends [b[

so i have this tree type object design in which they all have an ID and a name... and ultaimatly a type .
at first we had a table with a list of ID's names and "types" being some character that represented a type ( could possibly be looked up in some sort of a typeCode table") but since every object has a string of type associated with is it seems messy to store a bunch of tables just to m ap each object ( instance of) to its type..
example
u have a instance of type e... then u know its also of type b and not c as well as type a.1 and not a.2 ... is there a good source to look for as far as books or documentation to map these objects to database tables well?

premesh
03-19-03, 12:23
this is for a comercial client..

am328
03-19-03, 12:26
Ok, you may not to mirror the relationship. What you need to is get the business rules first and then you create the classes. Can I ask what you're trying to do? For example are you trying to create a Java User interface so that the client can access or manipulate the data in the database?

am328
Originally posted by premesh
this is for a comercial client..

premesh
03-19-03, 12:38
the clients wont access the date directly.. its bascially modeliong a theme park with reservable(class) and non reservable(class) entities. Each facility ( a class) has 1 to N reservable and non reservable entitiees. Each one of the reservable entities can be numerous things like.. shows, rides, walkups.. etc, so they are sub classes of the reservable type .. the same goes with the non reservable being of types resteraunts, shops, carts...etc. Then client then can look up informatino on any of these things or try to make reservations for the ones that are reservable to add to some sort od a plan... each on of the subclasses more or less have a specific thing about them to justify being seperate. the reservable and non reservable entities each have an id and the facility has an id.. makning the facility id and the reservable/non reservable ID pair unique to each item.

premesh
03-19-03, 12:38
u have aol?

am328
03-19-03, 12:39
nope
do you have MSN?
Download MSN and then we can talk
my email is mohammed_coleman@hotmail.com


Originally posted by premesh
u have aol?

premesh
03-19-03, 12:44
u dotn seem to be online
ppurayil@hotmail.com