I am trying to implement an enrollment organizer for a university but I would ask how to implement the aggregation relationship in Java.
this relationship exist for academicStaff class and the supervisor class in which the academicStaff (e.g prof.) can be a supervisor to multiple courses in a specific semester.
I think that I should make a list of supervisors in academicStaf class and an instance of acadmicStaff in the supervisor class.
so I need help to know the best way to implement this relationship.
thx in advance.
Jump to Post
In general, if there is an aggregation relationship "an A has-many Bs" then you can use any member of the Collection hierarchy to hold multiple instances of B as an instance variable of A.
A simple ArrayList<B> is the most obvious choice, but if you want to access those Bs …
All 3 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.