Original Post
I know that usually inexperienced individuals do this, but I have even books that have "manager" written in sample code. I think that this needs to stop for the following reasons: 1) Most "manager" classes are just niave encapsulations (or worse, replacements) of standard STL containers. If you are keeping objects in a std::list then just define an std::list, 90% of the time you wil not benefit from some custom interface. STL containers are amazingly versatile things especially when combined with STL algorithms. The end user should not be robbed of the versatility of STL containers. 2) "Manager" is often used to describe classes that do a wide range of very different things. Some handle garbage collection, reference counting, memory allocation, thread synchronization, buffer creation and reuse, inter object communication. 3) Most "manager" classes can be more effectively replaced with the following solutions: - a) A simple raw STL container with 0 encapsulation - b) A version of the "mediator" pattern (look up Design Patterns) - c) A version of the "factory" pattern (look up Desing Patterns). There is no reason why a Factory cannot contain data that is shared between instances of the created object. - d) This is an idea that I am modifying, but... A "resource pool" pattern. I consider a "factory" that maintains a list of objects for reuse of those objects by multiple users as a "resource pool." There are many types of "pools" demonstrated by programmers far better than me. I have seen VBO pools, streaming buffer pools, thread pools, etc... - d continued) Essentially, anytime that you have an object who's creation and destruction is costly there is a chance that a pool is the solution. Instead of destroying the object you keep it in memory and reassign it to another user when it is needed again. It is also a good solution for when the same data is used by multiple object instances (ie, a mesh used by several different instances of an Entity). When the object is loaded into memory you can hold on to a copy of it, pass out a const (which is an obvious limitation) reference so that it is not copied, and divy out references everytime that same data is requested. Regardless of what specific solution that your application needs the fact still remains that the term "manager" will provide zero hint as to what you are actually describing. Programming is a very exacting science, even in the midst of abstractions, if you are not clear on what it is that is being designed, then it will generate ambiguity. Ambiguity leads to buggy, sloppy, unmaintainable software. If you get the inclining to call something a "manager" please stop first, think about it, and then try to understand what it is that you really need. Chances are that you will come up with a better performing, more versatile, and less ambiguous solution. There are many options out there, please consider them. Also as a side but still slightly related rant... Please stop using "char *" as an ID for everything. Every engine I see does this, and many "manager" classes do this as well. Numbers are faster, std::string's are less error prone, and everytime you rely on abritrary strings as ID's you force every other part of you engine to adapt to that dependance. Maybe this is what you want, but the chances are that there are other solutions that would allow for much looser coupling. Yes... Loose Coupling is a good thing!