際際滷

際際滷Share a Scribd company logo
1
Nadeesha Thilakarathne
Content
 Definitions of Design Patterns
 Model-View-Controller
 Design Pattern Types
 Singleton Design Pattern
2
Definitions of Design Patterns
 Design patterns are recurring solutions to design problems you see
over & over [smaltalk Companion]
 Design patterns constitute a set of rules describing how to
accomplish certain tasks in the realm of software development 
[Pree,1994]
 Design patterns focus more on reuse of recurring architectural
design themes, while frameworks focus on detailed design &
implementation[Coplien & Schmid ,1995]
3
Definitions of Design Patterns
 A pattern addresses a recurring design problem that arise in
specific design situations & presents a solution to it [Buschmann et
al.,1996]
 Patterns identify & specify abstractions that are above the level of
single classes and instances, or of components.[Gammar et
al.,1993]
4
Model-View-Controller
 The Model-View-Controller (MVC) pattern is one of the earliest and
one of the most successful design patterns. It was developed by
Trygve Reenskaug in 1979.
Controller
Data Model
View
5
Model-View-Controller
 Data Model : Contains the computation part of the program
 View : Which presents the user interface
 Controller : Which interacts between the user & the view
6
Model-View-Controller
 Employee Object as a Model
 EmployeeView a Class which display Employee Information as a View
 EmployeeControl a Class which controls the data flow into model
object and updates the view whenever data changes - Controller.
7
Model-View-Controller Interaction
 It helps to separate the applications concerns
EmployeeController
EmployeeModel
EmployeeView
Sees Uses
ManipulateUpdate
8
Data Model
 Data ,methods for accessing and modifying state
 A model stores data that is retrieved according to commands from
the controller and displayed in the view
9
Data Model
Object of this class can use to hold
the data & methods
10
View
 When model changed view must update
 A view generates an output presentation to the user based on
changes in the model
11
View
Present Information in Console Window
12
Controller
 Translate user actions into operations on the model. Act as a
separator between Model & View.
 A controller can send commands to the
 Model to update the model's state (e.g., editing a document)
 Associated view to change the view's presentation of the model (e.g., by
scrolling through a document).
13
Controller
14
Test Class
15
Design Pattern Types
 Creational Patterns
 Structural Patterns
 Behavioral Patterns
16
Creational Patterns
 Deals with object creation
 Control the object creation
 Trying to create objects in a manner suitable to the situation
17
Creational Patterns
1. Abstract Factory
2. Builder
3. Factory Method
4. Object Pool
5. Prototype
6. Singleton
18
Singleton Pattern
 Define a class that has only one instance(class must ensure that only
single instance should be created)
 Provides a global point of access to it(single object can be used by all
other classes)
Is a class of which there may be no more than one instance. It provides single global
point of access to that instance
19
Singleton Pattern  When to Use
 When its important to have only one instance of a class
 Only a print spooler
 One window manager
 One point of access to database engine
 Among several serial ports only one instance of COM1
 Centralized management of internal or external resources and they
provide a global point of access to themselves
 Singleton pattern is mostly used in multi-threaded and database
applications.
20
Forms of Singleton Pattern
Singleton Pattern
Early Instantiation
(Load Time instance
creation)
Lazy Instantiation
(Create instance
when required)
21
Singleton Pattern - Advantages
 Reuse single instance  save memory
22
Singleton Pattern  UML
<<public class >>
23
Singleton Pattern  Class
 Static member
 Store the instance of the class
 Get memory only once as it is static
 Private constructor
 Prevent creating instances outside the class
 Static factory method (Static factory method is simply a static method that returns an instance of a class.)
 Provides the global point of access to the Singleton object
 Returns the instance to the caller.
24
Singleton Pattern  Early Instantiation
 Create the instance of the class at the time of class loading
25
Singleton Pattern  lazy Instantiation
 Create the instance of the class in synchronized method or
synchronized block
 Instance of the class is created when required
26
Singleton Pattern  lazy Instantiation
27
Conclusion
 MVC Pattern stands for Model-View-Controller Pattern. This pattern
is used to separate application's concerns.
 Singleton Pattern Is a class of which there may be no more than one
instance. It provides single global point of access to that instance
28
References
 https://sourcemaking.com/design_patterns/creational_patterns
 http://www.oodesign.com/singleton-pattern.html#early-singleton
 http://www.javatpoint.com/core-java-design-patterns
 Java Design Patterns  James W.Cooper
29
30

More Related Content

Similar to Design Patterns (20)

Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptx
Sachin Patidar
Design Patterns - GOF
Design Patterns - GOFDesign Patterns - GOF
Design Patterns - GOF
Fanus van Straten
Software Architecture and Design Patterns Notes.pptx
Software Architecture and Design Patterns Notes.pptxSoftware Architecture and Design Patterns Notes.pptx
Software Architecture and Design Patterns Notes.pptx
VivekanandaGN2
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
Inocentshuja Ahmad
Lecture-7.pptx software design and Arthitechure
Lecture-7.pptx software design and ArthitechureLecture-7.pptx software design and Arthitechure
Lecture-7.pptx software design and Arthitechure
MuhammadAbubakar114879
Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)
Ruud van Falier
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
Muhammad Sajid
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.pptvu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
HashimAli631806
Architecture of Object Oriented Software Engineering
Architecture of Object Oriented Software EngineeringArchitecture of Object Oriented Software Engineering
Architecture of Object Oriented Software Engineering
Sandesh Jonchhe
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
Fajar Baskoro
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
Fajar Baskoro
Desing Patterns Summary - by Jim Fawcett
Desing Patterns Summary - by Jim FawcettDesing Patterns Summary - by Jim Fawcett
Desing Patterns Summary - by Jim Fawcett
Dareen Alhiyari
Design p atterns
Design p atternsDesign p atterns
Design p atterns
Amr Abd El Latief
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
I gotta dependency on dependency injection
I gotta dependency on dependency injectionI gotta dependency on dependency injection
I gotta dependency on dependency injection
mhenroid
Design pattern of software words computer .pptx
Design pattern of software words computer .pptxDesign pattern of software words computer .pptx
Design pattern of software words computer .pptx
muslimpari2503
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
Talentica Software
JS Design patterns in Web technologies including oop techniques.pptx
JS Design patterns in Web technologies including oop techniques.pptxJS Design patterns in Web technologies including oop techniques.pptx
JS Design patterns in Web technologies including oop techniques.pptx
husnainali397602
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
Julie Iskander
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
anguraju1
Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptx
Sachin Patidar
Software Architecture and Design Patterns Notes.pptx
Software Architecture and Design Patterns Notes.pptxSoftware Architecture and Design Patterns Notes.pptx
Software Architecture and Design Patterns Notes.pptx
VivekanandaGN2
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
Inocentshuja Ahmad
Lecture-7.pptx software design and Arthitechure
Lecture-7.pptx software design and ArthitechureLecture-7.pptx software design and Arthitechure
Lecture-7.pptx software design and Arthitechure
MuhammadAbubakar114879
Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)
Ruud van Falier
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
Muhammad Sajid
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.pptvu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
vu-re-lecturedfgdfgdfgdfgdfgdfgfgafga a29.ppt
HashimAli631806
Architecture of Object Oriented Software Engineering
Architecture of Object Oriented Software EngineeringArchitecture of Object Oriented Software Engineering
Architecture of Object Oriented Software Engineering
Sandesh Jonchhe
Desing Patterns Summary - by Jim Fawcett
Desing Patterns Summary - by Jim FawcettDesing Patterns Summary - by Jim Fawcett
Desing Patterns Summary - by Jim Fawcett
Dareen Alhiyari
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
I gotta dependency on dependency injection
I gotta dependency on dependency injectionI gotta dependency on dependency injection
I gotta dependency on dependency injection
mhenroid
Design pattern of software words computer .pptx
Design pattern of software words computer .pptxDesign pattern of software words computer .pptx
Design pattern of software words computer .pptx
muslimpari2503
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
Talentica Software
JS Design patterns in Web technologies including oop techniques.pptx
JS Design patterns in Web technologies including oop techniques.pptxJS Design patterns in Web technologies including oop techniques.pptx
JS Design patterns in Web technologies including oop techniques.pptx
husnainali397602
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
Julie Iskander
UNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptxUNIT IV DESIGN PATTERNS.pptx
UNIT IV DESIGN PATTERNS.pptx
anguraju1

