Model-View-Controller (MVC)

The MVC design pattern is the most used pattern for designing API systems. The main idea behind MVC is separated presentation (https://martinfowler.com/eaaDev/SeparatedPresentation.html), where the architect endeavors to make a clear division between domain objects which model the real world and presentation objects which are the visual representation elements (or the GUI). This pattern defines clear responsibilities for each component:

Let's have a look at each component in detail:

  • Model:
    • Manages the application state and exposes data entities
    • Encapsulates business logic that governs that data, such as accessibility ...

Get Hands-On Software Architecture with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.