Could you please explain a fill better why the "Level of cohesion of A and B cannot be determined." anwser is right?
You explained this way:
"Cohesion means how focused is a class with respect to the functionality that it provides. If it does multiple unrelated things, it is low on cohesion. Low cohesion is a bad thing.
In this case, since there is no information about the functionality, we can't really determine the level of cohesion."
If a coesion means "how focused is a class with respect to the funcionality that it provides then the cohesion of A and B is high because B is-a A.
Thanks
About Question enthuware.ocpjp.v7.2.1231 :
Moderator: admin
-
- Posts: 19
- Joined: Thu Feb 28, 2013 9:47 am
- Contact:
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1231 :
Yes, B is-a A, but what do B and A do? What functionalilty do they implement? This is not given in the question but it is required to determine the cohesion.
For example, let's say you have a class Student. Now, if this class captures Student attributes and also contains functionality for some unrelated stuff such as maintain account balances, then it is low on cohesion.
HTH,
Paul.
For example, let's say you have a class Student. Now, if this class captures Student attributes and also contains functionality for some unrelated stuff such as maintain account balances, then it is low on cohesion.
HTH,
Paul.
Who is online
Users browsing this forum: No registered users and 10 guests