SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)?

    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 Images Attached Images

  2. #2
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to make things clear here is an ERD of my alternative solution.
    Attached Images Attached Images


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •