Java Reference
In-Depth Information
Chapter 7. Introducing Responsibility
The responsibility of an object is comparable to the responsibility of a representative in the
Oozinoz call center. When you order fireworks from Oozinoz, the person you speak to is a
representative for the company—a proxy. He or she performs foreseeable tasks, usually by
delegating tasks to other systems and people. Sometimes, the representative will delegate a
request to a single, central authority who will mediate the situation or will escalate problems
up a chain of responsibility.
Like call center representatives, ordinary objects have the information and methods they need
to operate independently. Sometimes, however, you need to centralize responsibility,
diverting from the normal independent operation of objects. Several design patterns address
this need. Other patterns let objects escalate requests and isolate an object from other objects
that depend on it. Responsibility-oriented patterns provide techniques for centralizing,
escalating, and limiting ordinary object responsibility.
Ordinary Responsibility
You probably have a strong sense of how attributes and responsibilities should come together
in a well-formed class, although it can be challenging to explain your views.
Search WWH ::




Custom Search