SlideShare a Scribd company logo
Agile Software Development
By- Md. Mojammel Haque
CSM, CSPO, CSD, CSP (Scrum Alliance)
Software Architect- Raven Systems Ltd.
mojamcpds@gmail.com
http://codermojam.com
Cell- 01795-231350
Commonly used design patterns
Agile Principles
• Satisfy Customer by through early and
contentious delivery of Valuable Software
• Welcome changing requirements even late in
Development
• Deliver working Software frequently from a
couple of weeks to couple of months
• Business People & Developers must work
together daily
Agile Principles
• Build projects around motivated individuals
who should be trusted
• Face to face communication is the best form
of Conversation even in co-location
• Working software is the principal measure of
progress
• Sustainable development, able to maintain a
constant pace
Agile Principles
• Continuous attention to technical excellence
and good design
• Simplicity—the art of maximizing the amount
of work not done—is essential
• Self-organizing teams
• Regular adaptation to changing circumstance
Agile Software Fundamentals
• Principles
• Patterns
• Practices
Simplify Client Access to complex functionality- Façade
Spaghetti Code
Problem with Above Code
• Violation of Single Responsibility Principle
– Establish & Open Connection
– Loading Data Table
– Taking the Result & Mapping with Domain Object
• Violation of Don’t Repeat Yourself Principle
– Each time we create new method lot of stuff need
to repeat e.g.- Define Connection, Provide
Connection String, Open Connection, Create
Command etc.
Refactoring To Pattern- Factory
• Only use to establish the connection with Database- SRP
• Can reuse this code in whole project- DRY
• Create As much instance as required- Factory Pattern
Use Factory pattern to Façade
Is our code Refactored enough?
Yes! - “Our Code is not tightly coupled with any
specific connection. Instead it relies on
Abstraction i.e. IDbConnection.”
If user wants to use “Oracle” or any other
database instead of “SQL Server”?
“Create another Connection Factory for that
database.”
OracleDbProviderFactory
Call from Façade
Problem with Above Code
• Violate the rule of Abstract Factory Pattern-
“User will not be aware about what is being
created and how is being created.”
• Each time we call-
– Either SQLServerDbProviderFactory
– Or OracleDbProviderFactory
Our user knows it- which one is calling
Abstract Factory?
In our Connection code we have two level of Abstraction-
+. IDbConnection : Create the factory of SQL Connection or
Oracle Connection
+. IDbProviderFactory: Create the instance of SQL Provider or
Oracle Provider Factory.
So, we have abstraction on Factory– Abstract Factory.
Refactor to Next Level
+. Get the Provider Name from Configuration file no matter weather
it is SQL client or Oracle client. All other code are same. So we don’t
need to create individual factory class for each database provider
Consume the code from Façade
+. Created the instance of ProviderFactory and used it to
CreateConnection. So end user doesn’t know about which provider
we are being using.
But…. Problem Here
+. Each time we call EmployeeService it creates
an instance of DbProviderFactory class which is
wastage.
+. So we have to Avoid this Wastage.
Introducing Singleton instance of Factory
Create the Singleton Instance of DbProviderFactory class.
So only one instance of DbProviderFactory will use instead
of creating multiple instances.
Note: We are not using one connection for the application. We
are actually using one factory for each application
Call from Façade – Dependency Injection
• In Above Code we are used Dependency Injection Pattern
by injecting IDbProviderFactory through the Constructor of
EmployeeService Class.
• Though we are not using any Ioc container here so we
handled the dependency in Poor man Style
There are some problem of using Singleton in above style
– Our above Singleton is not Thread Safe
– Also the Singleton instance is Immutable
So we have to Refactor our above code-
Refactor to Monostate Pattern
• In Monostate Pattern we have Private Static instance of DbProviderFactory
instead of Public Static instance. We also have a static Constructor.
• The only difference between Monostate and Singleton is in Monostate client
doesn’t realize that they are working with a Single Intance
Refactor to Monostate Pattern
• In Monostate Pattern we have Private Static instance of
DbProviderFactory instead of Public Static instance. We also have a
static Constructor.
• Monostate Design Pattern allows us to create instance as much as
required. But though DbProviderFactory instance static so it get
initialized only once.
• The Difference between Singleton and Monostate is
– The Singleton is the single instance
– Monostate has multiple instance but internal instance is limited to only
one.
• In Monostate client doesn’t realize that they are working with a
Single Instance.
• In MonostateProviderFactory all methods are mutable. So they will
return completely brand new instance to the client and they can be
used very safely in Multi-Threaded environment.
Strategy Design Pattern
• Clients needs-
– Employee list needs to shown in sorted by their birth date
So we write our code for this client requirement-
Our Unit Test code is
Wow! Our unit test passed and our code works properly-
Strategy Design Pattern- Contd.
After few days Client has another requirements which is-
“In another place Employee List should be seen sorted by their First Name”
Now what will we do?
– Create another method for Sorting by their First Name.
– Or introduce a if condition for sorting by First Name
Strategy Design Pattern- Contd.
Few days later user has another requirement to show
“Employee List by sorting their Last Name”
We have to follow one of above two processes i.e. -
– So Create another method for Sorting by their Last Name.
– Or introduce a if condition for sorting by Last Name
+. As day by day client requirements increases and our code also increases. So
after few days our class will become bulky and completely loss it’s
maintainability.
+. Also it violates the rules of –
1. Open Closed Principle (OCP):
+>. Either modify our class (introducing a brand new method
for each logic i.e. SortByDate, SortByName etc.)
+>. Or modify existing method by adding new condition e.g.-
condition for sortByDate, sortByName etc.
2. Don’t Repeat Yourself (DRY) : Same logic repeat again and again
Refactoring to Strategy Pattern
Now create a class that will Compare two employee objects
by their birth date and consume it from client-
Refactoring to Strategy Pattern
Now for First Name sorting we will create another class
For Last Name Sorting we will follow the same process i.e.
create another class
Refactoring to Strategy Pattern
No modification will require for our Sorting method. Also don’t need to
introduce new method for each sorting logic-
Our end user will just consume the method by passing individual
Icomparer<Iemployee> as parameter value and return the output
according to sorting logic as follows-
Same above process should follows for sortByName
+. This pattern is known as “Strategy Pattern” because it interchanges the
Compare method of different class based on client need.
+. This is also known as Replace Conditionals with Polymorphism (RCP/RIP)
pattern because instead of using if conditions we just used polymorphism logic to
override the compare method in different classes.
Gateway Design Pattern
ď‚§ Till now we write all database access logic into Service Layer.
ď‚§ If we have multiple service class then we have to write all the
database access logic all those Service classes.
 It’s not any good practice. The good practices is-
