SoftwareArchitecture MVC SeminarReport
SoftwareArchitecture MVC SeminarReport
August / 2023
HOA SEN UNIVERSITY
August / 2023
2
TABLE OF CONTENTS
ABSTRACTION ................................................................................................................ 4
CONTENT ......................................................................................................................... 5
1. Definition: ................................................................................................................... 5
2. Operating Mechanism (Flow: View - Controller - Model): ................................... 5
3. Advantages and Disadvantages: ............................................................................... 6
3.1 Advantages ............................................................................................................ 7
3.2 Disadvantages ........................................................................................................ 7
4. Applications: ............................................................................................................... 7
5. Conclusion: ................................................................................................................. 8
6. Demo:........................................................................................................................... 8
7. MVC Architecture Use Cases ................................................................................. 11
7.1 Web Development: .............................................................................................. 11
7.2 Other Domains: ................................................................................................... 11
7.3 Conclusion: .......................................................................................................... 12
REFERENCES ................................................................................................................ 13
3
ABSTRACTION
This report is written by team H’s members to describe clearly about our Seminar project
– MVC Architecture. This work consists of 5 people in total: Ma Chan Hien, Trinh Anh
Cuong, Nguyen Ngoc Quoc, Nguyen Tuan Anh and Lam Chi Khang.
We will briefly describe what is MVC, and how actually MVC work (the MVC flow),
also we will provide its pros and cons. Our aim is to elucidate the fundamental concepts
of MVC, elucidate its operational flow, outline its advantages and drawbacks, and
culminate with a practical demonstration. Last but not least, we will have a small demo
in the end of the seminar to show clearer what we spoke.
4
CONTENT
1. Definition:
MVC, or Model-View-Controller, is a fundamental software architectural pattern widely
employed in various applications, from websites to software systems. It delineates the
application into three integral components, each serving distinct functions while remaining
independent of one another. Notable frameworks supporting MVC include ASP.NET
MVC, Laravel, and Angular. The forthcoming presentation will delve into the core
principles that underpin MVC and illuminate how these components coalesce to drive
functionality.
5
The MVC architecture revolves around three key components:
View: Serving as the user interface, encompassing elements like text, buttons, and images.
Users interact with the application through this interface.
Controller: An intermediary component that retrieves user input from the View and
communicates it to the Model. It facilitates seamless interaction between the View and the
Model.
Model: The logic component where data processing occurs. It handles program logic,
interacts with databases (if applicable), and transmits processed data back to the Controller,
subsequently displayed via the View.
The collaboration and interdependence of these components are pivotal for the proper
functioning of the application.
6
3.1 Advantages
3.2 Disadvantages
4. Applications:
MVC is widely used in various software applications, including:
Web Development: Popular in frameworks like ASP.NET MVC, Ruby on Rails,
and Django.
Desktop Applications: Used in GUI applications to separate presentation from
business logic.
Mobile Applications: Adopted in mobile app development for clean architecture.
Also the MVC's versatility allows its implementation across various domains, including
IoT, AI, gaming, web development, and applications. Web and app domains, in particular,
heavily utilize MVC due to robust support from frameworks and languages, streamlining
project management, maintenance, and development processes.
7
5. Conclusion:
The MVC architecture divides applications into three core components - Model, View, and
Controller. Each has its strengths and weaknesses, and the choice of the most suitable
model for a specific application is paramount. Considering application needs and
characteristics is crucial in selecting an appropriate model. Additionally, exploring other
architectural patterns like MVVM, MVP, MPI, etc., can provide further insights into
optimizing software designs.
6. Demo:
Simple Login Demo in C#
Summary:
This demonstration illustrates a basic login system using the Model-View-Controller
(MVC) pattern in C#. The application comprises three main components:
LoginModel: Manages user data (username and password).
LoginView: Handles user interface interactions and displays messages.
LoginController: Acts as an intermediary, retrieves user input, validates login credentials,
and communicates between the Model and View.
Components:
LoginModel.cs
public class LoginModel {
private String userName;
private String password;
public LoginModel() {
}
public LoginModel(String userName, String password){
this.userName = userName;
this.password = password;
}
LoginController.cs
using System.Data.SqlClient;
9
public LoginVIew getView(){
return view;
}
LoginView.cs
public class LoginVIew {
public void showMessage(String msg){
Console.WriteLine(msg);
}
Program.cs
public class Program {
public static void Main(String[] args){
LoginVIew view = new LoginVIew();
LoginController control = new LoginController(view);
control.login();
control.getView();
}
}
10
7. MVC Architecture Use Cases
7.1 Web Development:
E-commerce Platforms: Building shopping websites where MVC separates product data
(Model), user interface (View), and transaction processing (Controller).
Social Media Platforms: Implementing MVC to handle user profiles (Model), the display
of content and user interactions (View), and managing user actions (Controller).
Content Management Systems (CMS): Utilizing MVC to manage content (Model),
present it in various formats (View), and handle user interactions for content creation and
editing (Controller).
Mobile Applications:
Native App Development: Employing MVC to organize data handling (Model), UI
elements and user interactions (View), and user inputs and app logic (Controller).
Hybrid App Development: Utilizing frameworks like Ionic or Xamarin, where MVC helps
segregate backend data operations (Model), frontend UI rendering (View), and user
interaction logic (Controller).
Desktop Applications:
Business Management Software: Creating applications where MVC isolates the business
logic and data management (Model), the visual representation of data (View), and user
actions and input handling (Controller).
Media Players: Utilizing MVC to separate playlist management and media library
(Model), graphical display of media and controls (View), and user actions like play, pause,
stop (Controller).
Game Development: Implementing MVC to organize game data (Model), render graphics
and animations (View), and handle user inputs and game mechanics (Controller).
11
IoT Applications: Employing MVC to segregate data collection and management
(Model), device connectivity and status display (View), and user or system interactions
(Controller).
7.3 Conclusion:
MVC architecture's versatility and modular structure make it applicable across a wide
spectrum of software development, providing flexibility, scalability, and maintainability
across various domains and platforms.
12
REFERENCES
13