SampleFinal Q7a)

6 views
Skip to first unread message

lydial92

unread,
Apr 22, 2011, 12:27:17 AM4/22/11
to UBC CPSC 210
Hi,
in the Sample Final Solution, an AccommodationManager class and
UserManager class are created to remove/get user and accommodation.
However, can't we just include those methods in WhereNotToStay? Why do
we have to create extra Manager classes for them? Is it because we
want the classes to be more cohesive in which they focus on their
specific responsibilities ?

Thanks~

Paul Carter

unread,
Apr 22, 2011, 3:00:45 PM4/22/11
to ubc-cp...@googlegroups.com

> However, can't we just include those methods in WhereNotToStay? Why do
> we have to create extra Manager classes for them? Is it because we
> want the classes to be more cohesive in which they focus on their
> specific responsibilities ?

Right. We now have one class for managing accommodations and another to manage users - these are two different aspects of the system. If we merged these responsibilities into a single class, the resulting class would have poor cohesion.
>

Paul

Reply all
Reply to author
Forward
0 new messages