n tiering

18
NTiering A guide to N-Tier application design

Upload: simon-smith

Post on 19-Jan-2015

509 views

Category:

Documents


0 download

DESCRIPTION

What is NTier ?

TRANSCRIPT

Page 1: N Tiering

NTiering

A guide to N-Tier application design

Page 2: N Tiering

NTiering

A guide to N-Tier application design

Badly Drawn Bob, NTiering logo

Page 3: N Tiering

The Good Old Days

An application typically used command line Performed only one function Used by trained operators

Page 4: N Tiering

Nowadays !

Complex GUI's Multiple functions in one application Apps expect little or no user training

Page 5: N Tiering

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

Page 6: N Tiering

Advantages

Lower TOC (total cost of ownership) Less “code rot” Looser coupling

Page 7: N Tiering

What does it look like?

Typically 3 layers (or tiers)

UI ServiceData

Page 8: N Tiering

What does it look like?

Typically 3 layers (or tiers)

UI ServiceData

Page 9: N Tiering

What does it look like?

Common Mistakes !

UI ServiceData

DTO / Common Classes

Page 10: N Tiering

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

Page 11: N Tiering

What does it look like?

Common Mistakes !

UI ServiceData

ValidationValidation

Validation

Page 12: N Tiering

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

Page 13: N Tiering

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

Page 14: N Tiering

What does NTiering look like?

3 Tier application

UI ServiceData

Page 15: N Tiering

What does NTiering look like?

3 Tier application

UINtiering.UIExample

ServiceNtierning.Service

DataNtierning.Data

Page 16: N Tiering

What does NTiering look like?

3 Tier application

UINtiering.

UIExample

ServiceNtierning.Service

DataNtierning.

DataModels

DTO's

Customer Service Order Service

Page 17: N Tiering

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

Page 18: N Tiering

What does it cost ?

Free (as in beer!). Use it anyway you see fit. See Licence.txt Need help ? Mail me

[email protected]