alt text
Good day.

I am now writing my CMS and the architecture is about the same as in the image (I have my own terminology). Modules communicate with an Application object, sending it requests of type get, set, etc. Application processes these requests and redirects them to the Controller, which is already working with the data store. Coming up with this architecture, I was guided by the substitutability of CMS elements. In particular, I wanted to give the programmer the opportunity to quickly transfer the CMS from files to the database and back and provide an API for creating modules.

Actually, the question is: please evaluate my decision and suggest how you can improve this architecture. And what other options are there?

  • one
    MVC, MVP, MVVM - Gorets
  • Draw us where you have a template engine, then we can communicate more constructively. - Arni
  • Um Ok, changed the image. The modules work through the template engine, the generated code of which is issued to the user. - ling
  • I now can not understand what role does your Controller ? Данными it allow you to interact with different Данными , with different Application-ами or is it an ordinary mediator? - Specter
  • That's right. As I wrote earlier, the Controller was created for easy CMS "swapping" from files to the database. - ling

3 answers 3

In particular, I wanted to enable the programmer to quickly transfer the CMS from files to the database and back

Read about pattern strategy.

Or, create 2 classes

CustomDBData
CustomFileData

and the class Data extends нужный_метод_работы

  • An interesting approach, thanks). - ling

At first glance, the classical form, for the conclusion that I do not understand what is your controller, and the theme of application. Otherwise, the same scheme is used in the http://danneo.com/ engine, I can continue the list. To the author of the topic question.

  1. How is your model protected from wild fruit patterns?
  2. If the client asks to send a letter to the linguist who works for them at the company, every time a new article is added. How do you implement it without affecting the system code using an additional module or component.
  3. How are you going to organize page caching? For each module its own cache? Or are there ideas to create something less controversial with pointers to the type and owner of the cache?
  4. Judging by the figure, you are going to give PCM at the very end, when the CMS code almost completely worked. A bold decision, I believe we are talking about high performance. Please comment on what exactly you see the advantages of this approach?
  • 1. None Actually, I consider it a plus - to have a template for every action. The template engine also allows you to have one template for several actions - this is a question for the programmer. In order not to get confused, the templates should be called as module_action.html . 2. Also nothing - just append an existing one. Although the engine also allows you to overload the functions of the module class. 3. This is the topic that I smoke. How do you advise, in addition to the server level? 4. Pros - one echo for everything, the code can be edited before output, carry out the output also in the file, throw the header. - ling
  • In that case, I have nothing to add. I wish you good luck and inspiration. Understanding the problems will come later. - Arni

only this picture is difficult to assess. In any given situation, a particular architecture may be more beneficial. But the main issue is implementation.

Along the way, there may be nuances and the architecture will have to be changed or corrected.

If the controller checks the access rights, then I want to say that in my CMS the controller is a hotel module, and other modules, if necessary, can use its services. And also independently to influence the rights-access if necessary, which gives greater freedom. And some data can be transmitted altogether bypassing the controller.

Modules are connected dynamically as needed.

In general, I think that in general you should not think about a rigidly fixed architecture.

  • > this is the hotel module, and other modules, if necessary, can use its services. Spend the night there for money? sorry, could not resist =) - Specter
  • Well, modules can work and bypassing the controller is all on the conscience of the module author. But for compatibility it is better through it. =) - ling