Build Testable Client and Service Applications

Size: px
Start display at page:

Download "Build Testable Client and Service Applications"

Transcription

1 Build Testable Client and Service Applications Brian Noyes IDesign Inc ( About Brian Chief Architect IDesign Inc. ( Microsoft Regional Director MVP Microsoft MVP Connected Systems Publishing Developing Applications with Windows Workflow Foundation, LiveLessons training DVD, June 2007 Smart Client Deployment with ClickOnce, Addison Wesley, January 2007 Data Binding in Windows Forms 2.0, Addison Wesley, January 2006 MSDN Magazine, MSDN Online, CoDe Magazine, The Server Side.NET, asp.netpro, Visual Studio Magazine Speaking Blog: Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, INETA Speakers Bureau, MSDN Webcasts 1

2 Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks Design for Testability Should this really be the way you think about it? A good design with high quality is the goal, not that you can test it Some changes to design and process are a necessity if you want to be testable Affects design at the component level, rarely at the system level May influence technology selections 2

3 TDD Should you use TDD? Probably Will it be hard to get used to? Probably Do I need to become a card-carrying zealot? No What does TDD buy you? Drives a clean design Ensures your app is testable Puts the tests in place as part of the process Mocks, Stubs, Fakes, oh my Terminology: Mock a test double that has expectations on how it is called Stub a test double that provides data to a test without breaking the test if its usage is different than the test specifies Fake has a real implementation, but simplified to just what the test needs Dummy object that provides a reference to unit under test, but is not called in general and does nothing Generalization: Mocks is often used to refer to all of these. Cleaner term is Test Double 3

4 Test Double Client Business Layer Component Data Layer Component Production Unit Test Business Layer Component Data Layer Double Test Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks 4

5 S.O.L.I.D. Principles Single Responsibility Principle (SRP) Open-Close Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP) Documented by Robert (Uncle Bob) Martin of ObjectMentor Single Responsibility Principle A class should have only one reason for change Ex: Order rich business object Contains data Implements business rules Does data persistence Should be at least 3 classes Simple, focused classes and methods are also much easier to test 5

6 Open-Close Principle You should be able to extend a class behavior without changing it Clients should depend on an abstraction of the actual object they are using Ex: Rendering engine IShape.Render() Open-Close Principle Extensions Basis for many modern best practices: Encapsulated member variables Aggressively avoid globals (static variables/props) Beware explicit casting Violating these practices is the enemy of testability 6

7 Liskov Substitution Principle Derived classes must be substitutable for their base classes Can also apply to component-based extensibility and plug-in architectures based on interfaces Drives Design by Contract mentality Ex: Rectangle/Square hierarchy What should happen if someone calls SetHeight on a Square vs a Rectangle? Dependency Inversion Principle Depend on abstractions, not concrete implementations Allow multiple concrete implementations to be substituted Basis for interface-based programming ESSENTIAL for testability Leads to dependency injection patterns 7

8 Interface Segregation Principle Make fine-grained interfaces that are client specific Separate contract per-usage scenario SRP extended to interface design Prevents needing to change a client if some functionality they don t use does not change Avoid potential for breakage Looser coupling facilitates testing Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks 8

9 Inversion of Control / Dependency Injection Closely related patterns IoC: Pattern for indirect construction of objects Delegate responsibility for construction of objects to a Container Dependency Injection Dependencies of an object are injected from the outside instead of constructing internally Most Containers do both Container constructs objects and injects their dependencies Dependencies are often located using Service Locator pattern.net DI Containers Unity MEF? Castle Windsor StructureMap Spring.NET NInject CAB WorkItem 9

10 DI Container Functions Object construction Injection of dependencies Child object relations Service Locator Lifetime management How long does the object live and what instance is given to the caller when they ask DI and Testability DI allows you to design a more loosely coupled application Generally need to adhere to S.O.L.I.D. Principles for it to work out Good pattern even if you don t unit test Extensibility, auto-wiring, centralized lifetime management Allows easy substitution of test doubles 10

11 DI and WCF WCF normally constructs service instances itself based on your selected instancing model Per Call, Per Session, Singleton To leverage a DI container in WCF, you have to intercept the construction process and let the DI container do it Service behavior Instance Provider Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks 11

12 Model View Controller (MVC) Model is the business logic and data View is a single page or chunk of screen Controller decides when to present each view / coordinates view-view interactions Model View Presenter 12

13 Presentation Model Also known as Model-View-ViewModel in the WPF / Silverlight world (MVVM) ViewModel offers up state to the view in the way the view wants to see it ViewModel Offers up state to the view through simple properties Encapsulates interaction logic to support the view Initial load of data Command handlers Should be loosely coupled to the view Relationship with the view 1:1 most common 1 view : multiple view models (example: Add/Edit ) Multiple views : 1 ViewModel (example: listing/details views) Properties should raise change events Implement INotifyPropertyChanged or DependencyProperties 13

14 Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks Repository Pattern Fowler: Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects. Interface separation between persistence strategy and application usage of data Allows you to change implementation Allows you to test with double implementation Simple collection oriented API (All, Where, Update,Delete,etc.) Can include other transmogrify methods (SimpleCustomerWhere) May have multiple entity types on a single repository interface Usually supporting types for a single parent concept (i.e. Customer/Address) 14

15 Repositories Using the repository pattern can help a lot in testing Isolate the specifics of persistence from the consuming objects Persistence is the most test-resistant part of your code Become a point for dependency injection for testing Allow you to switch to a different implementation strategy later with no impact on application i.e. LINQ to SQL -> Entity Framework Agenda Design for Testability S.O.L.I.D. Principles IoC / Dependency Injection Separated Presentation Repository Pattern Testability Tricks 15

16 Testability Tricks Avoid inline construction of dependencies Define dependencies as members if possible Define dependency injection constructors Even if you don t use a container Use for tests to inject test doubles Use overridable factory methods for dynamically created dependencies Can override in a test version of the class to inject test doubles Avoid static members / singletons Create Simulators and Emulators for your services Leverage a real isolation framework Rhino Mocks, MOQ, TypeMock Isolator, etc. G -word Guide Smells: Constructor does real work Digging in to collaborators (dependencies) Law of Demeter Brittle Global State and Singletons Class does too much 16

17 Resources S.O.L.I.D. principles: Repository Unity Separated Presentation Using DI: Blog: 17

Prism Composite Application Guidance

Prism Composite Application Guidance Prism Composite Application Guidance Brian Noyes www.idesign.net About Brian Chief Architect IDesign Inc. (www.idesign.net) Microsoft Regional Director (www.theregion.com) Microsoft MVP Silverlight Publishing

More information

Composite Application Guidance for WPF and Silverlight (AKA Prism 2 )

Composite Application Guidance for WPF and Silverlight (AKA Prism 2 ) Composite Application Guidance for WPF and Silverlight (AKA Prism 2 ) Brian Noyes www.idesign.net About Brian Chief Architect, IDesign Inc. (www.idesign.net) Microsoft Regional Director / MVP Publishing

More information

AR.04 Composite Application Guidance for WPF (aka Prism ) Brian Noyes IDesign Inc (www.idesign.net)

AR.04 Composite Application Guidance for WPF (aka Prism ) Brian Noyes IDesign Inc (www.idesign.net) AR.04 Composite Application Guidance for WPF (aka Prism ) Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net About Brian Chief Architect, IDesign Inc. (www.idesign.net) Microsoft Regional

More information

Thinking and Processing in Parallel Wrap Your Head Around WF 4.0 Concurrency. Brian Noyes IDesign Inc (www.idesign.net)

Thinking and Processing in Parallel Wrap Your Head Around WF 4.0 Concurrency. Brian Noyes IDesign Inc (www.idesign.net) Thinking and Processing in Parallel Wrap Your Head Around WF 4.0 Concurrency Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net About Brian Chief Architect IDesign Inc. (www.idesign.net)

More information

Building Extensible XAML Client Apps

Building Extensible XAML Client Apps Building Extensible XAML Client Apps Brian Noyes Chief Architect, IDesign Inc www.idesign.net brian.noyes@idesign.net, @briannoyes Level: Intermediate About Brian Chief Architect IDesign Inc. (www.idesign.net)

More information

Build Loosely Coupled Silverlight Business Applications

Build Loosely Coupled Silverlight Business Applications Build Loosely Coupled Silverlight Business Applications Brian Noyes www.idesign.net About Brian Chief Architect IDesign Inc. (www.idesign.net) Microsoft Regional Director (www.theregion.com) Microsoft

More information

Build Custom Data Bound Objects and Collections

Build Custom Data Bound Objects and Collections Build Custom Data Bound Objects and Collections Brian Noyes IDesign, Inc. (www.idesign.net) brian.noyes@idesign.net About Brian Chief Architect, IDesign Inc. (www.idesign.net) Microsoft Regional Director

More information

APP301: Implement a Data Access Layer with Enterprise Library

APP301: Implement a Data Access Layer with Enterprise Library APP301: Implement a Data Access Layer with Enterprise Library Brian Noyes IDesign Inc. (www.idesign.net) brian.noyes@idesign.net http://www.softinsight.com/bnoyes/ About Brian Chief Architect, IDesign

More information

Building Loosely Coupled XAML Client Apps with Prism

Building Loosely Coupled XAML Client Apps with Prism Building Loosely Coupled XAML Client Apps with Prism Brian Noyes IDesign Inc. (www.idesign.net) brian.noyes@idesign.net, @briannoyes About Brian Chief Architect IDesign Inc. (www.idesign.net) Microsoft

More information

VWC02 Build N-Tier Silverlight Data Applications Easily with WCF RIA Services

VWC02 Build N-Tier Silverlight Data Applications Easily with WCF RIA Services VWC02 Build N-Tier Silverlight Data Applications Easily with WCF RIA Services Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net @briannoyes About Brian Chief Architect IDesign Inc. (www.idesign.net)

More information

Drive Application Behavior with Application and User Configuration Settings Brian Noyes IDesign Inc (www.idesign.net)

Drive Application Behavior with Application and User Configuration Settings Brian Noyes IDesign Inc (www.idesign.net) Drive Application Behavior with Application and User Configuration Settings Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net About Brian Chief Architect, IDesign Inc. (www.idesign.net)

More information

Blissful Separation of Concerns with Model-View-ViewModel (MVVM)

Blissful Separation of Concerns with Model-View-ViewModel (MVVM) Blissful Separation of Concerns with Model-View-ViewModel (MVVM) Brian Noyes Chief Architect, IDesign(www.idesign.net) brian.noyes@idesign.net, @briannoyes Level: Intermediate About Brian Chief Architect

More information

Drive Application Behavior with Application and User Configuration Settings. Brian Noyes IDesign Inc (www.idesign.net)

Drive Application Behavior with Application and User Configuration Settings. Brian Noyes IDesign Inc (www.idesign.net) Drive Application Behavior with Application and User Configuration Settings Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net About Brian Chief Architect, IDesign Inc. (www.idesign.net)

More information

VS10 WCF of Many Flavors When do I use which?

VS10 WCF of Many Flavors When do I use which? VS10 WCF of Many Flavors When do I use which? Brian Noyes Chief Architect, IDesign Inc (www.idesign.net) brian.noyes@idesign.net, @briannoyes About Brian Chief Architect IDesign Inc. (www.idesign.net)

More information

Building Extensible XAML Client Apps

Building Extensible XAML Client Apps Building Extensible XAML Client Apps Brian Noyes IDesign Inc. (www.idesign.net) brian.noyes@idesign.net, @briannoyes About Brian Chief Architect IDesign Inc. (www.idesign.net) Microso7 Regional Director

More information

WCF RIA Services. About Brian 8/10/2011. Brian Noyes Chief Architect IDesign Inc. (www.idesign.net)

WCF RIA Services. About Brian 8/10/2011. Brian Noyes  Chief Architect IDesign Inc. (www.idesign.net) WCF RIA Services Brian Noyes www.idesign.net About Brian Chief Architect IDesign Inc. (www.idesign.net) Microsoft Regional Director (www.theregion.com) Microsoft MVP Silverlight Publishing Developers Guide

More information

Smart Client Offline Data Caching and Synchronization

Smart Client Offline Data Caching and Synchronization Smart Client Offline Data Caching and Brian Noyes Principal Software Architect IDesign, Inc.(www.idesign.net) About Brian Principal Software Architect, IDesign Inc. (www.idesign.net) Microsoft MVP in ASP.NET

More information

VSC01 Securing WPF Client Applications

VSC01 Securing WPF Client Applications VSC01 Securing WPF Client Applications Brian Noyes IDesign Inc (www.idesign.net) brian.noyes@idesign.net @briannoyes About Brian Chief Architect IDesign Inc. (www.idesign.net) Microsoft Regional Director

More information

LVL08 Black Belt Silverlight Business Data Validation

LVL08 Black Belt Silverlight Business Data Validation LVL08 Black Belt Silverlight Business Data Validation Brian Noyes Chief Architect, IDesign Inc (www.idesign.net) brian.noyes@idesign.net, @briannnoyes About Brian Chief Architect IDesign Inc. (www.idesign.net)

More information

NE.15 Data Binding In Windows Presentation Foundation

NE.15 Data Binding In Windows Presentation Foundation NE.15 Data Binding In Windows Presentation Foundation Brian Noyes Chief Architect IDesign Inc (www.idesign.net) 1 About Brian Chief Architect, IDesignInc. (www.idesign.net) Microsoft Regional Director/MVP

More information

NET237: Deploying Smart Client Apps with ClickOnce

NET237: Deploying Smart Client Apps with ClickOnce NET237: Deploying Smart Client Apps with Brian Noyes Principal Software Architect IDesign, Inc. (www.idesign.net) About Brian Principal Software Architect, IDesign Inc. (www.idesign.net) Microsoft MVP

More information

Learn to Behave Extend Your XAML with Behaviors

Learn to Behave Extend Your XAML with Behaviors Learn to Behave Extend Your XAML with Behaviors Brian Noyes Chief Architect, IDesign Inc. www.idesign.net brian.noyes@idesign.net, @briannoyes Level: Intermediate About Brian Chief Architect IDesign Inc.

More information

Windows Presentation Foundation In Windows Forms And Vice Versa

Windows Presentation Foundation In Windows Forms And Vice Versa Windows Presentation Foundation In Windows Forms And Vice Versa Brian Noyes Chief Architect IDesign Inc (www.idesign.net) 1 About Brian Chief Architect, IDesignInc. (www.idesign.net) Microsoft Regional

More information

Data Binding with Windows Forms 2.0

Data Binding with Windows Forms 2.0 Data Binding with Windows Forms 2.0 Brian Noyes Chief Architect IDesign,, Inc. (www.idesign.net( www.idesign.net) About Brian Microsoft Solution Architect MVP Writing MSDN Magazine, CoDe Magazine, The

More information

Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, INETA Speakers Bureau, MSDN Webcasts

Microsoft TechEd US, Europe, Malaysia, Visual Studio Connections, DevTeach, INETA Speakers Bureau, MSDN Webcasts DEV340 MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 1 Chief Architect, IDesignInc. (www.idesign.net) Microsoft Regional Director/MVP Writing

More information

VS08 This One Goes to Going Parallel with PFX, PLINQ, TPL and Async Keywords

VS08 This One Goes to Going Parallel with PFX, PLINQ, TPL and Async Keywords VS08 This One Goes to Going Parallel with PFX, PLINQ, TPL and Async Keywords Brian Noyes Chief Architect, IDesign Inc (www.idesign.net) brian.noyes@idesign.net, @briannoyes About Brian Chief Architect

More information

Data Binding in ASP.NET 2.0

Data Binding in ASP.NET 2.0 Data Binding in ASP.NET 2.0 Brian Noyes Principal Software Architect IDesign, Inc. (www.idesign.net) About Brian Principal Software Architect, IDesign Inc. (www.idesign.net) Microsoft MVP in ASP.NET Writing

More information

Tackle Complex Data Binding in WinForms 2.0

Tackle Complex Data Binding in WinForms 2.0 Tackle Complex Data Binding in WinForms 2.0 Brian Noyes Principal Software Architect IDesign,, Inc. (www.idesign.net( www.idesign.net) About Brian Microsoft MVP in ASP.NET Writing MSDN Magazine, CoDe Magazine,

More information

DI Why? Getting a Grip on Dependency Injection. Jeremy Clark

DI Why? Getting a Grip on Dependency Injection. Jeremy Clark DI Why? Getting a Grip on Dependency Injection Jeremy Clark www.jeremybytes.com @jeremybytes What Is Dependency Injection? Dependency Injection is a software design pattern that allows a choice of component

More information

Build Process Driven Applications with WF

Build Process Driven Applications with WF Build Process Driven Applications with WF Brian Noyes www.idesign.net 2006 IDesign Inc. All rights reserved About Brian Microsoft Regional Director / Solution Architect MVP Writing Data Binding in Windows

More information

Introduction to.net Deployment. Brian Noyes IDesign, Inc. (

Introduction to.net Deployment. Brian Noyes IDesign, Inc. ( Introduction to.net Deployment Brian Noyes IDesign, Inc. (www.idesign.net) brian.noyes@idesign.net About Brian Principal Software Architect, IDesign Inc. (www.idesign.net) Microsoft MVP in ASP.NET Writing

More information

Prism Composite Application Guidance

Prism Composite Application Guidance Prism Composite Application Guidance Brian Noyes www.idesign.net Prism Developed by Microsoft patterns and practices Old name: Composite Application Guidance for WPF and Silverlight Guidance for building

More information

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ Serialization PLINQ WPF LINQ SOA Design Patterns Web Services 4.0.NET Reflection Reflection WCF MVC Microsoft Visual Studio 2010 Advanced Contents for.net Professionals Learn new and stay updated Design

More information

Introduction to Testing and Maintainable code

Introduction to Testing and Maintainable code Introduction to Testing and Maintainable code Reasons not to write unit tests 1. I don't know how to write tests. 2. Writing tests is too hard. 3. I don't have enough time to write tests. 4. Testing is

More information

Top 7 Lessons From My First Big Silverlight Project

Top 7 Lessons From My First Big Silverlight Project Top 7 Lessons From My First Big Silverlight Project Benjamin Day Benjamin Day Consulting, Inc. Level: Intermediate/Advanced Benjamin Day Consultant, Coach, Trainer Professional Scrum Development Trainer

More information

CSC207H: Software Design SOLID. CSC207 Winter 2018

CSC207H: Software Design SOLID. CSC207 Winter 2018 SOLID CSC207 Winter 2018 1 SOLID Principles of Object-Oriented Design How do we make decisions about what is better and what is worse design? Principles to aim for instead of rules. e.g. there is no maximum

More information

Software Engineering

Software Engineering Software Engineering CSC 331/631 - Spring 2018 Object-Oriented Design Principles Paul Pauca April 10 Design Principles DP1. Identify aspects of the application that vary and separate them from what stays

More information

SOLID Principles. Equuleus Technologies. Optional Subheading October 19, 2016

SOLID Principles. Equuleus Technologies. Optional Subheading October 19, 2016 SOLID Principles Optional Subheading October 19, 2016 Why SOLID Principles? The traits of well designed software are as follows Maintainability - The ease with which a software system or component can

More information

Single Responsibility Principle (SRP)

Single Responsibility Principle (SRP) Single Responsibility Principle (SRP) Produced by: Eamonn de Leastar (edeleastar@wit.ie) Dr. Siobhán Drohan (sdrohan@wit.ie) Department of Computing and Mathematics http://www.wit.ie/ SOLID Class Design

More information

Test Your XAML-based Windows Store Apps with Visual Studio 2013 Benjamin Day

Test Your XAML-based Windows Store Apps with Visual Studio 2013 Benjamin Day Test Your XAML-based Windows Store Apps with Visual Studio 2013 Benjamin Day Level: Intermediate Benjamin Day Brookline, MA Consultant, Coach, & Trainer Microsoft MVP for Visual Studio ALM Team Foundation

More information

Smart Client Offline Data Caching and Synchronization

Smart Client Offline Data Caching and Synchronization Smart Client Offline Data Caching and Synchronization Brian Noyes Principal Software Architect IDesign,, Inc. www.idesign.net Offline Operations Challenges 1 What is a Smart Client Rich user interface

More information

Clean Code Why Clean Code matters

Clean Code Why Clean Code matters Silicon Valley Code Camp Clean Code Why Clean Code matters Foothill College, October 9 nd 2011 Theo Jungeblut Senior Software Developer at Omnicell Inc. in Mountain View Has been designing and implementing.net

More information

Implementing MVVM in Real World ArcGIS Server Silverlight Applications. Brandon Copeland LJA Engineering, Inc.

Implementing MVVM in Real World ArcGIS Server Silverlight Applications. Brandon Copeland LJA Engineering, Inc. Implementing MVVM in Real World ArcGIS Server Silverlight Applications Brandon Copeland LJA Engineering, Inc. 1 Agenda / Focused Topics Application Demo Model-View-ViewModel (MVVM) What is MVVM? Why is

More information

Resolving Cyclic Dependencies Design for Testability

Resolving Cyclic Dependencies Design for Testability Int'l Conf. Software Eng. Research and Practice SERP'16 109 Resolving Cyclic Dependencies Design for Testability Yurii Boreisha, Oksana Myronovych Department of Computer Science, Minnesota State University

More information

Agile Architecture. The Why, the What and the How

Agile Architecture. The Why, the What and the How Agile Architecture The Why, the What and the How Copyright Net Objectives, Inc. All Rights Reserved 2 Product Portfolio Management Product Management Lean for Executives SAFe for Executives Scaled Agile

More information

Philosophy of Unit Testing

Philosophy of Unit Testing Unit Testing in.net Philosophy of Unit Testing What? Where? Why? How? What it is not? Test individual components (units) in isolation isolate and validate verify to confirm preexisting specification. Inputs

More information

Extending ASP.NET. Brian Noyes Principal Software Architect IDesign, Inc. ( (

Extending ASP.NET. Brian Noyes Principal Software Architect IDesign, Inc. (  ( Extending ASP.NET Brian Noyes Principal Software Architect IDesign, Inc. (www.idesign.net( www.idesign.net) About Brian Principal Software Architect, IDesign Inc. (www.idesign.net) Microsoft MVP in ASP.NET

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Software quality and Object Oriented Principles

Ingegneria del Software Corso di Laurea in Informatica per il Management. Software quality and Object Oriented Principles Ingegneria del Software Corso di Laurea in Informatica per il Management Software quality and Object Oriented Principles Davide Rossi Dipartimento di Informatica Università di Bologna Design goal The goal

More information

17.11 Bean Rules persistent

17.11 Bean Rules persistent 17.10 Java Beans Java beans are a framework for creating components in Java. AWT and Swing packages are built within this framework Made to fit in with graphic development environments such as Jbuilder

More information

Dependency Inversion, Dependency Injection and Inversion of Control. Dependency Inversion Principle by Robert Martin of Agile Fame

Dependency Inversion, Dependency Injection and Inversion of Control. Dependency Inversion Principle by Robert Martin of Agile Fame Dependency Inversion, Dependency Injection and Inversion of Control Dependency Inversion Principle by Robert Martin of Agile Fame Dependency Inversion Principle History Postulated by Robert C. Martin Described

More information

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently. Gang of Four Software Design Patterns with examples STRUCTURAL 1) Adapter Convert the interface of a class into another interface clients expect. It lets the classes work together that couldn't otherwise

More information

Single Responsibility Principle

Single Responsibility Principle Single Responsibility Principle Class should have only one responsibility which means class should be highly cohesive and implement strongly related logic. Class implementing feature 1 AND feature 2 AND

More information

Bruno Bossola SOLID Design Principles

Bruno Bossola SOLID Design Principles Bruno Bossola SOLID Design Principles About me C Developer since 1988 Java developer since 1996 XP Coach during 2000 2001 Lead coordinator and co founder of JUG Torino in 2001 Sun Java Champion since 2005

More information

Embrace Factories Factories. By Rob Gonda

Embrace Factories Factories. By Rob Gonda Embrace Factories Factories By Rob Gonda Brief History of OOP for CF Once upon a time Procedural Code Spaghetti Code Organized a) Includes b) Modules OOP / CFC (mx+) Objects as containers The Big Object

More information

Build Better WPF & Silverlight applications using Prism v2

Build Better WPF & Silverlight applications using Prism v2 Build Better WPF & Silverlight applications using Prism v2 Client Application Challenges The Problem: Client Applications can be Difficult! How Do You Make The Application Dynamic, Customizable, Extensible,

More information

Test, Code, Design: Inverting the Waterfall

Test, Code, Design: Inverting the Waterfall Test, Code, Design: Inverting the Waterfall Agenda Design Change Testing Code Reviews Refactoring Who am I? John Deters jadeters@comcast.net Son of a programmer Programming computers all my life I have

More information

Chris Donnan & Solomon Duskis

Chris Donnan & Solomon Duskis The Peer Frameworks Series -.Net and Java Spring Framework Developer Session Chris Donnan & Solomon Duskis All Rights Reserved 0 Overview 600-630 Light Snack 630 700 Introduction to Inversion of Control,

More information

Cross-Platform Mobile Platforms and Xamarin. Presented by Mir Majeed

Cross-Platform Mobile Platforms and Xamarin. Presented by Mir Majeed Cross-Platform Mobile Platforms and Xamarin Presented by Mir Majeed Agenda 1. Sharing Code Among Different Platforms File-Linking into each App Project Portable Class Libraries 2. Solution Population Strategies

More information

CHAPTER 5: PRINCIPLES OF DETAILED DESIGN

CHAPTER 5: PRINCIPLES OF DETAILED DESIGN CHAPTER 5: PRINCIPLES OF DETAILED DESIGN SESSION II: STRUCTURAL AND BEHAVIORAL DESIGN OF COMPONENTS Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E.

More information

Test Driven Development (TDD), and Working with Legacy Code Using C# Workshop ( 4 days)

Test Driven Development (TDD), and Working with Legacy Code Using C# Workshop ( 4 days) Test Driven Development (TDD), and Working with Legacy Code Using C# Workshop ( 4 days) HOTEL DUBAI GRAND April 16 to 19-2018 Monday to Thursday ) (4 days) 9 am to 4 pm ISIDUS TECH TEAM FZE PO Box 9798

More information

Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas

Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas Welcome to Design Patterns! For syllabus, course specifics, assignments, etc., please see Canvas What is this class about? While this class is called Design Patterns, there are many other items of critical

More information

OO Class Design Principles

OO Class Design Principles 3.3 Class Design Principles Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) a.k.a. Design by Contract Dependency Inversion Principle (DIP) Interface

More information

Influence of Design Patterns Application on Quality of IT Solutions

Influence of Design Patterns Application on Quality of IT Solutions Influence of Design Patterns Application on Quality of IT Solutions NADINA ZAIMOVIC, DZENANA DONKO Department for Computer Science and Informatics Faculty of Electrical Engineering, University of Sarajevo

More information

Open Closed Principle (OCP)

Open Closed Principle (OCP) Open Closed Principle (OCP) Produced by: Eamonn de Leastar (edeleastar@wit.ie) Dr. Siobhán Drohan (sdrohan@wit.ie) Department of Computing and Mathematics http://www.wit.ie/ SOLID Class Design Principles

More information

Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core. Gill

Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core. Gill Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core Gill Cleeren @gillcleeren www.snowball.be Agenda Overall application structure The Xamarin application architecture

More information

Summary of the course lectures

Summary of the course lectures Summary of the course lectures 1 Components and Interfaces Components: Compile-time: Packages, Classes, Methods, Run-time: Objects, Invocations, Interfaces: What the client needs to know: Syntactic and

More information

Software Engineering CSC40232: SOFTWARE ENGINEERING. Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017

Software Engineering CSC40232: SOFTWARE ENGINEERING. Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017 CSC40232: SOFTWARE ENGINEERING Guest Lecturer: Jin Guo SOLID Principles sarec.nd.edu/courses/se2017 Department of Computer Science and Engineering http://www.kirkk.com/modularity/2009/12/solid-principles-of-class-design/

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 15: Object-Oriented Principles 1 Open Closed Principle (OCP) Classes should be open for extension but closed for modification. OCP states that we should

More information

1 Software Architecture

1 Software Architecture Some buzzwords and acronyms for today Software architecture Design pattern Separation of concerns Single responsibility principle Keep it simple, stupid (KISS) Don t repeat yourself (DRY) Don t talk to

More information

Building Effective ASP.NET MVC 5.x Web Applications using Visual Studio 2013

Building Effective ASP.NET MVC 5.x Web Applications using Visual Studio 2013 coursemonster.com/au Building Effective ASP.NET MVC 5.x Web Applications using Visual Studio 2013 Overview The course takes existing.net developers and provides them with the necessary skills to develop

More information

Design Principles: Part 2

Design Principles: Part 2 Liskov Substitution Principle (LSP) Dependency-Inversion Principle (DIP) Interface-Segregation Principle (ISP) Design Principles: Part 2 ENGI 5895: Software Design Andrew Vardy Faculty of Engineering &

More information

Outline. Design Principles: Part 2. e.g. Rectangles and Squares. The Liskov Substitution Principle (LSP) ENGI 5895: Software Design.

Outline. Design Principles: Part 2. e.g. Rectangles and Squares. The Liskov Substitution Principle (LSP) ENGI 5895: Software Design. Liskov Substitution Principle (LSP) Dependency-Inversion Principle (DIP) Interface-Segregation Principle (ISP) Liskov Substitution Principle (LSP) Dependency-Inversion Principle (DIP) Interface-Segregation

More information

Principles of Object-Oriented Design

Principles of Object-Oriented Design Principles of Object-Oriented Design 1 The Object-Oriented... Hype What are object-oriented (OO) methods? OO methods provide a set of techniques for analysing, decomposing, and modularising software system

More information

Object-Oriented Design I

Object-Oriented Design I Object-Oriented Design I SWEN-261 Introduction to Software Engineering Department of Software Engineering Rochester Institute of Technology Single responsibility High cohesion Information expert Low coupling

More information

GitHub code samples. Appendix B

GitHub code samples. Appendix B Appendix B GitHub code samples The vast majority of the code samples in this book were taken from Microsoft Visual Studio 2013 solutions. Although not all of them are directly runnable, they can all be

More information

Application Architectures, Design Patterns

Application Architectures, Design Patterns Application Architectures, Design Patterns Martin Ledvinka martin.ledvinka@fel.cvut.cz Winter Term 2017 Martin Ledvinka (martin.ledvinka@fel.cvut.cz) Application Architectures, Design Patterns Winter Term

More information

Overview and Technical Design Insurance Agent Portal, Pomegranate

Overview and Technical Design Insurance Agent Portal, Pomegranate Overview and Technical Design Insurance Agent Portal, Pomegranate This document describes the features and technical design of the exemplar code-named Pomegranate. This application is a SharePoint (ASP.Net)

More information

Pro XAML with C# From Design to Deployment on WPF, Windows Store, and Windows Phone. Buddy James. Lori Lalonde

Pro XAML with C# From Design to Deployment on WPF, Windows Store, and Windows Phone. Buddy James. Lori Lalonde Pro XAML with C# From Design to Deployment on WPF, Windows Store, and Windows Phone Buddy James Lori Lalonde Contents J About the Authors About the Technical Reviewer Acknowledgments Introduction xiii

More information

17 Roberts St #2 Brookline, MA

17 Roberts St #2 Brookline, MA Benjamin Day www.benday.com blog.benday.com 17 Roberts St #2 Brookline, MA 02445 benday@benday.com 617-645-0188 Last Updated August 7, 2009 Overview 12 years of software architecture, development, and

More information

COPYRIGHTED MATERIAL. Introducing the Project: The SmartCA Application. The Problem

COPYRIGHTED MATERIAL. Introducing the Project: The SmartCA Application. The Problem Introducing the Project: The SmartCA Application The project for this book is based on a real application for a real company. The names of the company and the application have been changed for privacy

More information

Improve Your SystemVerilog OOP Skills

Improve Your SystemVerilog OOP Skills 1 Improve Your SystemVerilog OOP Skills By Learning Principles and Patterns Jason Sprott Verilab Email: jason.sprott@verilab.com www.verilab.com Experts in SV Learn Design Patterns 2 Look, you don t need

More information

Design patterns. Jef De Smedt Beta VZW

Design patterns. Jef De Smedt Beta VZW Design patterns Jef De Smedt Beta VZW Who Beta VZW www.betavzw.org Association founded in 1993 Computer training for the unemployed Computer training for employees (Cevora/Cefora) 9:00-12:30 13:00-16:00

More information

Software Development Project. Kazi Masudul Alam

Software Development Project. Kazi Masudul Alam Software Development Project Kazi Masudul Alam Course Objective Study Programming Best Practices Apply the knowledge to build a Small Software in Groups 7/10/2017 2 Programming Best Practices Code Formatting

More information

Design Principles: Part 2

Design Principles: Part 2 Liskov Substitution Principle (LSP) Dependency-Inversion Principle (DIP) Interface-Segregation Principle (ISP) Design Principles: Part 2 ENGI 5895: Software Design Andrew Vardy Faculty of Engineering &

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 10 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2018 Recap Observer Pattern MVC Presentation Layer Example S.O.L.I.D. Simple Responsibility

More information

Clean Architecture Patterns, Practices, and #DevSum17

Clean Architecture Patterns, Practices, and #DevSum17 Clean Architecture Patterns, Practices, and Principles @matthewrenze #DevSum17 About Me Independent consultant Education B.S. in Computer Science (ISU) B.A. in Philosophy (ISU) Community Public Speaker

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Department of Computer Engineering Lecture 12: Object-Oriented Principles Sharif University of Technology 1 Open Closed Principle (OCP) Classes should be open for extension but closed

More information

Produced by. Agile Software Development. Eamonn de Leastar

Produced by. Agile Software Development. Eamonn de Leastar Agile Software Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie SOLID Principles

More information

Want Better Software? TEST it! (and thenwrite it) Tame defects before they appear You Rise/Bugs Fall

Want Better Software? TEST it! (and thenwrite it) Tame defects before they appear You Rise/Bugs Fall Want Better Software? TEST it! (and thenwrite it) Tame defects before they appear You Rise/Bugs Fall Introduction TDD had its origins as an integral part of Extreme Programming TDD, BDD, DDD and the coming

More information

Don Smith, Program Manager Microsoft patterns & practices

Don Smith, Program Manager Microsoft patterns & practices Don Smith, Program Manager Microsoft patterns & practices Agenda The data access layer and your options Patterns for keeping entities consistent Patterns for managing entity differences Data access technology

More information

COURSE 2 DESIGN PATTERNS

COURSE 2 DESIGN PATTERNS COURSE 2 DESIGN PATTERNS CONTENT Fundamental principles of OOP Encapsulation Inheritance Abstractisation Polymorphism [Exception Handling] Fundamental Patterns Inheritance Delegation Interface Abstract

More information

Enterprise Java Development using JPA, Hibernate and Spring. Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009

Enterprise Java Development using JPA, Hibernate and Spring. Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009 Enterprise Java Development using JPA, Hibernate and Spring Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009 About the Speaker Enterprise Architect Writer, Speaker, Editor (InfoQ)

More information

wałdis iljuczonok (aka technical fellow)

wałdis iljuczonok (aka technical fellow) wałdis iljuczonok (aka technical fellow) tech guy at getadigital.com (Microsoft.Net + Episerver) MVP @tech_fellow Dependency Injection in Episerver Why? Definition What is dependency? @tech_fellow public

More information

Agile Software Development

Agile Software Development Agile Software Development Principles, Patterns, and Practices Robert Cecil Martin Alan Apt Series Prentice Hall Pearson Education, Inc. Upper Saddle River, New Jersey 07458 Foreword Preface About the

More information

Architecting ios Project. Massimo Oliviero

Architecting ios Project. Massimo Oliviero Architecting ios Project Massimo Oliviero Massimo Oliviero Freelance Software Developer web http://www.massimooliviero.net email massimo.oliviero@gmail.com slide http://www.slideshare.net/massimooliviero

More information

1: ASP.NET AND JQUERY

1: ASP.NET AND JQUERY INTRODUCTION xxix CHAPTER 1: ASP.NET AND JQUERY 1 Understanding Web Forms 2 View State 3 web.confi g Transformations 4 Simplified web.confi g 5 New ASP.NET Web Forms Templates 5 ASP.NET MVC 8 Versions

More information

Clean Architecture Patterns, Practices, and #sddconf

Clean Architecture Patterns, Practices, and #sddconf Clean Architecture Patterns, Practices, and Principles @matthewrenze #sddconf About Me Independent consultant Education B.S. in Computer Science (ISU) B.A. in Philosophy (ISU) Community Public Speaker

More information

Apex TG India Pvt. Ltd.

Apex TG India Pvt. Ltd. (Core C# Programming Constructs) Introduction of.net Framework 4.5 FEATURES OF DOTNET 4.5 CLR,CLS,CTS, MSIL COMPILER WITH TYPES ASSEMBLY WITH TYPES Basic Concepts DECISION CONSTRUCTS LOOPING SWITCH OPERATOR

More information

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns Last Time: Object Design Comp435 Object-Oriented Design Week 7 Computer Science PSU HBG The main idea RDD: Responsibility-Driven Design Identify responsibilities Assign them to classes and objects Responsibilities

More information

EFFECTIVE C# (COVERS C# 6.0), (INCLUDES CONTENT UPDATE PROGRAM): 50 SPECIFIC WAYS TO IMPROVE YOUR C# (3RD EDITION) (EFFECTIVE SOFTWARE DEV

EFFECTIVE C# (COVERS C# 6.0), (INCLUDES CONTENT UPDATE PROGRAM): 50 SPECIFIC WAYS TO IMPROVE YOUR C# (3RD EDITION) (EFFECTIVE SOFTWARE DEV Read Online and Download Ebook EFFECTIVE C# (COVERS C# 6.0), (INCLUDES CONTENT UPDATE PROGRAM): 50 SPECIFIC WAYS TO IMPROVE YOUR C# (3RD EDITION) (EFFECTIVE SOFTWARE DEV DOWNLOAD EBOOK : EFFECTIVE C# (COVERS

More information