I have a basic question on class diagrams.
I am doing my SCEA part2 assignment and had this doubt.. I will try to illustrate it with a similar scenario..
I have a EMPLOYEE table and ADDRESS table. EMPLOYEE table has a column ADDRESS_ID foreign key to ADDRESS.ADDRESS_ID.
Now in my object model 1 Employee can have 1 Address.
So when i did my Class Diagram, I had an Association from Employee.
My question is
When i code the class, do I have to add the Address object in the Employee class? or
Could I just do with a class memenr addressId ?
If I do it the 2nd way is my class diagram incorrect ?
I feel this is even more important while using EJB3 JPA. while loading the Employee object, EM would also load the Address object vs Just loading the address Id(if 2nd approach is taken).
Let me know your thoughts!!
Thanks
Ashwin
I am doing my SCEA part2 assignment and had this doubt.. I will try to illustrate it with a similar scenario..
I have a EMPLOYEE table and ADDRESS table. EMPLOYEE table has a column ADDRESS_ID foreign key to ADDRESS.ADDRESS_ID.
Now in my object model 1 Employee can have 1 Address.
So when i did my Class Diagram, I had an Association from Employee.
My question is
When i code the class, do I have to add the Address object in the Employee class? or
Could I just do with a class memenr addressId ?
If I do it the 2nd way is my class diagram incorrect ?
I feel this is even more important while using EJB3 JPA. while loading the Employee object, EM would also load the Address object vs Just loading the address Id(if 2nd approach is taken).
Let me know your thoughts!!
Thanks
Ashwin