Design Patterns
Design Patterns
-----------------------------------------------------
* Designing the different layers of the applications(UI, Business Logic and DA)
* Loosely coupled.
* Data Validation or Validation Framework.
* Implementing different security standards.
* Choose best deployment strategy.
* Managing different configuration.
* Thinking of cloud compatibility.
* Integration to different systems.
* Testing strategies.
* Scaling up the application.
Design Pattern:
---------------
Advantages of Patterns:
-----------------------
Pre-requisites:
---------------
Criticism of Patterns:
----------------------
Classification Of Patterns:
---------------------------
GOF pattern, MVC pattern, MVVM pattern, Lazy Loading pattern, Provider pattern,
Asynchronous pattern.
the patterns which we have that there are three classifications that will be
differed based on how the objects are created, how they are going to be organized
and how they are going to behave in different situations.
* Add a private static field to the class for storing the singleton instance.
* Declare a public static creation method for getting the singleton instance.
* Implement "Lazy initialization" inside the static method. It should create a new
object on its first call and put it into the static field. The method should always
return that instance on all the subsequent calls.
* Make the constructor of the class private. The static method of the class will
still be able to call the constructor, but not the other objects.
* Go over the client code and replace all direct class to the singleton's
constructor with calls to its static creation method.
Pro's:
------
* A class has a single instance.
* Global access point to that instance.
* Singleton object is initialized only when it is requested for the first time.
Con's:
------
* Violates the single responsibility principle(SRP).
* Difficult to do unit test.
* Multithreading environment it is complex to use.