Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 36 pages
Class notes

Design Patterns Notes (6CS002) – Creational, Structural & Behavioral Patterns Explained

Document preview thumbnail
Preview 4 out of 36 pages

This document provides a comprehensive overview of design patterns in software engineering, focusing on their classification, purpose, and implementation. It covers three main categories of design patterns: creational, structural, and behavioural, along with decoupling patterns. Creational patterns such as Singleton, Factory, Abstract Factory, Builder, and Prototype are discussed in detail, highlighting how they provide efficient and flexible ways to create objects. Structural patterns including Adapter, Bridge, Composite, and Facade demonstrate how classes and objects can be combined to form larger and more flexible structures. Behavioural patterns like Strategy, State, Template, Decorator, and Visitor focus on improving communication and interaction between objects. The document also explains the advantages of using design patterns, such as improved code maintainability, faster development, and better system quality . Practical examples and Java implementations are included to illustrate how these patterns are applied in real-world scenarios, making the content useful for both learning and application in software development.

Content preview

Design Patterns


Dr. Md Arafatur Rahman

Based on notes from Dr Kevan Buckley

6CS002 - Dr K 1

, Creational Patterns
• Creational design patterns provide solutions to instantiate an
Object in the best possible way for specific situations.


Creational
Patterns



Factory Abstract
Singleton Builder Prototype
Pattern Factory




6CS002 - Dr K 2

, Creational Patterns
• Singleton

o Singleton pattern restricts the instantiation of a class and
ensures that only one instance of the class exists in the Java
Virtual Machine.
o The singleton class must provide a global access point to
get the instance of the class.
o Singleton pattern is used for logging, drivers objects,
caching, and thread pool.
o Singleton design pattern is also used in other design
patterns like Abstract Factory, Builder, Prototype,
Facade, etc.
o Singleton design pattern is used in core Java classes also
(for example, java.lang.Runtime, java.awt.Desktop).


6CS002 - Dr K 3

, Creational Patterns
• Java Singleton Pattern Implementation

o Private constructor to restrict instantiation of the class from other classes.
o Private static variable of the same class that is the only instance of the class.
o Public static method that returns the instance of the class, this is the global access point for
the outer world to get the instance of the singleton class.




6CS002 - Dr K
4

Document information

Study
Unknown
Uploaded on
April 29, 2026
Number of pages
36
Written in
2025/2026
Type
Class notes
Professor(s)
Mr. thilina jayathilaka
Contains
All classes
$10.98

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
2
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions