This article showcases the MVC (Model View Controller) architecture by applying it to Moodle, a popular learning management system used by many institutions across the world to solve a practical problem.
Adesign pattern is a template used for writing flexible and efficient code. You can think of it as a programming model for implementing solutions to problems, irrespective of their complexity. There are several design patterns such as Singleton, Prototype, Adapter, Proxy, Command, etc. The one that’s the focus of this article is MVC (Model View Controller).
MVC divides the design into three parts – the data (model), the user interface (view) and the logic (controller), commonly referred to as ‘business logic’. The user has access to only one component out of the three, i.e., the view. The input that the user gives to the view is handled by the controller. The controller acts as the middleman between the view and the model. It processes the input, and in this process, it may either use the data stored in the model or store data in the model. Thus, each component is dependent on both the other components directly or indirectly.
In this article, we are going to look at the implementation of MVC design using Moodle, a popular learning management system. The article demonstrates how MVC can be used to create a plug-in for Moodle (Modular Object Oriented Dynamic Learning Environment), an open source learning management system used widely across many educational institutions and various other domains to encourage the learning