UML class diagrams - Relational Model mapping question
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jose_ortuno
Posted On:   Monday, April 2, 2007 10:15 AM

Hi all out there, Perhaps this is a silly questions but will help me clarify some issues. We are working in a human resources/pay roll project. Currently we are at the designing stage and I am facing a problem with the UML/RELATIONAL MODEL mapping. Here I will show a little part of our class diagram just to keep it ease: class employee id name lasName addres etc some methods m1, m2,m3 ... class secretary inherits from employee class Clerk inherits from employee class Manager inherits from employee ...    More>>


Hi all out there,


Perhaps this is a silly questions but will help me clarify some issues.


We are working in a human resources/pay roll project. Currently we are at the designing stage and I am facing a problem with the UML/RELATIONAL MODEL mapping.



Here I will show a little part of our class diagram just to keep it ease:


class employee

id

name

lasName

addres

etc

some methods

m1, m2,m3 ...



class secretary inherits from employee

class Clerk inherits from employee

class Manager inherits from employee

...



In my relational model I have:




Table Employee

id

name

lasName

addres

type -> witch maps to EmployeeType.id

etc




Table EmployeeType

id

description

example >>>> 01 Manager

02 Secretary

03 Clerk

04 Etc




My question is:


Should I have a class EmployeeType since it is a entity in my db model?


I am avoiding to have a class so I will add Employee subclasses as we need another employee type. However, that will change my class diagram and will add some NEW code.


From the user perspective, however, it will be just another record in the EmployeeType table.


At this point I get confuse because I should not change my model just because a new Type of something appears.


I will like to know the right way to model this situation. So if anybody can point me in the right direction I will really appreciate it.


Thanks in advance!

Jose.



PD: Hope my explanation depicts the problem right.

   <<Less

Re: UML class diagrams - Relational Model mapping question

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, April 7, 2007 08:58 AM

I think you are seeing the classic "impedance mismatch" between relational (database) models and object models, because UML is based on objects. Maybe you can look up references on that subject, to see what others have done in the past.
About | Sitemap | Contact