0% found this document useful (0 votes)
10 views10 pages

Week 9

Design patterns are templates that describe problems and solutions in software design, categorized into creational, structural, and behavioral patterns. They enhance code reusability, maintainability, and communication among developers while reducing development time. The document also discusses ASP.NET MVC, an application framework that utilizes the MVC architectural pattern for clean separation of concerns and improved testability.

Uploaded by

hananstemec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views10 pages

Week 9

Design patterns are templates that describe problems and solutions in software design, categorized into creational, structural, and behavioral patterns. They enhance code reusability, maintainability, and communication among developers while reducing development time. The document also discusses ASP.NET MVC, an application framework that utilizes the MVC architectural pattern for clean separation of concerns and improved testability.

Uploaded by

hananstemec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Software

Engineering 1
Week 9
2

What is desgin pattern

• Design patterns are not finished code solutions, but rather


templates or blueprints.
• They describe a problem, its solution, and the context in which the
solution can be applied.
• Design patterns provide a common vocabulary for developers to
discuss software design
● Design patterns aren't one-size-fits-all solutions. They offer a
general approach or template that you can adapt to the specific
needs of your project
3

categories of design patterns


• There are three main categories of design patterns:
• Creational patterns: Focus on object creation mechanisms,
promoting flexibility and decoupling. (e.g., Singleton, Factory
Method)
• Structural patterns: Deal with the composition of classes and
objects, addressing how classes and objects can be structured
to form larger structures. (e.g., Adapter, Facade)
• Behavioral patterns: Define communication patterns between
objects, specifying how objects interact and collaborate. (e.g.,
Observer, Strategy)
4

Benefits of Using Design Patterns


• Improved code reusability: Design patterns provide reusable
solutions that can be applied in different contexts.
• Increased code maintainability: Code that follows design
patterns is often easier to understand, modify, and debug.
• Enhanced communication: Design patterns provide a
common language for developers to discuss software design.
• Reduced development time: By utilizing proven solutions, you
can save time by not having to reinvent the wheel
5

key differences between design patterns and


architectural patterns:
• Design Patterns:
• Focus on specific problems within a software system's codebase.
• Address object or class-level interactions.
• Examples: Singleton pattern (ensuring one instance), Factory
method (flexible object creation)
• Architectural Patterns:
• Deal with the overall structure of a software application.
• Define how different subsystems communicate and interact.
• Examples: Client-Server architecture (separation of concerns),
MVC (Model-View-Controller) pattern for UI development.
6

Example on Desgin pattern


ASP.NET MVC

What is ASP.NET MVC?


The ASP.NET MVC is a web application development framework provided by Microsoft which
is built on top of the .NET Framework. We can use this ASP.NET MVC Framework to develop
web applications that provide a clean separation of code.
The ASP.NET MVC Framework is based on MVC (Model-View-Controller) architectural pattern
which separates an application into three distinct layers
8

Mvc layers
● Model: Encapsulates the data and business logic of your
application. It represents the core functionality and data
structures.
● View: Responsible for presenting the data to the user. Views
typically consist of HTML, CSS, and JavaScript code that
defines the user interface.
● Controller: Handles user interactions and requests. It interacts
with the model to retrieve or manipulate data, and then
selects the appropriate view to display to the user.
9
0

Benefits of ASP.NET MVC


● Clean Separation of Concerns: MVC promotes a clear
separation between data, presentation, and application logic,
making code more maintainable, testable, and reusable.
● Flexibility: The MVC pattern allows for flexibility in choosing UI
technologies (HTML, Razor views, etc.) and data access
methods (ADO.NET, Entity Framework, etc.).
● Testability: Unit testing controllers and models becomes
easier due to their decoupled nature.
● Large Community and Rich Ecosystem: ASP.NET MVC benefits
from a vast community of developers and a wealth of
available resources, tutorials, and libraries.

You might also like