Refactoring to Patterns

Prev don't be afraid of buying books Next

When describing this smell, Fowler and Beck write, "A class that isn't doing enough to pay for itself should be eliminated" [F, 83]. It's not uncommon to encounter a Singleton [DP] that isn't paying for itself. In fact, the Singleton may be costing you something by making your design too dependent on what amounts to global data. Inline Singleton (114) explains a quick, humane procedure for eliminating a Singleton.

Amazon

Категории