posted 16 years ago
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 that I will associate to an employee later on.
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.