Upload
simon-smith
View
509
Download
0
Tags:
Embed Size (px)
DESCRIPTION
What is NTier ?
Citation preview
NTiering
A guide to N-Tier application design
NTiering
A guide to N-Tier application design
Badly Drawn Bob, NTiering logo
The Good Old Days
An application typically used command line Performed only one function Used by trained operators
Nowadays !
Complex GUI's Multiple functions in one application Apps expect little or no user training
What is N-Tier?
The practice of breaking an application into well defined regions.
Each region has high cohesion Well defined paths into each regions
Advantages
Lower TOC (total cost of ownership) Less “code rot” Looser coupling
What does it look like?
Typically 3 layers (or tiers)
UI ServiceData
What does it look like?
Typically 3 layers (or tiers)
UI ServiceData
What does it look like?
Common Mistakes !
UI ServiceData
DTO / Common Classes
What does it look like?
Common Mistakes !
UI ServiceData
DTO / Common Classes
Using a common class toMove data means the UI
Layer is coupled to the data layer
What does it look like?
Common Mistakes !
UI ServiceData
ValidationValidation
Validation
What does it look like?
Common Mistakes !
UI ServiceData
ValidationValidation
Validation
Repeated validation is the single most common mistake in n-tier apps.
Not only does this duplicate effort, butWhat happens if the validation
changes on the data layer but not in the UI
How does NTiering fix this?
Enforces clear separation of tiers Encapsulates validation (business rules) in the
service layer Provides tools to produce “boiler plate” code
What does NTiering look like?
3 Tier application
UI ServiceData
What does NTiering look like?
3 Tier application
UINtiering.UIExample
ServiceNtierning.Service
DataNtierning.Data
What does NTiering look like?
3 Tier application
UINtiering.
UIExample
ServiceNtierning.Service
DataNtierning.
DataModels
DTO's
Customer Service Order Service
What does NTiering look like?
3 Tier application
UINtiering.
UIExample
ServiceNtierning.Service
DataNTierning.Data
Models
DTO's
Customer Service Order Service
Models invoke validation usingServices, allowing new UI's
To be developed
Add new services without impact to existing application
No longer tied to one databaseprovider
Change UI easily. Business logic is in the service layer
What does it cost ?
Free (as in beer!). Use it anyway you see fit. See Licence.txt Need help ? Mail me