Blog

Python 3.7 And 2.7 Installation Steps On Windows 10

Changing python default versions on fedora 27?

Python websockets installation is failed on fedora linux

Network Basics

Document Clustering

Clustering Techniques

SQL Injection and Prevention Techniques

Google Form Intro and App Scripts

Download in Youtube using Youtube-dl commands

Java Network Launch Protocol File Launch Issue

javaws command is not working

Forcing Website with HTTPS instead of HTTP

Cricket Scores API's

Design Patterns

IIS Installation and Configuration on Windows 10

Unable to start debugging on the web server (IIS Error Code 405)

Google Chrome Installation on Fedora 26, CentOS / RHEL 7.4

Install Fedora 26 On Virtual Machine Using VirtualBox in Windows 10

Using screen command in fedora 25

Java JDK 1.8 Installation Steps On Windows 10

Enable Permanent SSH Access on Linux

C Program Undefined Reference Error

Curl error and couldn't resolve hostname fedora mirrors

Installing Android Studio in Windows 10

Resetting Root password on Fedora 26

Installing visual studio code editor steps for fedora 27 / centos 7 / RHEL 7

Java JNI Error UnsupportedClassVersionError in Windows 10

Install virt-customize in RHEL 8

Updating qcow2 image in RHEL 8

Remove the files from dir in another dir

Install virtualenv in RHEL 7

Install Scapy in RHEL 7

SQL ACID properties

Design Patterns



What is design pattern?

  • Design pattern is a general reusable solution to a commonly occurring problem in software design.
  • Design patterns are the best practices and solutions to solve software development problems.
  • Design patterns were obtained by experience (trial and error) by numerous software developers over quite a substantial period of time.
  • Design pattern is not in source code format, it is description or template for how to solve any software problem that can be used in different situations.
  • Design patterns are programming language independent concepts like OOPS Concepts.
  • Object-oriented design patterns typically show relationships and interactions between classes or objects.

What are the different types of design patterns?

  • Creational patterns
  • Structural patterns
  • Behavioral patterns

Creational Patterns

Creational Patterns are ones that create objects, rather than having you instantiate objects directly. These patterns are useful in developing program more flexibility in deciding which objects need to be created for a particular scenario or case.
  • Abstract factory: provides an interface for creating families of related or dependent objects without specifying their concrete classes.
  • Factory method: defines an interface for creating a single object, but sub classes should decide which class to instantiate. Factory Method lets a class defer instantiation to sub classes.
  • Singleton pattern: restricts object creation for a class to only one instance.
    Two types to create singleton design pattern.
    • Early Instantiation: creating instance at initial time.
    • Lazy Instantiation: creating instance when required later.
  • Builder pattern: creates complex objects by separating construction and representation.
  • Prototype pattern: creates objects by cloning an existing object.
  • Object Pool Pattern: provides to reuse the object that are expensive to create.

Structural patterns

These patterns related to class and object composition. Mostly uses inheritance to compose interfaces and define paths to compose objects to get new functionality.
  • Adapter pattern: provides classes with incompatible interfaces, to work together by wrapping its own interface around that of an already existing class. Creating new class by extending existing class and incompatible interfaces.
  • Bridge pattern: decouples an abstraction from its implementation so that the two can vary independently.
  • Composite pattern: composes zero-or-more similar objects so that they can be manipulated as one object.
  • Decorator pattern: dynamically adds/overrides behaviour in an existing method of an object.
  • Facade pattern: provides a simplified interface to a large body of code.
  • Flyweight pattern: reduces the cost of creating and manipulating a large number of similar objects.
  • Proxy pattern: provides a placeholder for another object to control access, reduce cost, and reduce complexity.

Behavioral patterns

These design patterns are related to communication between objects.
  • Chain of responsibility pattern: delegates commands to a chain of processing objects.
  • Command pattern: creates objects which encapsulate actions and parameters.
  • Interpreter pattern: implements a specialized language.
  • Iterator pattern: accesses the elements of an object sequentially without exposing its underlying representation.
  • Mediator pattern: provides loose coupling between classes by being the only class that has detailed knowledge of their methods.
  • Memento pattern: provides the ability to restore an object to its previous state.
  • Observer pattern: publish/subscribe pattern which allows a number of observer objects to see an event.
  • State pattern: provides an object to update its behavior when its internal state changes.
  • Strategy pattern: provides one of a family of algorithms to be selected on-the-fly at runtime.
  • Template method pattern: defines the skeleton of an algorithm as an abstract class, allowing its subclasses to provide concrete behavior.
  • Visitor pattern: separates an algorithm from an object structure by moving the hierarchy of methods into one object.


 Blog

Python 3.7 And 2.7 Installation Steps On Windows 10

Changing python default versions on fedora 27?

Python websockets installation is failed on fedora linux

Network Basics

Document Clustering

Clustering Techniques

SQL Injection and Prevention Techniques

Google Form Intro and App Scripts

Download in Youtube using Youtube-dl commands

Java Network Launch Protocol File Launch Issue

javaws command is not working

Forcing Website with HTTPS instead of HTTP

Cricket Scores API's

Design Patterns

IIS Installation and Configuration on Windows 10

Unable to start debugging on the web server (IIS Error Code 405)

Google Chrome Installation on Fedora 26, CentOS / RHEL 7.4

Install Fedora 26 On Virtual Machine Using VirtualBox in Windows 10

Using screen command in fedora 25

Java JDK 1.8 Installation Steps On Windows 10

Enable Permanent SSH Access on Linux

C Program Undefined Reference Error

Curl error and couldn't resolve hostname fedora mirrors

Installing Android Studio in Windows 10

Resetting Root password on Fedora 26

Installing visual studio code editor steps for fedora 27 / centos 7 / RHEL 7

Java JNI Error UnsupportedClassVersionError in Windows 10

Install virt-customize in RHEL 8

Updating qcow2 image in RHEL 8

Remove the files from dir in another dir

Install virtualenv in RHEL 7

Install Scapy in RHEL 7

SQL ACID properties

Privacy Policy  |  Copyright@2017 - All Rights Reserved.  |  Contact us   |  Report website issues in Github   |  Facebook page   |  Google+ page

Email Facebook Google LinkedIn Twitter
^