Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing as a manager design pattern?

Is there such a thing as a manager design pattern that controls how different entities interact?

This is for a project for which the Environment, EnvironmentListener, and Entity classes have been predefined by our professor.

The static class, Environment, has a single EnvironmentListener interface that has a nextAction() method it just continuously calls kind of like a main loop in a game and because it is for a design patterns class, i can't simply change the code.

I need to allow entities to be dragged, dropped, animated, etc. and thought i would do that using different controllers.

I've been wondering if it was a good idea to make a controller manager which would implement EnvironmentListener and if a pattern like that existed.

The controller manager would simply iterate through a list of controllers and use their call function.

like image 839
cesar Avatar asked Sep 04 '10 08:09

cesar


People also ask

Is design pattern meant only for developers?

Design patterns are not meant for project development. Design patterns are meant for common problem-solving. Whenever there is a need, you have to implement a suitable pattern to avoid such problems in the future.


2 Answers

Sounds like you're after the mediator pattern - which can be thought of as a 'manager' of the objects that it deals with.

like image 182
Will A Avatar answered Sep 22 '22 22:09

Will A


In many systems, a manager is also a facade for a sub-system, and in that scenario it is more of a facade design pattern.

like image 38
jack Avatar answered Sep 22 '22 22:09

jack