Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Cohesion

 
vijay basky
Greenhorn
Posts: 18
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Employee
---- maintainEmployeeInfo()
---- connectToRDBMS()

class Payroll
---- setStateTaxCodes()
---- findEmployeesByState()

class Utilities
---- getNetworkPrinter()

Assuming the class and method names provide good definitions of their own functionalities,
which are probably true? (Choose all that apply.)

A. These classes appear to have low cohesion.

B. These classes appear to have high cohesion.

C. These classes appear to have weak validation.

D. These classes appear to have strong validation.

E. These classes appear to have weak encapsulation.

F. These classes appear to have strong encapsulation.



for this question the answer is A,E
but i doubt on answer E
encapsulation is based on how instance variables are binded within instance method in class by making instance variable as private & method as public
please anyone help me to clarify this
thanks in advance

[Devaka: edited to make to question readable]
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4262
229
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please QuoteYourSources
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Encapsulation also means binding the methods with the data they operate on. With that in mind, do you think the method findEmployeesByState belongs in Payroll? Or connectToRDBMS in Employee?
 
vijay basky
Greenhorn
Posts: 18
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James Boswell wrote:Encapsulation also means binding the methods with the data they operate on. With that in mind, do you think the method findEmployeesByState belongs in Payroll? Or connectToRDBMS in Employee?


thanks for the reply man. now i understand
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic