SlideShare a Scribd company logo
StructureMapping
               Your Way to
      Better Software
        Matt Honeycutt
        @matthoneycutt
     http://trycatchfail.com
The Plan



  Better    StructureMap   StructureMap   Advanced
software?       Basics        in Action    Recipes
SOLID Principles

Single Responsibility

Open-Closed

Liskov Substitution

Interface Segregation

Dependency Inversion
SOLID
Why Use StructureMap?

           • Achieve loose coupling
           • Extensibility everywhere
Design     • Improve testability
           • SOLID!



           • Mature: one of the oldest containers
           • One of the fastest IoC containers
Features   • Easy to learn Domain Specific Language
           • Fully-loaded
Code!
Everyone Loves WebForms!
Structure mapping your way to better software
Service Locator

 Design pattern which encapsulates the
processes involved in obtaining a service.

      Requester                  Service Locator

                          Based on configuration, builds
 Asks the locator for a   up and returns the requested
  particular service.               service.
Model-View-Presenter
 MVP is a user interface design pattern engineered to
   improve the separation of concerns within an
           application’s presentation layer.

    Model               View             Presenter

  Object that      Interface that     Acts upon the
defines the data displays the data. model, tells the
to be displayed.                    view what to do.
ASP.NET MVC DependencyResolver
                http://mysite/Home/Index


                   Hey, give me the
                   HomeController!



  ASP.NET MVC
    Pipeline                               DependencyResolver




                      Here ya go!
                                             Activator.CreateInstance(
                                             typeof(HomeController));
ASP.NET MVC DependencyResolver

                Hey, give me the
                HomeController!



  ASP.NET MVC
    Pipeline                       SmDependencyResolver




                  Here ya go!
                                      Container.GetInstance(
                                     typeof(HomeController));
Decorator Pattern
  Design pattern that allows behavior to
    be added to an object at runtime.
  Service Interface     Decorated Type       Decorator

 Defines the public                       Wraps an instance
contract for the type
                        Base type that      of the service
  being extended.       implements in      interface to add
                         the interface.     new behavior.
Decorator Pattern

     SomeOtherDecorator
     : IProductRepository

   ProductLoggingDecorator
     : IProductRepository


  InMemoryProductRepository
     : IProductRepository
Think compositionally!
“Favor composition over inheritance!”
We’ve only just begun!
To Recap

IoC rocks. Use it. Embrace it!

There’s a learning curve… but it’s worth it!

Makes it easier to create SOLID code.

Do it all with StructureMap!
Want to know more?



http://trycatchFAIL.com     @matthoneycutt
   Blog, Videos, and      I might say something
         More!            interesting some day…

More Related Content

PPTX
BDOTNET AngularJs Directives - Uday
PPTX
Angularjs basic part01
PPTX
AngularJS - Architecture decisions in a large project 
PDF
Project development - preparing hell dish together – Oleksii Dashkevych
PDF
PLAT-9 Actions & Behaviors
PDF
Intro to Sails.js
PPTX
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
PPT
Integration and Acceptance Testing
BDOTNET AngularJs Directives - Uday
Angularjs basic part01
AngularJS - Architecture decisions in a large project 
Project development - preparing hell dish together – Oleksii Dashkevych
PLAT-9 Actions & Behaviors
Intro to Sails.js
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Integration and Acceptance Testing

What's hot (20)

PPTX
Angular js for beginners
PDF
AngularJS 101 - Everything you need to know to get started
PDF
AngularJS Best Practices
PDF
AngularJS with RequireJS
PDF
Frontend Application Architecture, Patterns, and Workflows
PPTX
Introduction to Angular js 2.0
PDF
Node PDX: Intro to Sails.js
PPTX
Angular js tutorial slides
PPTX
Why angular js Framework
PPTX
Introduction to Angular JS
PPT
Getting started with angular js
PPTX
AngularJS is awesome
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
PPTX
Angular 2 + TypeScript = true. Let's Play!
PPTX
Web designing avdhesh
PPTX
AngularJS - The Next Big Thing?
PPTX
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
PDF
AngularJS Basics and Best Practices - CC FE &UX
PPTX
Introduction to single page application with angular js
PDF
JSConf US 2014: Building Isomorphic Apps
Angular js for beginners
AngularJS 101 - Everything you need to know to get started
AngularJS Best Practices
AngularJS with RequireJS
Frontend Application Architecture, Patterns, and Workflows
Introduction to Angular js 2.0
Node PDX: Intro to Sails.js
Angular js tutorial slides
Why angular js Framework
Introduction to Angular JS
Getting started with angular js
AngularJS is awesome
AngularJS - What is it & Why is it awesome ? (with demos)
Angular 2 + TypeScript = true. Let's Play!
Web designing avdhesh
AngularJS - The Next Big Thing?
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
AngularJS Basics and Best Practices - CC FE &UX
Introduction to single page application with angular js
JSConf US 2014: Building Isomorphic Apps
Ad

