Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.

Slides:



Advertisements
Similar presentations
1 Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Advertisements

Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Software Development Architectures Ankur K. Rajopadhye Louisiana Tech University.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
B USINESS LAYER SAMANVITHA RAMAYANAM 4 th MARCH 2010 CPE 691.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
Presenter - Donn Felker.  Senior Consultant for Microsoft Gold Certified Partner- Statêra.  8 years of experience in developing and architecting enterprise.
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
NODEJS, THE JOOMLA FRAMEWORK, AND THE FUTURE IAN MACLENNAN.
Building SOLID Software with Dependency Injection Jeremy Rosenberg.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
CSC 395 – Software Engineering Lecture 12: Reusability –or– Programming was Bjarne Again.
Design Design and Software Architecture. The design phase The analysis phase describes what the system should be doing The design phase describes how.
Improving the Quality of Existing Code Svetlin Nakov Telerik Corporation
Team Think For You. Outline  Introduction  Process  Requirements Engineering  Architecture  Detailed Design  Testing  Demo  Extensibility  Conclusions.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Software Design: Principles, Process, and Concepts Getting Started with Design.
Model View Controller MVC Web Software Architecture.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Five design principles
Introduction (Continued) Design Patterns (I) Lecture Two.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
WHAT IS PHP FRAMEWORK? Set of Classes and Functions(Methods) Design for the development of web applications Provide basic structure Rapid application development(RAD)
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
 An essential supporting structure of any thing  A Software Framework  Has layered structure ▪ What kind of functions and how they interrelate  Has.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
Dependency Inversion By Steve Faurie. Dependency Inversion Described in Agile Principles, Patterns and Practices in C# by Robert C. Martin.
Testing WebForms w/ Model-View-Presenter Erik Peterson.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Design I. Properties of good design Minimize complexity Maintainable Loose coupling Extensibility Reusability High fan in Low to medium fan out Portability.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 6.0.
By Aleksey Stukalov How to Develop Highly Customizable Off-the-Shelf Software.
Interface Segregation / Dependency Inversion
(Complex) Problem domain Requirements Specification
GRASP – Designing Objects with Responsibilities
Introduction to .NET Florin Olariu
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Software Architecture & Difference from Design
Copyright © by Curt Hill
Unit Testing & Test-Driven Development for Mere Mortals
BTS530: Major Project Planning and Design
The Object Oriented Approach to Design
Unit Testing & Test-Driven Development for Mere Mortals
Vertical Feature Slices Not Layers
Objects First with Java
Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified.
Enterprise Architecture Patterns
Design Tips.
Software Design Lecture : 8
Unit Testing & Test-Driven Development for Mere Mortals
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Architecting Silverlight Applications with MVVM
A (partial) blueprint for dealing with change
Dependency Inversion principle
Extending Interface Based Design
Interface Segregation Principle
Dependency Injection Mechanism
Presentation transcript:

Principled N-Tier Design or, a Solution to the Solution Problem Steve | ardalis.com Telerik, Inc.

The Problem

Solution Level Pain Too Many Projects Too Few Projects Incorrect Abstraction The “Goldilocks” Solution – “Just right”

Relevant Principles Common Closure Principle Common Reuse Principle Stable Dependencies Principle Stable Abstractions Principle Separation of Concerns Dependency Inversion Principle

Common Closure Principle Classes that change together are packaged together.

Common Reuse Principle Classes that are used together are packaged together.

Stable Dependencies Principle Depend in the direction of stability.

Stable Abstractions Principle Abstractness increases with stability. Stability Abstractness Ideal Rigid Useless

More Principles Separation of Concerns Establish boundaries to separate behaviors and responsibilities within a system. Dependency Inversion Depend on abstractions, not concrete implementations.

DEMO A Simple Guestbook Application

Testability Testability correlates with: – Loose coupling – Separation of Concerns – Maintainability You don’t have to have unit tests to have testable code! – Unit tests prove (or disprove) testability

DEMO Adding “Unit” Tests

SMTP4DEV

Incremental Improvement From a Single Project – Separate responsibilities using folders – Add Project(s) From Many Projects – Create a new Solution with only what you need – Spin off separate applications into own solutions

DEMO Separation via Folders (still 1 project)

Problems Tests are still not unit tests – Tight coupling – Static Cling – Dependence on Data and Infrastructure concerns Nothing to prevent improper referencing of classes – e.g. UI code can call DAL code directly and bypass business logic UI Content Folders mixed with Application Code Folders

Onion Architecture aka Ports and Adapters, aka Hexagonal Architecture Core models and interfaces at center Infrastructure and Implementation depends on Core UI depends on Core and has access to Infrastructure

Onion Architecture

DEMO Introduce Abstractions and Invert Dependencies (in folders)

Results Yay! Unit Tests that work! Boo! Still nothing to prevent improper referencing of classes – e.g. UI code can call DAL code directly and bypass business logic Boo! Still mixing content and code folders

DEMO Refactor into Projects

Results Testable Code Separation of Concerns Loose Coupling Minimal logic in UI layer A solid foundation for a maintainable application!

Automate One Click Build One Click Test

DEMO Solution Automation – Build Scripts

DEMO More Tests

References Separation of Concerns - Hexagonal Architecture - Onion Architecture - More Onion Architecture - New is Glue - Pluralsight Resources N-Tier Application Design in C# Design Patterns Library SOLID Principles of OO Design

Thanks! Find me at We’re hiring developers and trainers at Telerik!