Skip to content
TheCodingHouse.in

TheCodingHouse.in

  • TheCodingHouse.in
  • Techonology
  • Contact Us
  • Toggle search form

What are Design Patterns in Java?

Posted on February 13, 2020September 25, 2021 By thecodinghouse

The design patterns is a general repeatable solution to a commonly occurring problem in software design.

These are the well-proven solutions for solving the specific problem/task.

Uses of Design Patterns

Design patterns are a toolkit of tried and tested solutions to common problems in software design. It teaches you how to solve all sorts of problems using principles of object-oriented design.

It define a common language that you and your teammates can use to communicate more efficiently. You can say, “Oh, just use a Singleton for that,” and everyone will understand the idea behind your suggestion.

Advantages of Design Patterns

  • They are reusable in multiple projects.
  • They provide transparency to the design of an application.
  • It provide the solutions that help to define the system architecture.
  • It capture the software engineering experiences.
  • Patterns are the well-proved solutions for solving the specific problem/task.
Design Patterns
Design Patterns In Java

What all design patterns are used in Java?

Design patterns differ by their complexity, level of detail, and scale of applicability to the entire system being designed. The most basic and low-level patterns are often called idioms. They usually apply only to a single programming language.

The most universal and high-level patterns are architectural patterns. Developers can implement these patterns in virtually any language.

Design Patterns are divided into three categories – Creational, Structural, and Behavioral design patterns.

Creational Design Patterns

Creational patterns provide object creation mechanisms that increase flexibility and reuse of existing code.

How many types of creational patterns are there?

  • Abstract Factory Design Pattern
    • Creates an instance of several families of classes.
  • Builder Design Pattern
    • Separates object construction from its representation.
  • Factory Method Design Pattern
    • Creates an instance of several derived classes.
  • Object Pool Design Pattern
    • Avoid expensive acquisition and release of resources by recycling objects that are no longer in use.
  • Prototype Design Pattern
    • A fully initialized instance to be copied or cloned.
  • Singleton Design Pattern
    • A class of which only a single instance can exist.

Read more …

Structural Design Patterns

The structural pattern explains how to assemble objects &classes into larger structures with keeping the structures flexible and efficient.

  • Adapter Design Pattern
    • Match interfaces of different classes
  • Bridge Design Pattern
    • Separates an object’s interface from its implementation
  • Composite Design Pattern
    • A tree structure of simple and composite objects
  • Decorator Design Pattern
    • Add responsibilities to objects dynamically
  • Facade Design Pattern
    • A single class that represents an entire subsystem
  • Flyweight Design Pattern
    • A fine-grained instance used for efficient sharing
  • Private Class Data Design Pattern
    • Restricts accessor/mutator access
  • Proxy Design Pattern
    • An object representing another object

Behavioral design patterns

Behavioral patterns take care of effective communication and the assignment of responsibilities between objects.

  • Chain of responsibility
    • A way of passing a request between a chain of objects
  • Command
    • Encapsulate a command request as an object
  • Interpreter
    • A way to include language elements in a program
  • Iterator
    • Sequentially access the elements of a collection
  • Mediator
    • Defines simplified communication between classes
  • Memento
    • Capture and restore an object’s internal state
  • Null Object
    • Designed to act as a default value of an object
  • Observer
    • A way of notifying change to a number of classes
  • State
    • Alter an object’s behavior whenever its state changes
  • Strategy
    • Encapsulates an algorithm inside a class
  • Template method
    • Defer the exact steps of an algorithm to a subclass
  • Visitor
    • Defines a new operation to a class without change

Design Patterns, Techonology Tags:design patterns in software engineering, design patterns tutorial, types of design patterns, What are the 23 design patterns, What is design pattern concept

Post navigation

Previous Post: Creational Design Patterns
Next Post: 8 SEO Techniques To Increase Website Traffic In 2022

More Related Articles

java thecodinghouse.in Which tool is best for Java Programming tools? Techonology
Creational Design Patterns Techonology

TheCodingHouse

TheCodingHouse is one of the most popular websites for technical articles.

Recent Posts

  • What is CAP theorem in system design?
  • Which tool is best for Java Programming tools?
  • The 5 Latest Tech News Sites of All Time
  • 8 SEO Techniques To Increase Website Traffic In 2022
  • What are Design Patterns in Java?
  • Creational Design Patterns

Copyright © 2022 TheCodingHouse.in.

Powered by PressBook Blog WordPress theme