Chapter 8. Singleton
Objects can usually act responsibly just by performing their own work on their own attributes, without incurring obligations beyond self-consistency. Some objects, though, take on further responsibilities, such as modeling real-world entities, coordinating work, or modeling the overall state of a system. When a particular object in a system bears a responsibility on which other objects rely, you need a way of finding the responsible object. For example, you might need to find an object that represents a particular machine or a customer object that can construct itself from data in a database or an object that initiates system memory recovery.
When you need to find a responsible object, the object that you need will, in some ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access