0% found this document useful (0 votes)
10 views

Design Patterns

The document outlines key design considerations for application development, including architecture layers, security standards, and cloud compatibility. It discusses various design patterns, particularly the Singleton and Abstract Factory patterns, highlighting their advantages, prerequisites, and criticisms. Additionally, it emphasizes the importance of scalability, maintainability, and the need for a structured approach to object creation and management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Design Patterns

The document outlines key design considerations for application development, including architecture layers, security standards, and cloud compatibility. It discusses various design patterns, particularly the Singleton and Abstract Factory patterns, highlighting their advantages, prerequisites, and criticisms. Additionally, it emphasizes the importance of scalability, maintainability, and the need for a structured approach to object creation and management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Design Considerations While designing an application:

-----------------------------------------------------

* 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:
---------------

* It is a template for common problem for application development.


* Template for solving the specific problem.
* It is a abstract solution.
* The CQRS pattern is used for segregating the queries.
* The Strategy Pattern is used if we have group of methods and we need to select
the best one we go for strategy pattern.

Advantages of Patterns:
-----------------------

* Enhance Reusability: It reduce the redundancy and using code reusability.


* Scalability and Flexibility: It will adapt quick in changing the requirements
like scaling.
* Improved Maintainability: More understandable.

Pre-requisites:
---------------

* Depth in OOPS and SOLID Principle.


* SDLC
* Knowledge in unit Testing.
* Dot Net Framework.
* We should understand the concurrency and Asynchronous programming.

Criticism of Patterns:
----------------------

* Lead to overlay complex solutions.


* Learning curve and sensitivity means it cannot fit always.

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.

* Creational Patterns: the flexibility in deciding that which objects need to be


created for a given scenario that is what the creational pattern is all about.
* It is the process of object creational.
* Singleton, Factory Method, Abstract Factory, Builder and prototype

Singleton Design Pattern:


-------------------------
* It is the simplest pattern to create an object.
* Only one single instance can be created throughout the lifetime of the
application.
Ex: Logging instances and DB Connections. Serilog for logging

Configuration Management for SDP:


---------------------------------
* obviously throughout the lifetime of the application, the configuration's value
should be there and it should not be changed again and again.

Implementation of Singleton Pattern:


------------------------------------

* 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.

Abstract Factory Pattern:


-------------------------

You might also like