0% found this document useful (0 votes)
51 views

Design Patterns

This document discusses two design patterns: MVC and Facade. It describes the MVC pattern as separating an application into three roles - model, view, and controller. The model manages the data, the view displays it, and the controller handles user input and updates the model and view. It then provides an example using a student model, view, and controller. It also describes the Facade pattern as providing a simplified interface to a complex subsystem, hiding its internal complexity. It gives an example using shapes and a facade class to delegate to concrete shape classes.

Uploaded by

nm
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)
51 views

Design Patterns

This document discusses two design patterns: MVC and Facade. It describes the MVC pattern as separating an application into three roles - model, view, and controller. The model manages the data, the view displays it, and the controller handles user input and updates the model and view. It then provides an example using a student model, view, and controller. It also describes the Facade pattern as providing a simplified interface to a complex subsystem, hiding its internal complexity. It gives an example using shapes and a facade class to delegate to concrete shape classes.

Uploaded by

nm
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/ 16

Design Patterns

 MVC Pattern stands for Model-View-Controller


Pattern. Separate application's concerns.
 Model - Model represents an object carrying
data and to update controller.
 View - View represents visualization of the data
that model contains.
 Controller - Controller acts on both model and
view. It controls the data flow into model object
and updates the view whenever data changes.
 It keeps view and model separate.
 We are going to create a Student object
acting as a model.
 StudentView will be a view class which can
print student details on console and
StudentController is the controller class
responsible to store data in Student object
and update view StudentView accordingly.
 MVCPatternDemo, our demo class, will use
StudentController to demonstrate use of MVC
pattern
 Facade pattern hides the complexities of the
system and provides an interface to the client
using which the client can access the system.
 This type of design pattern comes under
structural pattern as this pattern adds an
interface to existing system to hide its
complexities.
 This pattern involves a single class which
provides simplified methods required by client
 Delegates calls to methods of existing system
classes.
 We are going to create a Shape interface and
concrete classes implementing the Shape
interface.
 A facade class ShapeMaker is defined as a
next step.
 ShapeMaker class uses the concrete classes to
delegate user calls to these classes.
 FacadePatternDemo, our demo class, will use
ShapeMaker class to show the results.
 Bernd Bruegge & Alllen H. Dutoit- Object
Oriented Software Engineering- Using UML,
Patterns and Java

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy