If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Help - translating an extended class relationship into a database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-10, 21:36
jizznit jizznit is offline
Registered User
 
Join Date: Feb 2007
Posts: 2
Help - translating an extended class relationship into a database

Hi,

I'm been working on a personal project to practice some of my Java and Database skills.

Its a simple application which will allow me to collect and maintain information on all the different applications I have running.

Take a look at the attached ERD and hopefully it will all make sense.
For example an application(Environment) may have a database which will have db server connection details and also frequent queries that I would run.

My issue is with the similar entities i.e. DataBase and SSH entities (pretty much the same entity) and the DBServer and SSHServer (contain common fields).

With my class diagram I have rolled together all the common features into abstract class's and then I extend these to create more specific objects (to make use of polymorphism).

Should this translate straight to the database, should I roll all these similar entities into one generic table with all the columns and maybe an additional 'type' column (so I could add a check constraint that says:
if type='DBSERVER' then driver cannot be null)?
Ive also attached an ERD of what this might look like - See ServerERD1.jpg.

It seems cleaner to me to leave it as it is, but I would be interested to hear what you have to say.

Thanks in advance.
Attached Thumbnails
Help - translating an extended class relationship into a database-servererd.jpg   Help - translating an extended class relationship into a database-servererd1.jpg  
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On