samedi 8 août 2015

How to design models to access data hierarchy from up or bottom?

I know that the question sound weird but an example will clarify my thoughts.

Suppose I have 2 classes Employee and Department:

*Department has an Arraylist of employees.

This way I can access employees in a specific department.

What do I have to do if I also need to access the employee department from the Employee object?

I think that also adding the department to employee object is a bad practice?

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire