MVC_02
MVC_02
1/3/2025 1
Module 2
1/3/2025 2
Module Overview
Extreme Programming Begins with solving a few critical tasks. Developers test the
simplified solution and obtain feedback from stakeholders to
derive the detailed requirements, which evolve over the project life
cycle.
Test-Driven Development A test project is created and you can test changes to the code
singly or as a group, throughout the project.
Unified Modeling UML diagrams are used for planning and documenting purposes,
Language across all project development models.
1/3/2025 5
Gathering Requirements
• Functional requirements describe
how the application responds to
Log On
users
• Technical requirements describe the
technical features of an application, Log Off
Anonymous User
such as availability, security, or
performance
Add Favorite
• You can build functional
requirements by using:
• Usage scenarios Add Photo
Authenticated User
• Use cases
• Requirements modeling in agile
Sample UML Use Case Diagram
• User stories in extreme
programming
1/3/2025 6
Planning the Database Design
• Logical Modeling
• Physical Database Structure
• Working with DBAs
• Database Design in Agile and Extreme
Programming
1/3/2025 7
Planning for Distributed Applications
• Layers
Browser
• Presentation
• Business Logic
• Data Access
Web
• Database Server Presentation
• Communication
• Security
Middle Business Logic
Tier Data Access
Server
Database
Server
1/3/2025 8
Planning State Management
• Client-side locations to store state data:
• Cookies
• Query Strings
1/3/2025 9
Planning Globalization and Localization
• You can use the internationally-recognized set of language
codes available in browsers to present content customized
to suit a user’s language or region
• You can use resource files to provide a localized response
suitable to a user’s culture
• You can use separate views to suit each language code
1/3/2025 10
Lesson 2: Designing Models, Controllers, and
Views
• Designing Models
• Designing Controllers
• Designing Views
Designing Models
• Model Classes and Properties
• Domain Model and Logical Data Model Diagrams
• Relationships and Aggregates
• Entity Framework
• Design in Agile and Extreme Programming
1/3/2025 12
Designing Controllers
Controller Action
AddPhoto (GET)
Photo AddPhoto (POST)
DisplayGallery (GET)
Logon (GET)
User
Logon (POST)
1/3/2025 13
Designing Views
• Views, Templates,
and Partial Views Adventure Works Photo Sharing Log On
Add Comment
1/3/2025 14
Lab: Designing ASP.NET MVC 5 Web Applications
• Exercise 1: Planning Model Classes
• Exercise 2: Planning Controllers
• Exercise 3: Planning Views
• Exercise 4: Architecting an MVC Web Application
Lab Scenario
Your team has chosen ASP.NET MVC 5 as the most
appropriate ASP.NET programming model to create the
photo sharing application for the Adventure Works web
application. You need to create a detailed project design
for the application, and have been given a set of functional
and technical requirements with other information. You
have to plan:
• An MVC model that you can use to implement the
desired functionality.
• One or more controllers and controller actions that
respond to users actions.
• A set of views to implement the user interface.
• The locations for hosting and data storage.
Lab Review
• What model classes should be created for the photo sharing application based on
the initial investigation?
• What controllers should be created for the photo sharing application based on
the initial investigation?
• What views should be created for the photo sharing application?
Module Review and Takeaways
• Review Question
• Real-world Issues and Scenarios
• Tools
• Best Practices
• Common Issues and Troubleshooting Tips