Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cohension - Service Locator

Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm reading the Head First Servlets & JSP book. Page 779 states that the Service Locator is based on: hiding complexity and separation of concern. Couldn't the Service Locator also be based on cohension too? Reading page 743, Cohension is described as "the degree to which a class is designed for one, cohesive, task or purpose. This to me seems to fit the Service Locator? The Service Locator performs registry lookups...isn't this a cohesive pattern? Would someone please clarify to help me understand how the Service Locator isn't? And also what about Front Controller, cohension seems to fit since it's purpose is to navigate an app's request to the appropriate place?

Thank you in advance for your feedback.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic