So far, we have seen that an app contains just one model struct, one enum of messages, one create function, one update method, and one view method. This is good for very simple apps, but with more complex apps, this simple architecture becomes unwieldy. There is a need to separate different portions of the app in different components, where each component is designed with the MVC pattern and so it has its own model, controller, and view.
Typically, but not necessarily, there is a general component that contains the portions of the app that remain the same for all of the app:
- A header with a logo, a menu, and the name of the current user
- A footer containing copyright information and contact information
And then in the middle of the page, there is the inner part (also named the body, although it is not the body HTML element). This inner part contains the real information of the app and is one of many possible components or forms (or pages):
- Let's run the login app...