About Question enthuware.ocpjp.v7.2.1231 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
muttley
Posts: 19
Joined: Thu Feb 28, 2013 9:47 am
Contact:

About Question enthuware.ocpjp.v7.2.1231 :

Post by muttley »

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

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1231 :

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests