Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.

Slides:



Advertisements
Similar presentations
Welcome to CODE SPREAD Simple Concepts of Coding | Programming.
Advertisements

Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
Spring, Hibernate and Web Services 13 th September 2014.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
The course builder architecture & project planning presented by: Bahareh Agha Jafari.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Creational Patterns Making Objects The Smart Way Brent Ramerth Abstract Factory, Builder.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
Design Patterns.
Presenter - Donn Felker.  Senior Consultant for Microsoft Gold Certified Partner- Statêra.  8 years of experience in developing and architecting enterprise.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
Case Studies on Design Patterns Design Refinements Examples.
Abstract Factory Design Pattern making abstract things.
DaveAndAl.net Do Application Design Patterns Make Sense in ASP.NET? Alex Homer You may like to write these down now...
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Inversion Of Control & Dependency Injection Break Apart The Dependencies Oren Eini Senior Developer We! Consulting Group
Introduction to Web Dimitar Nenchev Ivan Nakov
Castle Manoj Waikar Pune, India.. Introduction Castle aspires to simplify the development of enterprise and web applications. It offers a set of tools.
CS 210 Adapter Pattern October 19 th, Adapters in real life Page 236 – Head First Design Patterns.
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
Using Mock Objects with Test Driven Development Justin Kohlhepp
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Refactoring & Testability. Testing in OOP programming No life in flexible methodologies and for refactoring- infected developers without SOME kind of.
Introducing Allors Applications, Tools & Platform.
Design Pattern. Definition: A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
Design for testability as a way to good coding Simone Chiaretta Architect, Council of the EU December 9 th,
Java EE - Dependency Injection -
Advanced Object-oriented Design Patterns Creational Design Patterns.
Secrets of an Umbraco Ninja Presented by : Aaron powell.com.
2006/2007 Licence Apache 2.0 Castle.Igloo. Castle Igloo Basics Pre-require Concept Scopes PageFlow Configuration Controller View Exemple Castle.Igloo.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
#SPSSAN June 30, 2012 San Diego Convention Center WRITING TESTABLE CODE In SharePoint.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
L’origine dei mali: le dipendenze tra componenti Stefano Leli 14° Workshop DotNetMarche Venerdì 16 aprile
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
Understanding Dependency Injection… and those pesky containers Miguel A. Castro Architect -
Introduction to Inversion Of Control (IOC). IOC Definition (based on Wikipedia)  Consider the way in which an object obtains references to its dependencies.
Design Patterns: MORE Examples
MPCS – Advanced java Programming
Mark Seemann - Dependency Injection in .NET
Factory Patterns 1.
Behavioral Design Patterns
Managed Extensibility Framework
object oriented Principles of software design
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Intro to Spring CJUG - January 2013.
Software Re-engineering - Theoretical and Practical Approaches
C# Object Oriented Programming Concepts
AVG 24th 2015 ADVANCED c# - part 1.
Present by Andie Saizan, MCP
Patterns.
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
MORE ON ARCHITECTURES The main reasons for using an architecture are maintainability and performance. We want to structure the software into reasonably.
Leveraging ColdSpring To Make Better Applications
Designing For Testability
European conference.
Dependency Inversion principle
FRAMEWORKS AND REUSE What is “Framework”?
Dependency Injection Mechanism
Concepts in ASP.NET Core App
Presentation transcript:

Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com

What am I going to talk about? The problem: Application Architecture. What is Inversion of Control? Inversion of Control Containers. A Real Application: Suteki Shop.

Comonent size vs. complexity is not linear Complexity Features

Break large pieces into smaller pieces

The goal of good architecture Don’t repeat yourself (DRY) Decreased coupling Separation of concerns Reduced cost of change Greater flexibility Do more for less ££££

What is a component Wikipedia says: Multiple use Non context specific Composable with other components Encapsulated A unit of independent deployment and versioning

What is inversion of control? A way of designing reusable components A way of decoupling services A design pattern not a framework ‘Inject’ dependencies through constructor or parameters (Dependency Injection) It’s easy!

Show me the code

Problems with typical coding techniques Difficult or impossible to test Tightly coupled Violates the single responsibility principle Violates the open closed principle

Vocabulary Service = Interface (I Sender) Component = Class ( Sender) BUT Not all classes are components

IoC design style Systems are composed of small specialised services – Represented by interfaces Components declare – The services they provide (by implementation) – The services they require (by DI) Components do not dictate their own lifestyle – Do not implement singleton yourself Let TDD drive your design

What is an IoC container? A (very) smart factory Automatically resolves dependencies Automatically injects concrete instances All services are registered in the container Single point of access for services Transparent Various implementations for.NET

Castle MicroKernel / Windsor Part of the Castle Project castleproject.org Started by Hamilton Verissimo Also includes: – MonoRail MVC framework for ASP.NET – ActiveRecord based on NHibernate

IoC container example

How dependencies are resolved

Flexibility

Lifestyles Singleton (the default) Transient Per Thread Pooled Per Web Request Custom

A Real Application

Pros? Simpler component architecture Reduced cost of change Easy to unit test Easily move between application configurations Ready made configuration (IoC containers)

Cons? Not another thing to learn? Higher level of abstraction Performance? Lifestyle mistakes can be hard to diagnose Can’t do obfuscation and configuration Maybe it’s time we looked at dynamically typed languages?

Should I use it? Already familiar with OO principles and patterns? Already writing unit tests? Using a statically typed language? If not, learn how to do these first Don’t impose an IoC container on a team which can’t see its benefit

Resources Castle Project castleproject.org Oren Einiayende.com/blog Alex Hendersonbittercoder.com ALT NET

Questions? Mike Hadlow mikehadlow.blogspot.com