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

A Layered Architecture Example (Web) (1)

The document outlines a layered architecture for a Mobile Device Information System (MDIS), detailing the various layers including Presentation, Application, Domain, and Infrastructure layers. It explains the benefits of a layered design such as promoting loosely coupled code, simplifying unit testing, and allowing for independent layer replacements. Additionally, it distinguishes between N-Tier and layered applications, providing examples of physical and logical separations in application design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

A Layered Architecture Example (Web) (1)

The document outlines a layered architecture for a Mobile Device Information System (MDIS), detailing the various layers including Presentation, Application, Domain, and Infrastructure layers. It explains the benefits of a layered design such as promoting loosely coupled code, simplifying unit testing, and allowing for independent layer replacements. Additionally, it distinguishes between N-Tier and layered applications, providing examples of physical and logical separations in application design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

A Layered Application Example

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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
N-Tier vs Layered Application

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

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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a 3 - Tier Design (Physical Separation)
(Application Spread Across 3 Physical Devices)
PC Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF

Application Layer \ Service Layer


Data Transfer Objects (DTOs)
Application Services
 Orchestrated workflows
Server  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

Server Infrastructure Layer


Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of Layered Design (Logical Separation)
(Application Runs On A Single Physical Device)
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
All layers in this case are running on the
same device
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

Example devices where all layers could be


running for an application Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
Domain Model Entities Repositories
 Validation of Business Rules
 Validation of Values
Phone Server
PC Desktop  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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Why Use A Layered Design

Presentation Layer (PL) \ User Interface (UI)  WinForms


- Promotes loosely coupled code which reduces  ASP..NET
 Input Validations  MVC
maintenance efforts  Returned DTOs to UI Fields  WPF

- 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Smart UI (Anti-Pattern) Code Loosely Coupled Code

User Interface (UI)

Perform GUI operations


A) Read window controls
B) Request product info from BLL
C) Load returned results from BLL
.

Business Logic Layer (BLL)

Business Process Service


Code behind ”Get Product Details” button Run product code through a
multi-step business process
 Read product code from screen
 Run product code through a multi-step
business process

 Apply Database operations


Data Access Layer (DAL)
A) Connect to database All code needed to get
B) Construct database query and send to details for the product code Apply Database operations
database is located in a single source A) Connect to database
C) Receive database query results as a code file for the Product B) Construct database query and
database object Details window. This is not sends to database
loosely coupled code. C) Receives database query
 Insert returned database object into screen
results as a database object.
grid.
Why Use A Layered Design

Presentation Layer (PL) \ User Interface (UI)  WinForms


- Promotes loosely coupled code which reduces  ASP..NET
 Input Validations  MVC
maintenance efforts  Returned DTOs to UI Fields  WPF

- 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Why Use A Layered Design

Presentation Layer (PL) \ User Interface (UI)  WinForms


- Promotes loosely coupled code which reduces  ASP..NET
 Input Validations  MVC
maintenance efforts  Returned DTOs to UI Fields  WPF

- 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Why Use A Layered Design

Presentation Layer (PL) \ User Interface (UI)  WinForms


- Promotes loosely coupled code which reduces  ASP..NET
 Input Validations  MVC
maintenance efforts  Returned DTOs to UI Fields  WPF

- 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Why Use A Layered Design

Presentation Layer (PL) \ User Interface (UI) WinForms


Alternative User Interface Layers 
 ASP..NET
 Input Validations  MVC
Windows Presentation Foundation (WPF)  Returned DTOs to UI Fields  WPF

ASP.NET Web Forms Application Layer \ Service Layer


Data Transfer Objects (DTOs)
Application Services
ASP.NET MVC  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
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

DA using DB2 Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Presentation Layer

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF

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

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

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

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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Presentation Layer
Examples of various formats the front end can be in for a user

Web browser page such as for a Desktop application such as a


search engine word processor
Report result such as a web traffic
report

Mobile device touch


screen such as for a
phone
The Presentation Layer
Provides Numerous Ways For A User To Interact
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
User Interactions
Application Layer \ Service Layer
 Clicking buttons Data Transfer Objects (DTOs)
Application Services
 Orchestrated workflows
 Clicking menu items Interfaces (Service Contracts) for
 CRUD via Repositories
 Data conversions between layers Application Services
 Typing text
Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
 Scrolling lists
Domain Model Entities Repositories
 Validation of Business Rules
 Touching screens
 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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Presentation Layer
Sample Technologies For UI Development
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
Sample UI Technologies  Returned DTOs to UI Fields  WPF
 Xamarin
 MVC Application Layer \ Service Layer
Data Transfer Objects (DTOs)
 HTML 5 Application Services
 ASP.NET  Orchestrated workflows
 CRUD via Repositories Interfaces (Service Contracts) for
 Javascript Application Services
 WPF  Data conversions between layers

 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Presentation Layer
Sample technologies for UI development
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
Sample UI Technologies  Returned DTOs to UI Fields  WPF
 Xamarin
 MVC Application Layer \ Service Layer
Data Transfer Objects (DTOs)
 HTML 5 Application Services
 ASP.NET  Orchestrated workflows
 CRUD via Repositories Interfaces (Service Contracts) for
 Javascript Application Services
 WPF  Data conversions between layers

 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

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF

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

Data Sources – SQL Server Microsoft Message Queue


(MSMQ)
Application Layer

The Application Layer is the entry point for all requests


coming from the Presentation Layer. Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
Tasks performed in response to requests from the
Presentation Layer: Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Application Services
- It directs calls to the domain layer for business
 Orchestrated workflows
processing tasks such as validation of rules  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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Application Layer

The Application Layer is the entry point for all requests


coming from the Presentation Layer. Presentation Layer (PL) \ User Interface (UI)  WinForms
Note: External applications  ASP..NET
 Input
could also use the Validations  MVC
 Returned
application layer as a DTOs to UI Fields  WPF
Tasks performed in response to requests from the
gateway to the layers below
Presentation Layer: Application Layer \ Service Layer
if the Application Layer Data Transfer Objects (DTOs)
makes its services public.
Application Services
- It directs calls to the domain layer for business
 Orchestrated workflows
processing tasks such as validation of rules  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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Application Layer

The Application Layer is the entry point for all requests


coming from the Presentation Layer. Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
Tasks performed in response to requests from the
Presentation Layer: Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Application Services
- It directs calls to the domain layer for business
 Orchestrated workflows
processing tasks such as data validations  CRUD via Repositories Interfaces (Service Contracts) for
 Data conversions between layers Application Services
- It directs calls to the Infrastructure layer for
persistence processing by repositories and unit of Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
work transactions.
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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Application Layer

The Application Layer is the entry point for all requests


coming from the Presentation Layer. Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
Tasks performed in response to requests from the
Presentation Layer: Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Application Services
- It directs calls to the domain layer for business
 Orchestrated workflows
processing tasks such as data validations  CRUD via Repositories Interfaces (Service Contracts) for
 Data conversions between layers Application Services
- It directs calls to the Infrastructure layer for
persistence processing by repositories and unit of Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
work transactions.
Domain Model Entities Repositories
 Validation of Business Rules
- It can be used to convert result query data from the  Validation of Values
Infrastructure layer into data transfer objects to be  New Model Entity Creation
used by the user interface
Infrastructure Layer
Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Application Layer
Data Transfer Objects (DTOs)
The Application Layer is the entry point for all requests
coming from the Presentation Layer. Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF
Tasks performed in response to requests from the
Presentation Layer: Application Layer \ Service Layer
Data Transfer Objects (DTOs)
Application Services
- It directs calls to the domain layer for business
 Orchestrated workflows
processing tasks such as data validations  CRUD via Repositories Interfaces (Service Contracts) for
 Data conversions between layers Application Services
- It directs calls to the Infrastructure layer for
persistence processing by repositories and unit of Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
work transactions.
Domain Model Entities Repositories
 Validation of Business Rules
- It can be used to convert result query data from the  Validation of Values
Infrastructure layer into data transfer objects to be  New Model Entity Creation
used by the user interface
Infrastructure Layer
- Data Transfer Objects (DTOs)
Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Domain Layer
Data Transfer Objects (DTOs) – Sample From MDIS

Entity Framework Model Entity for ProductProfile DTO for ProductProfileShortEntry


public partial class ProductProfile public class ProductProfileShortEntry
{ {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", public string ProductId { get; set; }
"CA2214:DoNotCallOverridableMethodsInConstructors")] public string ProductName { get; set; }
public ProductProfile() public string Manufacturer { get; set; }
{ public string DeviceType { get; set; }
this.ProductRequests = new HashSet<ProductRequest>(); public string ProductDescription { get; set; }}
} }

public string ProductId { get; set; }


public string ProductName { get; set; }
public string Manufacturer { get; set; }
public string DeviceType { get; set; }
public string ProductDescription { get; set; }
public string ScreenSize { get; set; }
public string Storage { get; set; }
public string OperatingSystem { get; set; }
public string Carrier { get; set; }
public string ProductPicturePath { get; set; }

[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

public partial class ProductRequest public class ProductRequestDetailDto


{ {
public int ProductRequestId { get; set; } public int ProductRequestId { get; set; }
public string EmployeeId { get; set; } public string FirstName { get; set; }
public string ProductId { get; set; } public string MiddleInitial { get; set; }
public string ProductRequestStageId { get; set; } public string LastName { get; set; }
public System.DateTime DateRequested { get; set; } public string DeptName { get; set; }
public string SerialNumber { get; set; } public string DeviceType { get; set; }
public string PhoneNumber { get; set; } public string ProductId { get; set; }
public Nullable<System.DateTime> DateCompleted { get; set; } public string ProductName { get; set; }
public string SerialNumber { get; set; }
public virtual Employee Employee { get; set; } public string PhoneNumber { get; set; }
public virtual ProductProfile ProductProfile { get; set; } public string ProductRequestStageId { get; set; }
public virtual ProductRequestStage ProductRequestStage { get; set; } public System.DateTime DateRequested { get; set; }
} public System.DateTime ? DateCompleted { get; set; }
}
The Domain Layer
Domain Models
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
About the Domain Layer:  Input Validations  MVC
 Returned DTOs to UI Fields  WPF
 The Domain models with entities and
Application Layer \ Service Layer
value objects are found here. 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Domain Layer
Domain Models

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-Driven Design Tackling Complexity in the Heart of Software by Eric Evans


 Patterns, Principles, and Practices of Domain-Driven Design by Scott Millet with Nick Tune
The Domain Layer
Validations
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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Domain Layer
Sample MDIS Rules To Validate
Presentation Layer (PL) \ User Interface (UI)  WinForms
 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields WPF
Sample rules for requesting a mobile device. 
All these rules may also be checked for some
Application Layer \ Service Layer
order as part of a procedure or process: Data Transfer Objects (DTOs)
Application Services
 A request must be for an employee  Orchestrated workflows
 CRUD via Repositories Interfaces (Service Contracts) for
working full time.
 Data conversions between layers Application Services
 A request must be for employee’s of the
Bob Tech Zone Company (not a
contractor) . Domain Layer \ Business Logic Layer (BLL) Interfaces (Service Contracts) for
 A request must be for a person who has Domain Model Entities Repositories
worked with the company for 180 days or  Validation of Business Rules
more.  Validation of Values
 New Model Entity Creation
 A request must be for a person who does
not already have a mobile device of the
same type issued. Infrastructure Layer
Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Domain Layer
Validations Activity Diagram – Sample from MDIS For A New Request
Validate screen
input data.
Presentation
Layer \ UI

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.

Validate rules and values. Repeat


Domain Presentation Layer validations to
Layer guard against possible malicious
data alteration as it crossed layer
boundaries.

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

CreateNewProductRequest() Send New


Application Request the Domain Layer create a ProductRequest to
new instance of a Product Request Convert results of
Layer \ failed Model Entity Infrastructure Layer
Application Model Entity. Extract values from DTO to be persisted
and pass into Product Request Model creation to DTO
Service and return to UI (saved)
Entity constructor as simple types such
as primitives.

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Domain Layer
Interfaces – A Simple Example
Solution Options

Interface Used: IMegabyteStorageTool


Application Product Name: MegabyteTool1
Service Name: GetSizesForAMegabyte
Parameter: Megabyte value as integer
Return: A StorageUnit Object
Interface \ Service Contract Implementation (How it’s done):
Perform A
Interface Name: IMegabyteStorageTool Perform B
Required Service: GetSizesForAMegabyte Perform C
Parameter: Megabyte value as an integer
Returns: StorageUnit object

Interface Used: IMegabyteStorageTool


The application class called Product Name: MegabyteTool2
MegabyteReporter can Service Name: GetSizesForAMegabyte
aStorageUnit = MegabyteReporter(MegabyteTool1) accept any implemented
Parameter: Megabyte value as integer
solution which conforms to
the specifications of the Return: A StorageUnit Object
IMegabyteStorageTool Implementation (How it’s done):
interface defined in the Perform X + Y
application.
The Domain Layer
Interfaces – A Simple Example
Solution Options

Interface Used: IMegabyteStorageTool


Application Product Name: MegabyteTool1
Service Name: GetSizesForAMegabyte
Parameter: Megabyte value as integer
Return: A StorageUnit Object
Interface \ Service Contract Implementation (How it’s done):
Perform A
Interface Name: IMegabyteStorageTool Perform B
Required Service: GetSizesForAMegabyte Perform C
Parameter: Megabyte value as an integer
Returns: StorageUnit object

Interface Used: IMegabyteStorageTool


The application class called Product Name: MegabyteTool2
MegabyteReporter can Service Name: GetSizesForAMegabyte
aStorageUnit = MegabyteReporter(MegabyteTool1) accept any implemented
Parameter: Megabyte value as integer
solution which conforms to
the specifications of the Return: A StorageUnit Object
IMegabyteStorageTool Implementation (How it’s done):
interface defined in the Perform X + Y
application.
The Domain Layer
Interfaces – A Simple Example
Solution Options

Interface Used: IMegabyteStorageTool


Application Product Name: MegabyteTool1
Service Name: GetSizesForAMegabyte
Parameter: Megabyte value as integer
Return: A StorageUnit Object
Interface \ Service Contract Implementation (How it’s done):
Perform A
Interface Name: IMegabyteStorageTool Perform B
Required Service: GetSizesForAMegabyte Perform C
Parameter: Megabyte value as an integer
Returns: StorageUnit object

Interface Used: IMegabyteStorageTool


The application class called Product Name: MegabyteTool2
MegabyteReporter can Service Name: GetSizesForAMegabyte
aStorageUnit = MegabyteReporter(MegabyteTool1) accept any implemented
Parameter: Megabyte value as integer
solution which conforms to
the specifications of the Return: A StorageUnit Object
IMegabyteStorageTool Implementation (How it’s done):
interface defined in the Perform X + Y
application.
The Domain Layer
Interfaces – A Simple Example
Solution Options

Interface Used: IMegabyteStorageTool


Application Product Name: MegabyteTool1
Service Name: GetSizesForAMegabyte
Parameter: Megabyte value as integer
Return: A StorageUnit Object
Interface \ Service Contract Implementation (How it’s done):
Perform A
Interface Name: IMegabyteStorageTool Perform B
Required Service: GetSizesForAMegabyte Perform C
Parameter: Megabyte value as an integer
Returns: StorageUnit object

Interface Used: IMegabyteStorageTool


The application class called Product Name: MegabyteTool2
MegabyteReporter can Service Name: GetSizesForAMegabyte
aStorageUnit = MegabyteReporter(MegabyteTool1) accept any implemented
Parameter: Megabyte value as integer
solution which conforms to
the specifications of the Return: A StorageUnit Object
IMegabyteStorageTool Implementation (How it’s done):
interface defined in the Perform X + Y
application.
The Domain Layer
Interfaces – A Simple Example
Solution Options

Interface Used: IMegabyteStorageTool


Application Product Name: MegabyteTool1
Service Name: GetSizesForAMegabyte
Parameter: Megabyte value as integer
Return: A StorageUnit Object
Interface \ Service Contract Implementation (How it’s done):
Perform A
Interface Name: IMegabyteStorageTool Perform B
Required Service: GetSizesForAMegabyte Perform C
Parameter: Megabyte value as an integer
Returns: StorageUnit object

Interface Used: IMegabyteStorageTool


The application class called Product Name: MegabyteTool2
MegabyteReporter can Service Name: GetSizesForAMegabyte
aStorageUnit = MegabyteReporter(MegabyteTool1) accept any implemented
Parameter: Megabyte value as integer
solution which conforms to
the specifications of the Return: A StorageUnit Object
IMegabyteStorageTool Implementation (How it’s done):
interface defined in the Perform X + Y
application.
The Domain Layer
Interfaces For Repositories
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
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 defined in Domain Layer

public interface IProductRequestRepository


{
IEnumerable<ProductRequest> GetAllProductRequests();
ProductRequest GetProductRequestForId(int aProductRequestId);
}
The Domain Layer
Interfaces – Sample Interface \ Service Contract From MDIS

Sample Interface \ Service Contract defined in Domain Layer

public interface IProductRequestRepository


{
IEnumerable<ProductRequest> GetAllProductRequests();
ProductRequest GetProductRequestForId(int aProductRequestId);
}

public partial class ProductRequest


{
public int ProductRequestId { get; set; }
public string EmployeeId { get; set; }
public string ProductId { get; set; }
public string ProductRequestStageId { get; set; }
public System.DateTime DateRequested { get; set; }
public string SerialNumber { get; set; }
public string PhoneNumber { get; set; }
public Nullable<System.DateTime> DateCompleted { get; set; }

public virtual Employee Employee { get; set; }


public virtual ProductProfile ProductProfile { get; set; }
public virtual ProductRequestStage ProductRequestStage { get; set; }
}
The Domain Layer
Interfaces – Sample Interface \ Service Contract From MDIS
Sample Interface \ Service Contract defined in Domain Layer

public interface IProductRequestRepository


{
IEnumerable<ProductRequest> GetAllProductRequests();
ProductRequest GetProductRequestForId(int aProductRequestId);
}

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

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)
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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Infrastructure Layer
The Object Relational Mapping (ORM)
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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Infrastructure Layer
The Repositories
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

