cesar
cesar

Reputation: 9064

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.

Upvotes: 53

Views: 72582

Answers (4)

18446744073709551615
18446744073709551615

Reputation: 16832

The question was asked in 2010, but since at least 2021 (web archive) there is the page https://www.eventhelix.com/design-patterns/manager/ (Manager Design Pattern). I do not want to discuss here whether or not this Manager is a special case of the Mediator design pattern.

Upvotes: 0

Zion Bokobza
Zion Bokobza

Reputation: 91

Data Manager is the implementation of Facade design pastern. It encapsulate the Connection to the database and the transaction scope. It holds all the DAOs or Records (lazy or not lazy) of all the tables it responsible and when he creates one it connects it to the connection and transaction. It can be use as a singleton so you work with one data manager. Data Manager can use cache manager to cache the data that it retrieve from the database and if the same request is issue then it can return the result from the cache.

Upvotes: 4

jack
jack

Reputation: 731

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.

Upvotes: 18

Will A
Will A

Reputation: 24988

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

Upvotes: 50

Related Questions