Similar to Structure mapping your way to better software (20)

PPTX
Common ASP.NET Design Patterns - Telerik India DevCon 2013
PPTX
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
PPTX
Dependency injection
PPTX
Most Useful Design Patterns
PPTX
Clean Code Part II - Dependency Injection at SoCal Code Camp
PPTX
Application Architecture April 2014
PPTX
Application Architecture
PPS
Design Patterns For 70% Of Programmers In The World
PPTX
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
PPTX
GoF Design patterns I: Introduction + Structural Patterns
PPTX
Inversion of Control and Dependency Injection
PPTX
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
PPTX
ASP.NET MVC as the next step in web development
PPTX
Gof design patterns
PPTX
Mvc summary
PPT
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
PPTX
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
PPT
5 Design Patterns Explained
PDF
Smart Client Development
PDF
Design patterns illustrated-2015-03
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Dependency injection
Most Useful Design Patterns
Clean Code Part II - Dependency Injection at SoCal Code Camp
Application Architecture April 2014
Application Architecture
Design Patterns For 70% Of Programmers In The World
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
GoF Design patterns I: Introduction + Structural Patterns
Inversion of Control and Dependency Injection
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
ASP.NET MVC as the next step in web development
Gof design patterns
Mvc summary
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
5 Design Patterns Explained
Smart Client Development
Design patterns illustrated-2015-03
Ad

Recently uploaded (20)

PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
REPORT: Heating appliances market in Poland 2024
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
CroxyProxy Instagram Access id login.pptx
PDF
DevOps & Developer Experience Summer BBQ
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
PPTX
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
PDF
Software Development Methodologies in 2025
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
PDF
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
PPTX
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx
Smarter Business Operations Powered by IoT Remote Monitoring
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
REPORT: Heating appliances market in Poland 2024
Top Generative AI Tools for Patent Drafting in 2025.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
CroxyProxy Instagram Access id login.pptx
DevOps & Developer Experience Summer BBQ
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Automating ArcGIS Content Discovery with FME: A Real World Use Case
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
Software Development Methodologies in 2025
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
agentic-ai-and-the-future-of-autonomous-systems.pdf
NewMind AI Monthly Chronicles - July 2025
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx

Structure mapping your way to better software

  • 1. StructureMapping Your Way to Better Software Matt Honeycutt @matthoneycutt http://trycatchfail.com
  • 2. The Plan Better StructureMap StructureMap Advanced software? Basics in Action Recipes
  • 3. SOLID Principles Single Responsibility Open-Closed Liskov Substitution Interface Segregation Dependency Inversion
  • 5. Why Use StructureMap? • Achieve loose coupling • Extensibility everywhere Design • Improve testability • SOLID! • Mature: one of the oldest containers • One of the fastest IoC containers Features • Easy to learn Domain Specific Language • Fully-loaded
  • 9. Service Locator Design pattern which encapsulates the processes involved in obtaining a service. Requester Service Locator Based on configuration, builds Asks the locator for a up and returns the requested particular service. service.
  • 10. Model-View-Presenter MVP is a user interface design pattern engineered to improve the separation of concerns within an application’s presentation layer. Model View Presenter Object that Interface that Acts upon the defines the data displays the data. model, tells the to be displayed. view what to do.
  • 11. ASP.NET MVC DependencyResolver http://mysite/Home/Index Hey, give me the HomeController! ASP.NET MVC Pipeline DependencyResolver Here ya go! Activator.CreateInstance( typeof(HomeController));
  • 12. ASP.NET MVC DependencyResolver Hey, give me the HomeController! ASP.NET MVC Pipeline SmDependencyResolver Here ya go! Container.GetInstance( typeof(HomeController));
  • 13. Decorator Pattern Design pattern that allows behavior to be added to an object at runtime. Service Interface Decorated Type Decorator Defines the public Wraps an instance contract for the type Base type that of the service being extended. implements in interface to add the interface. new behavior.
  • 14. Decorator Pattern SomeOtherDecorator : IProductRepository ProductLoggingDecorator : IProductRepository InMemoryProductRepository : IProductRepository
  • 17. To Recap IoC rocks. Use it. Embrace it! There’s a learning curve… but it’s worth it! Makes it easier to create SOLID code. Do it all with StructureMap!
  • 18. Want to know more? http://trycatchFAIL.com @matthoneycutt Blog, Videos, and I might say something More! interesting some day…

Editor's Notes