Recently uploaded (20)

LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP SolutionsWhy Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Absolute ERP
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
Adobe InDesign Crack Full Version Free Download 2025
Adobe InDesign Crack  Full Version Free Download 2025Adobe InDesign Crack  Full Version Free Download 2025
Adobe InDesign Crack Full Version Free Download 2025
sannnasaba545
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
AI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee SupportAI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee Support
AutomationEdge Technologies
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Elastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - VirtualElastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - Virtual
Gon巽alo Pereira
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Data Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - WebinarData Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - Webinar
OnePlan Solutions
DevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdfDevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdf
Justin Reock
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
Instagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo websiteInstagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo website
AxisTechnolabs
SE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.pptSE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.ppt
theworldimagine985
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
Lecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptxLecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e
LDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free DownloadLDPlayer 9.1.20 Latest Crack Free Download
LDPlayer 9.1.20 Latest Crack Free Download
5ls1bnl9iv
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP SolutionsWhy Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP Solutions
Absolute ERP
Tenorshare 4uKey Crack Fre e Download
Tenorshare  4uKey  Crack  Fre e DownloadTenorshare  4uKey  Crack  Fre e Download
Tenorshare 4uKey Crack Fre e Download
oyv9tzurtx
Adobe InDesign Crack Full Version Free Download 2025
Adobe InDesign Crack  Full Version Free Download 2025Adobe InDesign Crack  Full Version Free Download 2025
Adobe InDesign Crack Full Version Free Download 2025
sannnasaba545
Online Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi NcrOnline Software Testing Training Institute in Delhi Ncr
Online Software Testing Training Institute in Delhi Ncr
Home
Why Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your BusinessWhy Hire Python Developers? Key Benefits for Your Business
Why Hire Python Developers? Key Benefits for Your Business
Mypcot Infotech
AutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free downloadAutoDesk Revit Crack | Revit Update 2025 free download
AutoDesk Revit Crack | Revit Update 2025 free download
anamaslam971
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...
Shubham Joshi
Elastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - VirtualElastic Search Engineer Certification - Virtual
Elastic Search Engineer Certification - Virtual
Gon巽alo Pereira
Advance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management OdooAdvance Website Helpdesk Customer Support Ticket Management Odoo
Advance Website Helpdesk Customer Support Ticket Management Odoo
Aagam infotech
Wondershare Filmora Crack Free Download
Wondershare Filmora  Crack Free DownloadWondershare Filmora  Crack Free Download
Wondershare Filmora Crack Free Download
zqeevcqb3t
Data Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - WebinarData Storytelling for Portfolio Leaders - Webinar
Data Storytelling for Portfolio Leaders - Webinar
OnePlan Solutions
DevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdfDevOpsDays LA - Platform Engineers are Product Managers.pdf
DevOpsDays LA - Platform Engineers are Product Managers.pdf
Justin Reock
Code or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose BothCode or No-Code Tests: Why Top Teams Choose Both
Code or No-Code Tests: Why Top Teams Choose Both
Applitools
Enscape Latest 2025 Crack Free Download
Enscape Latest 2025  Crack Free DownloadEnscape Latest 2025  Crack Free Download
Enscape Latest 2025 Crack Free Download
rnzu5cxw0y
Instagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo websiteInstagram Feed Snippet, Instagram posts display in odoo website
Instagram Feed Snippet, Instagram posts display in odoo website
AxisTechnolabs
SE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.pptSE- Lecture 5 SE for easy understanding.ppt
SE- Lecture 5 SE for easy understanding.ppt
theworldimagine985
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
Lecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptxLecture-11-AutomatedTesting-software.pptx
Lecture-11-AutomatedTesting-software.pptx
ssuser39f59e