“We’ll create a single access point to database so that all service
layer components can access database by using that access point.”
Refactor to Gateway Design Pattern
This access point is our Gateway
Now our Service Layer will contact with database via Gateway.
Refactor to Gateway Design Pattern
Source code of our access point-
Refactor to Gateway Design Pattern
Access Gateway from Service Layer
Repository & Unit Of Work Design Pattern
According to Eric Evans-
“A repository will connect Factories with Gateways.”
[“Factory is the convenient way to create objects”]
+. Here Factory means instance of Domain Model
+. Gateway is the access point that we discussed earlier
So we will introduce Repository pattern as the connector
between Domain Model and Gateway via Service Layer.
Repository & Unit Of Work Design Pattern
Repository & Unit Of Work Design Pattern
Unit of Work uses to Commit or Rollback one or more
operations as a Single Transaction.
Repository & Unit Of Work Design Pattern
Use Repository and & Unit of work in Service Layer-
Repository & Unit Of Work Design Pattern
Use Repository and & Unit of work in Service Layer-
Test Read Statement
Test Single Save Statement
Test Multiple Save Statement- Failed Case
Test Multiple Save Statement- Passed Case

More Related Content

What's hot (20)

PDF
2010-07-19_rails_tdd_week1
Wolfram Arnold
 
PDF
Beginning AngularJS
Troy Miles
 
PDF
UI Testing
Josh Black
 
PDF
Refactoring
Artem Tabalin
 
PDF
Styled Components & React.js
Grayson Hicks
 
PDF
Testing Legacy Rails Apps
Rabble .
 
PPT
Subconsultas
Maria
 
PDF
Styled components presentation
Maciej Matuszewski
 
PDF
Gemboys
Filippo Dino
 
PDF
Behavior Driven Development with Cucumber
Asheesh Mehdiratta
 
PPT
Intro to Service Worker API and its use cases
satejsahu
 
ODP
Improve your development skills with Test Driven Development
John Stevenson
 
ODP
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Knoldus Inc.
 
PPTX
Clean code quotes - Citações e provocações
André de Fontana Ignacio
 
PDF
2011-02-03 LA RubyConf Rails3 TDD Workshop
Wolfram Arnold
 
PPTX
Karate for Complex Web-Service API Testing by Peter Thomas
intuit_india
 
PPTX
Jasmine
Alok Guha
 
PPTX
Cucumber_Training_ForQA
Meenakshi Singhal
 
PDF
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Arun Gupta
 
PPT
Micro Object Testing
ESUG
 
2010-07-19_rails_tdd_week1
Wolfram Arnold
 
Beginning AngularJS
Troy Miles
 
UI Testing
Josh Black
 
Refactoring
Artem Tabalin
 
Styled Components & React.js
Grayson Hicks
 
Testing Legacy Rails Apps
Rabble .
 
Subconsultas
Maria
 
Styled components presentation
Maciej Matuszewski
 
Gemboys
Filippo Dino
 
Behavior Driven Development with Cucumber
Asheesh Mehdiratta
 
Intro to Service Worker API and its use cases
satejsahu
 
Improve your development skills with Test Driven Development
John Stevenson
 
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Knoldus Inc.
 
Clean code quotes - Citações e provocações
André de Fontana Ignacio
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
Wolfram Arnold
 
Karate for Complex Web-Service API Testing by Peter Thomas
intuit_india
 
Jasmine
Alok Guha
 
Cucumber_Training_ForQA
Meenakshi Singhal
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Arun Gupta
 
Micro Object Testing
ESUG
 

Similar to Commonly used design patterns (20)

PPTX
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Steven Smith
 
PPTX
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Steven Smith
 
PPTX
Most Useful Design Patterns
Steven Smith
 
PPTX
Improving the Quality of Existing Software
Steven Smith
 
PPTX
Improving The Quality of Existing Software
Steven Smith
 
PPTX
Improving the Quality of Existing Software - DevIntersection April 2016
Steven Smith
 
PPTX
Software System Architecture-Lecture 6.pptx
ssuser9a23691
 
PDF
The maze of Design Patterns & SOLID Principles
Muhammad Raza
 
PPTX
Improving the Quality of Existing Software
Steven Smith
 
PPT
Ood and solid principles
Avinash Kadam
 
PPTX
Segue to design patterns
Rahul Singh
 
PPTX
Day5
madamewoolf
 
PPTX
Establishing a SOLID Foundation
Cameron Presley
 
PDF
Reinventing the Transaction Script (NDC London 2020)
Scott Wlaschin
 
PPTX
Design Principles
Kartheek Nagasuri
 
PPTX
Improving the Quality of Existing Software
Steven Smith
 
PPTX
Improving the Design of Existing Software
Steven Smith
 
PPT
Design patterns
mudabbirwarsi
 
PPT
Introduction to design_patterns
amitarcade
 
PPTX
Introduction to Design Patterns
Prageeth Sandakalum
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Steven Smith
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Steven Smith
 
Most Useful Design Patterns
Steven Smith
 
Improving the Quality of Existing Software
Steven Smith
 
Improving The Quality of Existing Software
Steven Smith
 
Improving the Quality of Existing Software - DevIntersection April 2016
Steven Smith
 
Software System Architecture-Lecture 6.pptx
ssuser9a23691
 
The maze of Design Patterns & SOLID Principles
Muhammad Raza
 
Improving the Quality of Existing Software
Steven Smith
 
Ood and solid principles
Avinash Kadam
 
Segue to design patterns
Rahul Singh
 
Day5
madamewoolf
 
Establishing a SOLID Foundation
Cameron Presley
 
Reinventing the Transaction Script (NDC London 2020)
Scott Wlaschin
 
Design Principles
Kartheek Nagasuri
 
Improving the Quality of Existing Software
Steven Smith
 
Improving the Design of Existing Software
Steven Smith
 
Design patterns
mudabbirwarsi
 
Introduction to design_patterns
amitarcade
 
Introduction to Design Patterns
Prageeth Sandakalum
 
Ad

More from Mojammel Haque (6)

PDF
Introduction to scrum
Mojammel Haque
 
PDF
Agile Estimating and Planning
Mojammel Haque
 
PDF
Agile Estimating And Planning
Mojammel Haque
 
PDF
Domain Driven Design
Mojammel Haque
 
PPTX
Real Time App with SignalR
Mojammel Haque
 
PPTX
Real time app with SignalR
Mojammel Haque
 
Introduction to scrum
Mojammel Haque
 
Agile Estimating and Planning
Mojammel Haque
 
Agile Estimating And Planning
Mojammel Haque
 
Domain Driven Design
Mojammel Haque
 
Real Time App with SignalR
Mojammel Haque
 
Real time app with SignalR
Mojammel Haque
 
Ad

Recently uploaded (20)

PDF
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPTX
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
SAP GUI Installation Guide for macOS (iOS) | Connect to SAP Systems on Mac
SAP Vista, an A L T Z E N Company
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Brief History of Python by Learning Python in three hours
adanechb21
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 

Commonly used design patterns

  • 1. Agile Software Development By- Md. Mojammel Haque CSM, CSPO, CSD, CSP (Scrum Alliance) Software Architect- Raven Systems Ltd. [email protected] http://codermojam.com Cell- 01795-231350
  • 3. Agile Principles • Satisfy Customer by through early and contentious delivery of Valuable Software • Welcome changing requirements even late in Development • Deliver working Software frequently from a couple of weeks to couple of months • Business People & Developers must work together daily
  • 4. Agile Principles • Build projects around motivated individuals who should be trusted • Face to face communication is the best form of Conversation even in co-location • Working software is the principal measure of progress • Sustainable development, able to maintain a constant pace
  • 5. Agile Principles • Continuous attention to technical excellence and good design • Simplicity—the art of maximizing the amount of work not done—is essential • Self-organizing teams • Regular adaptation to changing circumstance
  • 6. Agile Software Fundamentals • Principles • Patterns • Practices
  • 7. Simplify Client Access to complex functionality- Façade Spaghetti Code
  • 8. Problem with Above Code • Violation of Single Responsibility Principle – Establish & Open Connection – Loading Data Table – Taking the Result & Mapping with Domain Object • Violation of Don’t Repeat Yourself Principle – Each time we create new method lot of stuff need to repeat e.g.- Define Connection, Provide Connection String, Open Connection, Create Command etc.
  • 9. Refactoring To Pattern- Factory • Only use to establish the connection with Database- SRP • Can reuse this code in whole project- DRY • Create As much instance as required- Factory Pattern
  • 10. Use Factory pattern to Façade
  • 11. Is our code Refactored enough? Yes! - “Our Code is not tightly coupled with any specific connection. Instead it relies on Abstraction i.e. IDbConnection.” If user wants to use “Oracle” or any other database instead of “SQL Server”? “Create another Connection Factory for that database.”
  • 14. Problem with Above Code • Violate the rule of Abstract Factory Pattern- “User will not be aware about what is being created and how is being created.” • Each time we call- – Either SQLServerDbProviderFactory – Or OracleDbProviderFactory Our user knows it- which one is calling
  • 15. Abstract Factory? In our Connection code we have two level of Abstraction- +. IDbConnection : Create the factory of SQL Connection or Oracle Connection +. IDbProviderFactory: Create the instance of SQL Provider or Oracle Provider Factory. So, we have abstraction on Factory– Abstract Factory.
  • 16. Refactor to Next Level +. Get the Provider Name from Configuration file no matter weather it is SQL client or Oracle client. All other code are same. So we don’t need to create individual factory class for each database provider
  • 17. Consume the code from Façade +. Created the instance of ProviderFactory and used it to CreateConnection. So end user doesn’t know about which provider we are being using.
  • 18. But…. Problem Here +. Each time we call EmployeeService it creates an instance of DbProviderFactory class which is wastage. +. So we have to Avoid this Wastage.
  • 19. Introducing Singleton instance of Factory Create the Singleton Instance of DbProviderFactory class. So only one instance of DbProviderFactory will use instead of creating multiple instances. Note: We are not using one connection for the application. We are actually using one factory for each application
  • 20. Call from Façade – Dependency Injection
  • 21. • In Above Code we are used Dependency Injection Pattern by injecting IDbProviderFactory through the Constructor of EmployeeService Class. • Though we are not using any Ioc container here so we handled the dependency in Poor man Style There are some problem of using Singleton in above style – Our above Singleton is not Thread Safe – Also the Singleton instance is Immutable So we have to Refactor our above code-
  • 22. Refactor to Monostate Pattern • In Monostate Pattern we have Private Static instance of DbProviderFactory instead of Public Static instance. We also have a static Constructor. • The only difference between Monostate and Singleton is in Monostate client doesn’t realize that they are working with a Single Intance
  • 23. Refactor to Monostate Pattern • In Monostate Pattern we have Private Static instance of DbProviderFactory instead of Public Static instance. We also have a static Constructor. • Monostate Design Pattern allows us to create instance as much as required. But though DbProviderFactory instance static so it get initialized only once. • The Difference between Singleton and Monostate is – The Singleton is the single instance – Monostate has multiple instance but internal instance is limited to only one. • In Monostate client doesn’t realize that they are working with a Single Instance. • In MonostateProviderFactory all methods are mutable. So they will return completely brand new instance to the client and they can be used very safely in Multi-Threaded environment.
  • 24. Strategy Design Pattern • Clients needs- – Employee list needs to shown in sorted by their birth date So we write our code for this client requirement- Our Unit Test code is Wow! Our unit test passed and our code works properly-
  • 25. Strategy Design Pattern- Contd. After few days Client has another requirements which is- “In another place Employee List should be seen sorted by their First Name” Now what will we do? – Create another method for Sorting by their First Name. – Or introduce a if condition for sorting by First Name
  • 26. Strategy Design Pattern- Contd. Few days later user has another requirement to show “Employee List by sorting their Last Name” We have to follow one of above two processes i.e. - – So Create another method for Sorting by their Last Name. – Or introduce a if condition for sorting by Last Name +. As day by day client requirements increases and our code also increases. So after few days our class will become bulky and completely loss it’s maintainability. +. Also it violates the rules of – 1. Open Closed Principle (OCP): +>. Either modify our class (introducing a brand new method for each logic i.e. SortByDate, SortByName etc.) +>. Or modify existing method by adding new condition e.g.- condition for sortByDate, sortByName etc. 2. Don’t Repeat Yourself (DRY) : Same logic repeat again and again
  • 27. Refactoring to Strategy Pattern Now create a class that will Compare two employee objects by their birth date and consume it from client-
  • 28. Refactoring to Strategy Pattern Now for First Name sorting we will create another class For Last Name Sorting we will follow the same process i.e. create another class
  • 29. Refactoring to Strategy Pattern No modification will require for our Sorting method. Also don’t need to introduce new method for each sorting logic- Our end user will just consume the method by passing individual Icomparer<Iemployee> as parameter value and return the output according to sorting logic as follows- Same above process should follows for sortByName +. This pattern is known as “Strategy Pattern” because it interchanges the Compare method of different class based on client need. +. This is also known as Replace Conditionals with Polymorphism (RCP/RIP) pattern because instead of using if conditions we just used polymorphism logic to override the compare method in different classes.
  • 30. Gateway Design Pattern ď‚§ Till now we write all database access logic into Service Layer. ď‚§ If we have multiple service class then we have to write all the database access logic all those Service classes. ď‚§ It’s not any good practice. The good practices is- “We’ll create a single access point to database so that all service layer components can access database by using that access point.”
  • 31. Refactor to Gateway Design Pattern This access point is our Gateway Now our Service Layer will contact with database via Gateway.
  • 32. Refactor to Gateway Design Pattern Source code of our access point-
  • 33. Refactor to Gateway Design Pattern Access Gateway from Service Layer
  • 34. Repository & Unit Of Work Design Pattern According to Eric Evans- “A repository will connect Factories with Gateways.” [“Factory is the convenient way to create objects”] +. Here Factory means instance of Domain Model +. Gateway is the access point that we discussed earlier So we will introduce Repository pattern as the connector between Domain Model and Gateway via Service Layer.
  • 35. Repository & Unit Of Work Design Pattern
  • 36. Repository & Unit Of Work Design Pattern Unit of Work uses to Commit or Rollback one or more operations as a Single Transaction.
  • 37. Repository & Unit Of Work Design Pattern Use Repository and & Unit of work in Service Layer-
  • 38. Repository & Unit Of Work Design Pattern Use Repository and & Unit of work in Service Layer-
  • 40. Test Single Save Statement
  • 41. Test Multiple Save Statement- Failed Case
  • 42. Test Multiple Save Statement- Passed Case