Ralf Seitner wrote:
But I give you a hint. Simply use a List (java.util.List) and there are
methods like add() and remove().
As of Java 1.5 there are generics, so you can add a member like:
private List<Person> team;
I want "team" to be an object of class Team, not a reference to a list
which holds individual Person objects.
With the newly created data, instances of Team class, I will provide its
relevant operation, like "merge teams", "split teams into several smaller
teams" etc, just similar to operation in the real world.
After that, I will create another new data, Department class, which can
have several teams. I will also provide Department's operations.
Am I thinking correctly in OO spirit or I am completely wrong?
I don't see anything particularly anti-OO. Why don't you show us what