08.09.2013 Views

Microsoft .NET: Architecting Applications for the Enterprise ... - BattleIT

Microsoft .NET: Architecting Applications for the Enterprise ... - BattleIT

Microsoft .NET: Architecting Applications for the Enterprise ... - BattleIT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

viii Table of Contents<br />

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

Murphy’s Laws of <strong>the</strong> Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

3 Design Principles and Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63<br />

Basic Design Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63<br />

For What <strong>the</strong> Alarm Bell Should Ring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65<br />

Structured Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66<br />

Separation of Concerns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70<br />

Object-Oriented Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73<br />

Basic OOD Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73<br />

Advanced Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80<br />

From Principles to Patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85<br />

What’s a Pattern, Anyway?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86<br />

Patterns vs. Idioms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92<br />

Dependency Injection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95<br />

Applying Requirements by Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97<br />

Testability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97<br />

Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108<br />

From Objects to Aspects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116<br />

Aspect-Oriented Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116<br />

AOP in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120<br />

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124<br />

Murphy’s Laws of <strong>the</strong> Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125<br />

Part II Design of <strong>the</strong> System<br />

4 The Business Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129<br />

What’s <strong>the</strong> Business Logic Layer, Anyway?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130<br />

Dissecting <strong>the</strong> Business Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130<br />

Where Would You Fit <strong>the</strong> BLL? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134<br />

Business and O<strong>the</strong>r Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138<br />

Patterns <strong>for</strong> Creating <strong>the</strong> Business Layer . . . . . . . . . . . . . . . . . . . . . . . . . 141<br />

The Transaction Script Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145<br />

Generalities of <strong>the</strong> TS Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145<br />

The Pattern in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149<br />

The Table Module Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154<br />

Generalities of <strong>the</strong> TM Pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155<br />

The TM Pattern in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!