• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is Cohesion Object Oriented Principle?

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic