B
B
Banny_Boom2015-08-07 16:33:32
C++ / C#
Banny_Boom, 2015-08-07 16:33:32

Have I correctly implemented the general model for getting content to populate the template?

It was necessary to make a common model for all pages, the model parses json and makes a selection from the database to fill the template.
I implemented it all like this:
the name of the page is passed to the controller (for example, url - site / main, main is passed);
The controller calls the general model and passes this parameter to it ( main ), there is a selection by this parameter ...
By chance, would such an implementation be erroneous?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail, 2019-01-21
@embiid

public void Define() {
    this._IWeaponBehavior.useWeapon();
}

You useWeapon()return void

S
Stalker_RED, 2015-08-07
@Stalker_RED

Implementation details may vary depending on the task. Most often, it is built like this:
Routing parses the url, and pulls the controller. We can assume that this is a subsystem of the controller.
The controller validates the request parameters and sends them to the model. Or does not even send (For example: "the login field is not filled").
The model saves/gets data, returns it to the controller.
The controller looks at the data again and passes it to one or another View. (For example, "registration was successful" or "oops, the login is busy")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question