Repositories are located here which provide CRUD


Domain Layer \ Business Logic Layer (BLL)
(Create, Read, Update, Delete) operations for Interfaces (Service Contracts) for
requests (i.e. Get a list of products) 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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Infrastructure Layer
Repositories - Sample Of Using Product Request Repository In MDIS To Get A Product List

Place received DTO values for


Request for Product List
Presentation Layer Product Requests onto UI fields

Invoke GetAllProductRequests Convert received Entity Framework


from Product Request Repository Application Layer Model Entities for Product Requests
into DTOs

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

Repositories are located here which provide CRUD


Domain Layer \ Business Logic Layer (BLL)
(Create, Read, Update, Delete) operations for Interfaces (Service Contracts) for
requests (i.e. Get a list of products) Domain Model Entities Repositories
 Validation of Business Rules
 Validation of Values
A Unit of Work pattern is used in Data Access of
 New Model Entity Creation
the Infrastructure Layer when a database
transaction requires more than one repository
Infrastructure Layer
Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Infrastructure Layer
Crosscutting Concerns
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

Repositories are located here which provide CRUD


Domain Layer \ Business Logic Layer (BLL)
(Create, Read, Update, Delete) operations for Interfaces (Service Contracts) for
requests (i.e. Get a list of products) Domain Model Entities Repositories
 Validation of Business Rules
 Validation of Values
A Unit of Work pattern is used in Data Access of
 New Model Entity Creation
the Infrastructure Layer when a database
transaction requires more than one repository
Infrastructure Layer
Provides crosscutting concerns Data Access
Notification Services
 Repositories
a) Authentication  ORM  DB Connections  Email
(Entity Framework
b) Exception Management  LINQ to Entities
 Unit of Work Queries
c) Logging

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
The Infrastructure Layer
Email Services
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

Repositories are located here which provide CRUD


Domain Layer \ Business Logic Layer (BLL)
(Create, Read, Update, Delete) operations for Interfaces (Service Contracts) for
requests (i.e. Get a list of products) Domain Model Entities Repositories
 Validation of Business Rules
 Validation of Values
A Unit of Work pattern is used in Data Access of
 New Model Entity Creation
the Infrastructure Layer when a database
transaction requires more than one repository
Infrastructure Layer
Provides crosscutting concerns Data Access
Notification Services
 Repositories
a) Authentication  ORM  DB Connections  Email
(Entity Framework
b) Exception Management  LINQ to Entities
 Unit of Work Queries
c) Logging

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

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations  MVC
 Returned DTOs to UI Fields  WPF

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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

User requests for a


Presentation Layer (PL) \ User Interface (UI)  WinForms Userreport
requests
of all for a report
product
 ASP..NET of all product