Design Patterns

  • 2. Content Definitions of Design Patterns Model-View-Controller Design Pattern Types Singleton Design Pattern 2
  • 3. Definitions of Design Patterns Design patterns are recurring solutions to design problems you see over & over [smaltalk Companion] Design patterns constitute a set of rules describing how to accomplish certain tasks in the realm of software development [Pree,1994] Design patterns focus more on reuse of recurring architectural design themes, while frameworks focus on detailed design & implementation[Coplien & Schmid ,1995] 3
  • 4. Definitions of Design Patterns A pattern addresses a recurring design problem that arise in specific design situations & presents a solution to it [Buschmann et al.,1996] Patterns identify & specify abstractions that are above the level of single classes and instances, or of components.[Gammar et al.,1993] 4
  • 5. Model-View-Controller The Model-View-Controller (MVC) pattern is one of the earliest and one of the most successful design patterns. It was developed by Trygve Reenskaug in 1979. Controller Data Model View 5
  • 6. Model-View-Controller Data Model : Contains the computation part of the program View : Which presents the user interface Controller : Which interacts between the user & the view 6
  • 7. Model-View-Controller Employee Object as a Model EmployeeView a Class which display Employee Information as a View EmployeeControl a Class which controls the data flow into model object and updates the view whenever data changes - Controller. 7
  • 8. Model-View-Controller Interaction It helps to separate the applications concerns EmployeeController EmployeeModel EmployeeView Sees Uses ManipulateUpdate 8
  • 9. Data Model Data ,methods for accessing and modifying state A model stores data that is retrieved according to commands from the controller and displayed in the view 9
  • 10. Data Model Object of this class can use to hold the data & methods 10
  • 11. View When model changed view must update A view generates an output presentation to the user based on changes in the model 11
  • 12. View Present Information in Console Window 12
  • 13. Controller Translate user actions into operations on the model. Act as a separator between Model & View. A controller can send commands to the Model to update the model's state (e.g., editing a document) Associated view to change the view's presentation of the model (e.g., by scrolling through a document). 13
  • 16. Design Pattern Types Creational Patterns Structural Patterns Behavioral Patterns 16
  • 17. Creational Patterns Deals with object creation Control the object creation Trying to create objects in a manner suitable to the situation 17
  • 18. Creational Patterns 1. Abstract Factory 2. Builder 3. Factory Method 4. Object Pool 5. Prototype 6. Singleton 18
  • 19. Singleton Pattern Define a class that has only one instance(class must ensure that only single instance should be created) Provides a global point of access to it(single object can be used by all other classes) Is a class of which there may be no more than one instance. It provides single global point of access to that instance 19
  • 20. Singleton Pattern When to Use When its important to have only one instance of a class Only a print spooler One window manager One point of access to database engine Among several serial ports only one instance of COM1 Centralized management of internal or external resources and they provide a global point of access to themselves Singleton pattern is mostly used in multi-threaded and database applications. 20
  • 21. Forms of Singleton Pattern Singleton Pattern Early Instantiation (Load Time instance creation) Lazy Instantiation (Create instance when required) 21
  • 22. Singleton Pattern - Advantages Reuse single instance save memory 22
  • 23. Singleton Pattern UML <<public class >> 23
  • 24. Singleton Pattern Class Static member Store the instance of the class Get memory only once as it is static Private constructor Prevent creating instances outside the class Static factory method (Static factory method is simply a static method that returns an instance of a class.) Provides the global point of access to the Singleton object Returns the instance to the caller. 24
  • 25. Singleton Pattern Early Instantiation Create the instance of the class at the time of class loading 25
  • 26. Singleton Pattern lazy Instantiation Create the instance of the class in synchronized method or synchronized block Instance of the class is created when required 26
  • 27. Singleton Pattern lazy Instantiation 27
  • 28. Conclusion MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns. Singleton Pattern Is a class of which there may be no more than one instance. It provides single global point of access to that instance 28
  • 29. References https://sourcemaking.com/design_patterns/creational_patterns http://www.oodesign.com/singleton-pattern.html#early-singleton http://www.javatpoint.com/core-java-design-patterns Java Design Patterns James W.Cooper 29
  • 30. 30