Employee and EmployeeInfo - C # relationship
I have two classes.
Employee (Model)
EmployeeInfo (Another Class)
//Employee GetEmployeeInfo(int empCode) (MethodName)
EmployeeInfo
the class returns the type Employee
.
Now what is relationship
between Employee
and EmployeeInfo
? (Aggregation, composition or association?)
I am assuming that EmployeeInfo
a new instance is being created Employee
. So when the class object EmployeeInfo
is dying, then Employee
. This means death relationship
. So, attitude Composition
?
Sorry if this is a naive question, but it won't work.
source to share
If a specific EmployeeInfo is created and dies with a specific employee then it is a composition.
If a specific EmployeeInfo can have a specific Employee, but can exist without it, then it is Aggregation.
Both composition and aggregation are types of associations, they are only specialized associations.
Yes, I would say that the relationship that you describe will make up.
source to share