Quote:Original post by PlayfulPuppyQuote:Original post by OrangyTang
Classes should be small, simple and have a well defined name and purpose. 'Manager' violates all of these.
Although if you do that too much you'll just have a goddamned encyclopedia of classes you have to hunt through to get the required functionality.
An 'encyclopedia' as you put it is a good thing. You get smaller, loosely bound classes which increases flexibility and makes code reuse much better. 'Hunting though' isn't an option because you have a series of interfaces (inherant in the small-class approach) each of which provide greater and greater levels of abstraction, and you just pick the level you need at any given time.
Quote:A manager, to me, is any single object that preforms operations on multiple objects of a given type. It keeps a list of all relevant objects (All textures loaded, all entities in the map, etc) and provides an interface for operations that involve all of those objects (Garbage collection, sorting, finding, deleting, etc).
What's so wrong with that?
Because you've now got a big, clunky class which is tightly bound with every piece of functionality you have. If you even need a specific subset you're stuffed, flexibility is greatly reduced and code reuse is practically nil.
I personally see these as bad things.