requests withrequests
detail
 Input Validations  MVC with detail using
using the the user
 Returned DTOs to UI Fields  WPF application
interface user
interface
Application
Application LayerLayer \ Service
\ Service Layer
Layer
Data Transfer Objects (DTOs)
Application ServicesServices
Application Data Transfer
 Orchestrated workflows Objects
 CRUD via Repositories Interfaces
(DTOs) (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
Infrastructure Layer
Layer
Data Data Access
Access
Notification Services
 Repositories
 Repositories
 ORM
 ORM DB Connections
 DBConnections  Email
(Entity
(Entity Framework  LINQ
Framework  LINQ to Entities
to Entities
 Unit
 ofUnit of Work
Work Queries
Queries

Data Sources – SQL Server


Example of a User Requesting A Detailed Product Report

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

Application Layer \ Service Layer


Data Transfer Objects (DTOs)
Application Services
 Orchestrated workflows
 CRUD via Repositories Interfaces (Service Contracts) for
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

Infrastructure Layer
Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations GetAllProductRequestDetail  MVC
 Returned DTOs to UI Fields  WPF
In response to the UI invocation,
Application Layer \ Service Layer
the Application Layer invokes a
Data Transfer Objects (DTOs)
Application Services service in the Product Request
 Orchestrated workflows Repository called:
 CRUD via Repositories Interfaces (Service Contracts) for
GetAllProductRequestDetail
 Data conversions between layers GetAllProductRequestDetail
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 GetAllProductRequestDetail

Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations GetAllProductRequestDetail  MVC
 Returned DTOs to UI Fields  WPF

Application Layer \ Service Layer


Data Transfer Objects (DTOs)
Application Services
 Orchestrated workflows
 CRUD via Repositories Interfaces (Service Contracts) for
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
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

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

Presentation Layer (PL) \ User Interface (UI)  WinForms


 ASP..NET
 Input Validations GetAllProductRequestDetail  MVC
 Returned DTOs to UI Fields  WPF

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

Infrastructure Layer GetAllProductRequestDetail

Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)
Example of a User Requesting A Detailed Product Report

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

Infrastructure Layer GetAllProductRequestDetail

Data Access
Notification Services
 Repositories
 ORM  DB Connections  Email
(Entity Framework  LINQ to Entities
 Unit of Work Queries

Microsoft Message Queue


Data Sources – SQL Server (MSMQ)

You might also like