Questions 1-3 are based on the following OO class model:
The following addMember
methods are supposed to be
part of the JS class that implements the Committee
class
from the above class model. Which of the following methods is correct?
Select one:
O
class Committee { ... addMember( m) { this._members[m.memberNo] = m; m.committes[this._name] = this; } ... }
O
class Committee { ... addMember( m) { this._members[m.name] = m; m.committes[this._name] = this; } ... }
O
class Committee { ... addMember( m) { this._members[m.memberNo] = m; m.committes[this._name] = m.chairedCommittee; } ... }
Maintaining the derived set of inverse references that form the
collection value of the derived inverse reference property
ClubMember
::committees
requires that ...
(select one or more):
☐ Whenever a ClubMember
object reference
m
is added to the collection value
c.members
of a Committee
object
c
(with the help of the addMember
method),
also the inverse object reference c
has to be added to
m.committees
.
☐ Whenever a ClubMember
object reference
m
is removed from the collection value
c.members
of a Committee
object
c
(with the help of the removeMember
method), also the inverse object reference c
has to be
removed from m.committees
.
☐ Whenever a Committee
object c
(with multiple ClubMember
object references
c.members
) is destroyed, all ClubMember
objects m
where the collection value
m.committees
contains m have to be destroyed as well,
or, alternatively, c has to be removed from the collection values
m.committees
for all ClubMember
objects
m
.
☐ Whenever a new Committee
object c
is created with a set of ClubMember
object references
members
as the value to be assigned to
c.members
, c
has to be added to
m.committees
for all ClubMember
objects
m
from members
.