P
P
p4s8x2015-04-02 19:26:48
Yii
p4s8x, 2015-04-02 19:26:48

Application architecture. Alternatives to MVC?

We develop applications - backend for social games. We work with MVC, but it turns out it's not very convenient.
Events like startGame come from the client - All the main logic is wired in models and events, each action of the controller is something like

public function actionStartGame ($map, $level, $someParams) {
    $user = User::getById($clientID);
    $user->game->start($map, $level, $someParams);
    return $user->responseEvents;
}

There are a large number of components that "connect" to the model and subscribe to its events:
onStartGame()
onLoseGame()
and so on.
What I don't like: each controller action is actually a repetition of a method call in the model, and the same one. Surely, there is a pattern - more suitable for this type.
From the description of this, there was a link to a Habr to a certain MOVE , but no examples of implementations were found on the network.
What are the patterns\frameworks for similar tasks?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Simasik, 2015-04-02
@Simasik

Well, it's probably enough to understand that a pattern is a template. A template is a ready-made solution that you will or will not use in your project. My opinion is that the template should not be used everywhere, so that later you can shout: "But my engine is made on mvc." You can take general principles from several templates, merge them together and get what you need. Don't limit yourself to templates!

L
Lander, 2015-06-11
@usdglander

> There are a large number of components that "connect" to the model and subscribe to its events:
upd: Although now it seemed to me that I was a little late with the answer...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question