Managers vs. Controllers

hi guys,
I’ve a very simple question for which I can find no straight-forward answer to. What is the difference between Managers and Controllers? It seems like there is no consistency in this naming convention and some seem to call SoundManager or SoundController to define classes with the same roles and responsibilities. I thought maybe Controllers were part of an MVC type of implementation, but every time I see a Manager in other people’s projects, I can’t see the difference.

any thoughts?

Hello Matheus,

I’ve noticed this trend as well. I’ll give you my personal guidelines on naming and how I reason about them. Ultimately, for better or for worse, it’s completely up the developer.

When I think of a controller, I generally think of a controller that is tied to one component. Think about the context of MVC where a Model, View and Controller are generally coupled to accomplish a task like authenticating a user. I use “controller” to represent responsibility for controlling a game object like the player.

I think of “manager” as an overseer of sorts. I use managers to represent instances that are responsible for managing multiple components (think the mediator pattern, responsible for managing communication between components) and usually has a long lifespan; potentially the life of the game.

I hope this helps.

Happy Coding :slight_smile:

Privacy & Terms