Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 8981
19
  • 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

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!