Design Patterns

 Design Patterns - JAVA🔧👽

In software engineering, a design pattern is a repeatable solution to a common problem in software design. A design pattern is not a ready-made design that can be converted directly into code. It is a description or template of how to solve a problem that can be used in different situations.



Why we use design patterns ? 
  • Improved Code Quality and Readability
  • Increased Reusability and Efficiency
  • Better Maintainability and Extensibility
  • Improved Collaboration and Communication
  • Mitigates Risks
  • Reduces errors
  • Enhances reliability
We can break these design patterns in terms of those categories. First criteria is Purpose and other one is
. First we discuss the types of design patterns using Purpose criteria.

1) Purpose

        What is the purpose any design pattern solves. There are 3 purposes that any design patterns would be solving.
  1. Creational Design Pattern : Used for creating or instantiating objects and classes.
  2. Structural Design Pattern : Used for structuring more than one classes or objects together.
  3. Behavioral Design Pattern : Used for identifying and setting up common communication patterns among objects.
2) Scope

        There are 2 scopes that design patterns would be solving.
  1. Classes
  2. Object
        Why we are dividing these patterns on the basis of object and classes?
    • Used to create classes
    • Used to create objects
    • It tells you how to use inheritance
    • Used to organise and assemble different objects
    • It tells you how to use inheritance in order to  implement the algorithms and the control and flow of classes so as to fulfill a certain behaviour.
Blogs that you can refer to improve your knowledge about Design Patterns. 

Comments

Popular posts from this blog

Sorting Algorithms - JAVA👽

Object Oriented Programming - JAVA- class boundary, variable types, modifiers, java main method

Object Oriented Programming - JAVA- Method Overriding