Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is Cohesion Object Oriented Principle?  RSS feed

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, This is from Whizlabs. How come Cohesion is Object Oriented Principle?
Object Oriented Principles are Inheritence, Encapsulation, Abstraction and Polymorphism only know ?

Which statement(s) are true?

A. Cohesion is the OO principle most closely associated with hiding implementation details.
B. Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs.
C. Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose.
D. Cohesion is the OO principle most closely associated with allowing a single object to be seen as having many types.
 
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Saibabaa Pragada wrote:Hi, This is from Whizlabs. How come Cohesion is Object Oriented Principle?
Object Oriented Principles are Inheritence, Encapsulation, Abstraction and Polymorphism only know ?


Yes it is an OO Principle. You will also get to read about one more- Coupling.

Cohesion- How specific the class is designed.
Coupling- Degree to which the class depends on other classes.

Usually the ideal combination is- High Cohesion and low coupling.

I had written a blog post long back related to this. You can read that here.
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cohesion (and coupling, as Mohamed points out) are design principles. They don't just apply to OO systems - the idea of having cohesive components and low coupling between components is applicable to procedural programming and other approaches as well - but they are definitely important in OO design.
 
author
Sheriff
Posts: 8977
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saibabaa,

Can you double check where you got that question? Because it's in our book

Thanks,

Bert
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Bert. This is from your book Question 5 on Page 164. Thanks Mat and Mohammed

Bert Bates wrote:Hi Saibabaa,

Can you double check where you got that question? Because it's in our book

Thanks,

Bert

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!