Separating responsibilities – Smart and Presentation components
The information flow of a single-page application (SPA) can be quite complex and, if you don’t think about this flow from the beginning of your design, it can affect the productivity and quality of your project over time.
The simpler the better; therefore, a very common design pattern not only in Angular applications but also in SPAs in general is the composition of interfaces using Smart and Presentation components. In literature and in the community, you will also find this pattern under the name of Smart and Dumb components or Container and Presentation components.
A Smart component has the UI business rule; it is where we will have injected the services that will communicate with the backend and where the interface with the Presentation components will be composed.
A Presentation component is a component that has the sole purpose of showing the data passed by the Smart component, normally via...