Skip to content

Applying MVC architecture

MAYOUF LOTFI p2311989 requested to merge MVC into main

In this implementation, the application leverages a robust MVC architecture, seamlessly integrating the Observer pattern and a Payload mechanism for efficient communication between the Model and Views. The Model, represented by the MessageProcessor and Controller classes, encapsulates the core logic for processing messages and managing user interactions. The Controller acts as the bridge between the Model and Views, facilitating the addition, deletion, and search functionalities.

The incorporation of the Observer pattern further enhances the system's flexibility and scalability. The Subject class, within the Controller, maintains a list of observers conforming to the ViewObserver interface. These observers, representing different views in the application, receive updates through well-defined methods. The use of the Payload object as a communication container enriches the information exchanged during updates, encapsulating details about new messages, deleted messages, and search results.

The application's architecture also demonstrates characteristics similar to the Command pattern, where the Payload serves as a command encapsulating the necessary information for executing specific actions. This approach promotes extensibility, making it straightforward to introduce new functionalities without altering existing components.

By intertwining MVC, the Observer pattern, and the Payload mechanism, the application achieves a clear separation of concerns, making it modular, maintainable, and well-prepared for future enhancements. This design promotes a clean flow of data and actions, ensuring a responsive and extensible chat application.

Merge request reports

Loading