Skip to content

This repository contains various types of design patterns and it's implementaions using examples.

Notifications You must be signed in to change notification settings

viiku/design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

design-patterns

Learning about different kind of design pattern in Java OOPS. Implementing various examples to get most of it.

Overview

Questions have been taken from Head First Design Book

  1. Each design pattern contains a related question and it's definitions and implementation.

Design Principles

  1. Identify the aspects of your application that vary and separate them from what stays the same.
  2. Program to an interface, not an implementation. Program to an interface means designing code to depend on abstract types (interfaces or abstract classes) rather than concrete implementations.
  3. Favor composition over inheritance.
  4. Strive for loosely coupled designs between objects that interact.
  5. Classes should be open for extension, but closed for modification.

Types of Design Patterns

Creational Patterns

Focus on object creation mechanisms, trying to create objects in a manner suitable for the situation.

Example: Factory Method, Abstract Factory, Singleton. Key Idea: Encapsulate object creation to promote flexibility.

  1. Abstract Factory
  2. Builder
  3. Factory Method
  4. Prototype
  5. Singleton

Structural Patterns

Deal with the composition of classes or objects to form larger structures.

Example: Adapter, Composite, Decorator. Key Idea: Simplify relationships between entities or extend functionality dynamically.

  1. Adapter
  2. Bridge
  3. Composite
  4. Decorator
  5. Facade
  6. Flyweight
  7. Proxy

Behavioral Patterns

Concerned with algorithms and communication between objects.

Example: Strategy, Observer, Command. Key Idea: Define communication and responsibilities between objects.

  1. Command
  2. Interpreter
  3. Iterator
  4. Mediator
  5. Memento
  6. Observer
  7. State
  8. Strategy

About

This repository contains various types of design patterns and it's implementaions using examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages