A Layered Architecture Example (Web) (1)
A Layered Architecture Example (Web) (1)
Presented by
Robert G. Marquez
December 4, 2019
Planned Architecture For Sample Application
Mobile Device Information System (MDIS)
Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
N-Tier
An N-Tier application means the application layers have been spread across other physical
devices or processors.
Layered
An application identified as layered without the word tier means the application layers are logically
separated and running on the same physical device.
Example of a 2 - Tier Design (Physical Separation)
(Application Spread Across 2 Physical Devices)
Presentation Layer (PL) \ User Interface (UI) WinForms
PC ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Server Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
Tablet (Entity Framework LINQ to Entities
Laptop
Unit of Work Queries
- Allows for other applications to use the exposed Application Layer \ Service Layer
functionality of the layers Data Transfer Objects (DTOs)
Application Services
Orchestrated workflows
- Simplifies unit testing of layers independently CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
- An entire layer can be replaced without affecting other
layers. Here are some examples: Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
- A) Replacing the UI does not affect the BLL or DAL
Validation of Business Rules
- B) Replacing the DAL does not affect the BLL or UI Validation of Values
New Model Entity Creation
Note: Replacing the BLL in our example would affect the
UI and DAL but this action is most likely never to take Infrastructure Layer
place. The BLL is the core of the application built to serve
the needs of the business. If you remove this then you Data Access
Notification Services
might as well rebuild the application. Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
- Allows for other applications to use the exposed Application Layer \ Service Layer
functionality of the layers Data Transfer Objects (DTOs)
Application Services
Orchestrated workflows
- Simplifies unit testing of layers independently CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
- An entire layer can be replaced without affecting other
layers. Here are some examples: Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
- A) Replacing the UI does not affect the BLL or DAL
Validation of Business Rules
- B) Replacing the DAL does not affect the BLL or UI Validation of Values
New Model Entity Creation
Note: Replacing the BLL in our example would affect the UI
and DAL but this action is most likely never to take place. The Infrastructure Layer
BLL is the core of the application built to serve the needs of
the business. If you remove this then you might as well Data Access
Notification Services
rebuild the application. Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
- Allows for other applications to use the exposed Application Layer \ Service Layer
functionality of the layers Data Transfer Objects (DTOs)
Application Services
Orchestrated workflows
- Simplifies unit testing CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
- An entire layer can be replaced without affecting other
layers. Here are some examples: Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
- A) Replacing the UI does not affect the BLL or DAL
Validation of Business Rules
- B) Replacing the DAL does not affect the BLL or UI Validation of Values
New Model Entity Creation
Note: Replacing the BLL in our example would affect the UI
and DAL but this action is most likely never going to take Infrastructure Layer
place. The BLL is the core of the application built to serve the
needs of the business. If you remove this then you might as Data Access
Notification Services
well rebuild the application. Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
- Allows for other applications to use the exposed Application Layer \ Service Layer
functionality of the layers Data Transfer Objects (DTOs)
Application Services
Orchestrated workflows
- Simplifies unit testing of layers independently CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
- An entire layer can be replaced without affecting other
layers. Here are some examples: Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
- A) Replacing the UI does not affect the Domain Layer or
Validation of Business Rules
the Infrastructure Layer Validation of Values
- B) Replacing the Infrastructure Layer does not affect the New Model Entity Creation
Domain Layer or UI
Infrastructure Layer
Note: Replacing the Domain Layer in our example would
affect the UI and Infrastructure Layer but this action is most Data Access
Notification Services
likely never to take place. The Domain Layer is the core of Repositories
ORM DB Connections
the application built to serve the needs of the business. If you Email
(Entity Framework LINQ to Entities
remove this then you might as well rebuild the application. Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Alternative Data Access (DA) Validation of Business Rules
Validation of Values
DAs with alternative DAs with alternative New Model Entity Creation
database engines ORMs
Infrastructure Layer
DA using Oracle DA using NHibernate
Data Access
Notification Services
Repositories
DA using MySQL LinqConnect ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
DA using MongoDB DataObjects.NET
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
About the Presentation Layer: Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Allows end users to access an application’s features
Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Application Services
Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
About the Presentation Layer: Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Allows end users to access an application’s features
Application Layer \ Service Layer
It serves as the front end to request for actions from Data Transfer Objects (DTOs)
the Application Layer which are orchestrated to the Application Services
layers below. Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
About the Presentation Layer: Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Allows end users to access an application’s features
Application Layer \ Service Layer
It serves as the front end to request for actions from Data Transfer Objects (DTOs)
the Application Layer which are orchestrated to the Application Services
layers below. Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
The front end presented to the user can be made
available in various formats
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
About the Presentation Layer: Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Allows end users to access an application’s features
Application Layer \ Service Layer
It serves as the front end to request for actions from Data Transfer Objects (DTOs)
the Application Layer which are orchestrated to the Application Services
layers below. Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
The front end presented to the user can be made
available in various formats
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
It provides numerous ways for a user to interact Domain Model Entities Repositories
with the application Validation of Business Rules
Validation of Values
New Model Entity Creation
Provides basic input validations while not
implementing business logic or business rules.
Examples: Infrastructure Layer
• Is a field missing a value Data Access
Notification Services
• Are valid characters present in fields Repositories
• Are any illegal characters present ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Expression Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Blend Domain Model Entities Repositories
Validation of Business Rules
WinForms Validation of Values
New Model Entity Creation
Silverlight
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Expression Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Blend Domain Model Entities Repositories
Validation of Business Rules
WinForms Validation of Values
New Model Entity Creation
Silverlight
The sample application will Infrastructure Layer
start Data Access
with a WinForms Notification Services
implementation. Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Future videos may include Unit of Work
demonstrating replacing the Queries
WinForms UI with WPF,
ASP.NET, and MVC
Microsoft Message Queue
Data Sources – SQL Server (MSMQ)
The Presentation Layer
About the Presentation Layer: Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Allows end users to access an application’s features
Application Layer \ Service Layer
It serves as the front end to request for actions from Data Transfer Objects (DTOs)
the Application Layer which are orchestrated to the Application Services
layers below. Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
The front end presented to the user can be made
available in various formats
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
It provides numerous ways for a user to interact Domain Model Entities Repositories
with the application Validation of Business Rules
Validation of Values
New Model Entity Creation
Provides basic input validations while not
implementing business logic or business rules.
Examples: Infrastructure Layer
• Is a field missing a value Data Access
Notification Services
• Are valid characters present in fields Repositories
• Are any illegal characters present ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Results arriving from the Application Layer as DTOs
are mapped to the display
Microsoft Message Queue
Data Sources – SQL Server (MSMQ)
Application Layer
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage",
"CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<ProductRequest> ProductRequests { get; set; }
}
The Domain Layer
Data Transfer Objects (DTOs) – Sample From MDIS
Entity Framework Model Entity for ProductRequest DTO for ProductRequest With Extended Data
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
More information regarding Domain Model Entities can be found in the subject of Domain-Driven Design.
The following books cover this topic in detail:
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Application
Layer \
Application
Service
Domain
Layer
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation
Layer \ UI
Build DTO from
validated
screen data
Application
Layer \
Application
Service
Domain
Layer
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data
Application
Layer \
Application
Service
Domain
Layer
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data
CreateNewProductRequest()
Application Request the Domain Layer create a
Layer \ new instance of a Product Request
Application Model Entity. Extract values from DTO
Service and pass into Product Request Model
Entity constructor as simple types such
as primitives.
Domain
Layer
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data
CreateNewProductRequest()
Application Request the Domain Layer create a
Layer \ new instance of a Product Request
Application Model Entity. Extract values from DTO
Service and pass into Product Request Model
Entity constructor as simple types such
as primitives.
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation Read DTO values and place onto UI screen for user.
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data
No
Create new
Validate rules and values. Repeat Yes Model Entity
Domain Presentation Layer validations to Request using values
Layer guard against possible malicious is valid passed in from
data alteration as it crossed layer Application
boundaries. Layer.
Infrastructure
Layer \
Repository
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation Read DTO values and place onto UI screen for user.
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data Convert results of
Create
failed save to DTO
CreateNewProductRequest() Send New Notification
and return to UI
Application Request the Domain Layer create a ProductRequest to Form From
new instance of a Product Request Convert results of new Entity
Layer \ failed Model Entity Infrastructure Layer No
Application Model Entity. Extract values from DTO to be persisted Yes added and
and pass into Product Request Model creation to DTO send to
Service and return to UI (saved) Saved
Entity constructor as simple types such Notification
Success
as primitives. Service
No
Create new
Validate rules and values. Repeat Yes Model Entity
Domain Presentation Layer validations to Request using values
Layer guard against possible malicious is valid passed in from
data alteration as it crossed layer Application
boundaries. Layer.
Infrastructure Repository
Layer \ Save new model entity
Repository to database
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation Read DTO values and place onto UI screen for user.
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data Convert results of
Create
failed save to DTO
CreateNewProductRequest() Send New Notification
and return to UI
Application Request the Domain Layer create a ProductRequest to Form From
new instance of a Product Request Convert results of new Entity
Layer \ failed Model Entity Infrastructure Layer No
Application Model Entity. Extract values from DTO to be persisted Yes added and
and pass into Product Request Model creation to DTO send to
Service and return to UI (saved) Saved
Entity constructor as simple types such Notification
Success
as primitives. Service
No
Create new
Validate rules and values. Repeat Yes Model Entity
Domain Presentation Layer validations to Request using values
Layer guard against possible malicious is valid passed in from
data alteration as it crossed layer Application
boundaries. Layer.
Notification Services
Infrastructure Repository Send Notification Form to
Layer \ Save new model entity MSMQ where it will be
Repository to database sent as an email by
another application
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation Read DTO values and place onto UI screen for user.
Layer \ UI Call CreateNewProductRequest
Build DTO from passing in DTO
validated
screen data Convert results of
Create
failed save to DTO
CreateNewProductRequest() Send New Notification
and return to UI
Application Request the Domain Layer create a ProductRequest to Form From Convert
new instance of a Product Request Convert results of new Entity
Layer \ Infrastructure Layer No results of
Model Entity. Extract values from DTO failed Model Entity added and
Application to be persisted Yes save to a
and pass into Product Request Model creation to DTO send to
Service (saved) Saved DTO and
Entity constructor as simple types such and return to UI Notification
Success return to
as primitives. Service UI
No
Create new
Validate rules and values. Repeat Yes Model Entity
Domain Presentation Layer validations to Request using values
Layer guard against possible malicious is valid passed in from
data alteration as it crossed layer Application
boundaries. Layer.
Notification Services
Infrastructure Repository Send Notification Form to
Layer \ Save new model entity MSMQ where it will be
Repository to database sent as an email by
another application
The Domain Layer
Interfaces
Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
About the Domain Layer: Input Validations MVC
Returned DTOs to UI Fields WPF
The business models consisting of entities and
Application Layer \ Service Layer
value objects are here Data Transfer Objects (DTOs)
Application Services
Validations Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Data conversions between layers Application Services
interfaces (aka Service Contracts) for
repositories are located here.
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
Repository service contracts actions are (Entity Framework LINQ to Entities
defined in the Domain Layer but are Unit of Work Queries
implemented in the Infrastructure Layer
Data Access. The work is therefore
performed in the Infrastructure Layer Microsoft Message Queue
where the Data Access is. Data Sources – SQL Server (MSMQ)
The Domain Layer
Interfaces – Sample Interface \ Service Contract From MDIS
Sample Interface \ Service Contract for a repository implemented in the Infrastructure Layer
public class ProductRequestRepository : IProductRequestRepository
{
public IEnumerable<ProductRequest> GetAllProductRequests()
{
// LINQ to Entities query for Entity Framework
var ProdReqList = from Req in context.ProductRequests
select Req;
return ProdReqList.ToList();
}
}
The Infrastructure Layer
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Send LINQ to Entities query Infrastructure Layer Return received Entity Framework
asking for all Product Requests Domain Model Entities for Product
Product Request Repository
from Entity Framework Requests
Convert LINQ to Entities query to Convert received SQL result rows and
database SQL. Connect to Entity Framework columns into Entity Framework Domain
database and send SQL Model Entities for Product Requests.
Return results
Execute received SQL and return Return SQL result rows and columns
results for all retrieved Product SQL Server Database for Product Requests.
Requests
The Infrastructure Layer
Unit of Work
Presentation Layer (PL) \ User Interface (UI) WinForms
About The Infrastructure Layer For MDIS ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Access to a database is provided here. The
database used for MDIS is Microsoft SQL Server.
Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Access to the SQL Server is performed using an Application Services
ORM (Object Relational Mapping) called Microsoft Orchestrated workflows
CRUD via Repositories Interfaces (Service Contracts) for
Entity Framework
Data conversions between layers Application Services
Email Services
Microsoft Message Queue
Data Sources – SQL Server (MSMQ)
Dependency Directions
for the Mobile Device Information System
Presentation Layer (PL) \ User Interface (UI) WinForms
ASP..NET
Input Validations MVC
Returned DTOs to UI Fields WPF
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure
Infrastructure Layer
Layer
Data Data Access
Access
Notification Services
Repositories
Repositories
ORM
ORM DB Connections
DBConnections Email
(Entity
(Entity Framework LINQ
Framework LINQ to Entities
to Entities
Unit
ofUnit of Work
Work Queries
Queries
Presentation Layer (PL) \ User Interface (UI) The UI invokes the following
WinForms
request in the Application
ASP..NET
Input Validations GetAllProductRequestDetail MVC Layer
Returned DTOs to UI Fields WPFGetAllProductRequestDetail
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Infrastructure Layer
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
The Product Request Repository will
Infrastructure Layer GetAllProductRequestDetail perform all the necessary database work
needed to retrieve the information from
Data Access
Notification ServicesWhen done, it will
an SQL database.
Repositories return the report data as model entities to
ORM DB Connections Email
the Application Layer
(Entity Framework LINQ to Entities
Unit of Work Queries
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries
Presentation Layer (PL) \ User Interface (UI) WinForms When the User Interface
ASP..NET receives the result DTOs from
Input Validations MVC the Application Layer, it will
Returned DTOs to UI Fields WPF extract the data and places it
onto the screen for display
Application Layer \ Service Layer The Application Layer converts
Datamodel
the received Transfer Objects
entities into (DTOs)
Application Services
DTOs which are returned back
Orchestrated workflows
to the User Interface.
Interfaces (Service Contracts) for
CRUD via Repositories
GetAllProductRequestDetail
Data conversions between layers Application Services
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
Validation of Business Rules
Validation of Values
New Model Entity Creation
Data Access
Notification Services
Repositories
ORM DB Connections Email
(Entity Framework LINQ to Entities
Unit of Work Queries