Skip to content

This repository provides a comprehensive guide to various design patterns implemented in Java. Each pattern is presented with clear explanations, practical examples, and usage scenarios, along with quizzes to test your understanding.

Notifications You must be signed in to change notification settings

PasanSWijekoon/Java-Object-Oriented-Design-Patterns-II

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Object-Oriented-Design-Patterns-II

This repository provides a comprehensive guide to various design patterns implemented in Java. Each pattern is presented with clear explanations, practical examples, and usage scenarios, along with quizzes to test your understanding.

Table of Contents

  1. Decorator Design Pattern
  2. Composite Design Pattern
  3. Bridge Design Pattern
  4. Builder Design Pattern
  5. Chain of Responsibility Design Pattern
  6. Flyweight Design Pattern
  7. Interpreter Design Pattern
  8. Mediator Design Pattern
  9. Memento Design Pattern
  10. Prototype Design Pattern
  11. Visitor Design Pattern
  12. Compound Patterns
  13. Anti-Patterns

How This Repository is Organized

Each design pattern listed above has its own dedicated folder within this repository. Inside each pattern's folder, you will typically find:

  • about/: Provide Introduction about this pattern its charateristics usage and key components.
  • src/: Contains the Java source code demonstrating the pattern's implementation with quiz explain.
  • quizzes/: Includes questions and exercises related to the pattern to reinforce learning.

All Topics Discussed (in Java Language)

Types of Design Patterns

  • Creational Patterns These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new operator. This gives program more flexibility in deciding which objects need to be created for a given use case.

  • Structural Patterns These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.

  • Behavioral Patterns These design patterns are specifically concerned with communication between objects.

1. Decorator Design Pattern

  • Description: Discusses how to dynamically add new functionalities to an object without altering its structure.

2. Composite Design Pattern

  • Description: Explains how to compose objects into tree structures to represent part-whole hierarchies.

3. Bridge Design Pattern

  • Description: Covers how to decouple an abstraction from its implementation so that the two can vary independently.

4. Builder Design Pattern

  • Description: Details how to construct a complex object step by step, allowing for different representations using

5. Chain of Responsibility Design Pattern

  • Description: Explores how to pass requests along a chain of handlers, decoupling the sender from the receiver.

6. Flyweight Design Pattern

  • Description: Explains how to minimize memory usage or computation expenses by sharing as much data as possible

7. Interpreter Design Pattern

  • Description: Covers how to define a grammatical representation for a language and provide an interpreter to deal

8. Mediator Design Pattern

  • Description: Discusses how to reduce coupling between objects by introducing a mediator object that encapsulates

9. Memento Design Pattern

  • Description: Explains how to capture and externalize an object's internal state so that the object can be restored to this state later.

10. Prototype Design Pattern

  • Description: Covers how to create new objects by copying an existing object, known as the prototype.

11. Visitor Design Pattern

  • Description: Discusses how to separate an algorithm from the object structure on which it operates.

12. Compound Patterns

  • Description: Explores how to combine multiple design patterns to solve more complex problems, often demonstrating

13. Anti-Patterns

  • Description: Identifies common pitfalls and bad practices in software design, explaining why they are problematic and how to avoid them.

Contributions

Contributions are welcome! If you have additional examples, improved explanations, or new quizzes, feel free to open a pull request.


Happy Learning!

About

This repository provides a comprehensive guide to various design patterns implemented in Java. Each pattern is presented with clear explanations, practical examples, and usage scenarios, along with quizzes to test your understanding.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages