Software Engineering
Week 4
Software Engineering
Wk Lecture Practical
1 Introduction Canvas, Assessment Understand the case study.
Software lifecycle Write the user stories.
Design the database and the
2 Work as a group! Agile software
Plan the work on the UI Review of the software requirements and Set the version control
and the Use Case diagram. design
Review of the OOP concepts.
3 User Stories Git
4 Plan the work on the user Graphical User Interface. MVC pattern. Coding
stories Retrospective
Check if you are on track.
5 Plan the work on the From UML to C# code
database Create and connect the database to the
application.
6 Plan the current task Testing
7-9 Retrospective. Design patterns More coding.
Plan the current task. Accomplish the quality.
Secure coding.
10 Software Validation and Verification Double check.
No new features.
Software Maintenance. Enhancements.
11 Software Management.
12 Review Presentation
Learning Objectives
1. To understand how to separate the front-end from back-end
2. To learn about the MVC pattern.
Frontend vs backend
Frontend vs backend
Frontend Backend
interacts with the user doesn’t interact with
the user
Database
BACKEND
Frontend vs backend
The classes generating the frontend should be in a package /
namespace.
The frontend classes use the backend classes.
The classes generating the backend should be in a package /
namespace.
The backend classes NEVER use the frontend classes.
Frontend vs backend
Sanity check!
Is there any backend class containing an import of any class from
frontend?
Pros of frontend/backend separation
If separated from the frontend, the backend can be:
• thoroughly tested
• connected to any frontend.
Model View Controller (MVC) Pattern
View
Model
Controller
Model View Controller (MVC) Pattern
• represents the data or
• contains data or
• is interfacing with the database or
Model • holds data in memory that comes from
the database
Deals directly with the database
Model View Controller (MVC) Pattern
Is the GUI (Graphical User Interface) (the
View part of the application that interacts with the
user)
View Is a view of the data/model
Different views for the same model
View
Model View Controller (MVC) Pattern
Contains the logic of the application.
Is the Business logic.
Controller
Stuff that is not in the model or view.
Model View Controller (MVC) Pattern
View
Data Model
Controller
Model View Controller (MVC) Pattern
View
Data Model
Requests data from the model
Listens to the model
Controller
Model View Controller (MVC) Pattern
The Model is passive.
“Notifies” the view about changes.
(see Observer Pattern)
View
Data Model
Never includes classes of the View.
Controller
Model View Controller (MVC) Pattern
View
Data Model
Commands
Controller
Model View Controller (MVC) Pattern
View
Data Model
Commands
Controller
Tells the Model what to do.
Model View Controller (MVC) Pattern
View
Data Model
Commands
Controller
Processes the user’s requests and instructs the model with what
the user wants.
Model View Controller (MVC) Pattern
View
Data Model
Commands
Controller
“Listens” to the Model.
What changes were made in the Model?
Model View Controller (MVC) Pattern
View
Data Model
Commands Commands
Controller
Model View Controller (MVC) Pattern
View
Data Model
Commands Commands
Controller
Changes the view
Model View Controller (MVC) Pattern
View
Data Model
Commands Commands
Controller
“Listens” to the View
Model View Controller (MVC) Pattern
View
Data Model
Commands Commands
Controller
In practice…
MVC is not suitable for every application.
Keep the MVC in your mind and apply some elements of it.
TO DO!
Once the application is finished (by week 9), look at the code and
try to implement the MVC pattern.
Don’t forget …
Wk Lecture Practical
10 Double check.
No new features.
11 Enhancements.
Questions