SlideShare a Scribd company logo
1 of 26
Download to read offline
Lego for Engineers
     - How to build Reusable and Maintainable
        Applications in C#
   Theo Jungeblut 10/10/2010




© 2010 Omnicell, Inc.
 © 2010 Omnicell, Inc.
Theo Jungeblut

    • Senior Software Developer at
      Omnicell Inc. in Mountain View
    • Designs and implements .NET based
      applications for more than 6 ½ years

    • Previously was working for 3 ½ years
      in factory automation with focus on
      component based software and
      framework development
    • Degree in Software Engineering and
      Network Communications

                                             theo.jungeblut@gmail.com

2    © 2010 Omnicell, Inc.
Overview
    • Why Lego for Software Engineers?
    • “Keep It Simple Stupid”-Principle (KISS)
       The Power of Simplicity
       Two Ways of doing Something Similar
    • Design Patterns and Principles
    • Dependency Injection Container & more
    • Summary
    • References
    •Q&A

3   © 2010 Omnicell, Inc.
Why Lego for Software Engineers?
    Lego (trademarked in capitals as LEGO) is a line of construction toys manufactured by the Lego Group




                            http://upload.wikimedia.org/wikipedia/commons/7/75/Lego_technic_gears.jpg


4   © 2010 Omnicell, Inc.
KISS-Principle – “Keep It Simple Stupid”
    by Kelly Johnson




                                                            http://blog.makezine.com/intro.jpg




          http://blogs.smarter.com/blogs/Lego%20Brick.jpg



                            “Keep It Simple Stupid” design principal by Kelly Johnson
5   © 2010 Omnicell, Inc.
The Power of Simplicity




                                                           http://www.bitrebels.com/geek/cant-afford-a-car-build-a-lego-one/




http://www.sharenator.com/Lego_Art/05_lego_art-2748.html




                                                                                    http://www.geekalerts.com/lego-iphone/

6   © 2010 Omnicell, Inc.
Different Ways of doing Something Similar




http://www.ericalbrecht.com




                                                            http://www.julianaheng.com/transformers-rotf-bumblebee-
                                                            and-sam-action-figures/




                              http://www.ericalbrecht.com

 7   © 2010 Omnicell, Inc.
Why Reusable Components Rock




http://www.modellversium.de/kit/artikel.php?id=1922   http://www.wilcoxusa.net/mindstorms/images/constru
                                                      ctopedia/cs10-47-parts_identification.jpg

  8   © 2010 Omnicell, Inc.
Why Reusable Components Rock




    http://www.ericalbrecht.com/technic/8020/8020all.jpg



9    © 2010 Omnicell, Inc.
Design Patterns and Principals

                 • Separation of Concerns (SoC)
                 • Single Responsibility Principle (SRP)
                 • Component Oriented Programming (CoP)
                 • Interface / Contract
                 • Don’t Repeat Yourself (DRY)
                 • You Ain't Gonna Need It (YAGNI)
                 • Inversion of Control (IoC)
                     •Constructor Injection
                     •Setter Injection
                     •Interface Injection
                     •Service Locator


10   © 2010 Omnicell, Inc.
Separation of Concerns (SoC)
     probably by Edsger W. Dijkstra in 1974




 • In computer science,
 separation of concerns (SoC) is
 the process of separating a
 computer program into distinct
 features that overlap in
 functionality as little as possible.

 •A concern is any piece of
 interest or focus in a program.
 Typically, concerns are
 synonymous with features or
 behaviors.
 http://en.wikipedia.org/wiki/Separation_of_Concerns


11   © 2010 Omnicell, Inc.
Single Responsibility Principle(SRP)
      by Robert C Martin


     Every object should have a single responsibility, and that
     responsibility should be entirely encapsulated by the class.
      http://en.wikipedia.org/wiki/Single_responsibility_principle


     public class Timer : IDisposable
       {
         public event
     EventHandler<ElapsedEventArgs> Elapsed;

            public int IntervalInMilliseconds { get; set; }

            public bool Enabled { get; }

            public void Start(){…};
            public void Stop(){..};                                  http://www.ericalbrecht.com
        }

12   © 2010 Omnicell, Inc.
Component Oriented Programming (CoP)




        http://upload.wikimedia.org/wikipedia/en/2/25/Component-based_Software_Engineering_(CBSE)_-_example_2.gif




13   © 2010 Omnicell, Inc.
Interfaces / Contracts

         • Decouple Usage and Implementation through introduction of contract
         • Allows to replace implementation without changing the consumer

            public interface ILogger           public class LoggingTest
            {                                    {
              void Log(Message message);           void Test Logging(ILogger logger)
            }                                      {
                                                     logger.Log(new Message(“Hallo”);
                                                   }
                                                 }




14   © 2010 Omnicell, Inc.
Don’t Repeat Yourself (DRY)
         by Andy Hunt and Dave Thomas in their book “The Pragmatic Programmer”

 // Code Copy and Paste Method                                                 // DRY Method
 public Class Person                                                           public Class Person
  {                                                                             {
    public string FirstName { get; set;}                                          public string FirstName { get; set;}
    public string LastName { get; set;}                                           public string LastName { get; set;}

     public Person(Person person)                                                  public Person(Person person)
     {                                                                             {
       this.FirstName = string.IsNullOrEmpty(person.FirstName)                       this.FirstName = person.FirstName.CloneSecured();
                  ? string.Empty : (string) person.FirstName.Clone();                this.LastName = person.LastName.CloneSecured();
                                                                                   }
         this.LastName = string.IsNullOrEmpty(person.LastName)
                   ? string.Empty : (string) person.LastName.Clone();              public object Clone()
     }                                                                             {
                                                                                     return new Person(this);
     public object Clone()                                                         }
     {                                                                         }
       return new Person(this);
     }
 }                                                       public static class StringExtension
                                                          {
                                                            public static string CloneSecured(this string original)
                                                            {
                                                              return string.IsNullOrEmpty(original) ? string.Empty : (string)original.Clone();
                                                            }
                                                         }


15   © 2010 Omnicell, Inc.
You Ain't Gonna Need It (YAGNI)
     by Ron E. Jeffries


     What to avoid:
     • Gold Plating
     • Feature Creep
     • Code Blow

     Because new feature need to be:
     • Implemented
     • Tested
     • Documented
     • Maintained

     Balance concerns
     •Implement only what is required but design as far as needed



16   © 2010 Omnicell, Inc.
Inversion of Control (IoC)
     by Martin Fowler 1994




     http://www.martinfowler.com/articles/injection.html




http://www.codeproject.com/KB/aspnet/IOCDI/ProblemsofIOC.JPG   http://www.codeproject.com/KB/aspnet/IOCDI/IOCframework.JPG


17   © 2010 Omnicell, Inc.
Inversion of Control (IoC) - Constructor Injection
     http://www.martinfowler.com/articles/injection.html




           // UNITY Example
           public class CustomerService
           {
             public CustomerService(LoggingService myServiceInstance)
             {
                // work with the dependent instance
                myServiceInstance.WriteToLog("SomeValue");
             }
           }
            http://msdn.microsoft.com/en-us/library/ff650320.aspx




18   © 2010 Omnicell, Inc.
Inversion of Control (IoC) – Setter (Property) Injection
     http://www.martinfowler.com/articles/injection.html




         // UNITY Example
         public class ProductService
         {
           private SupplierData supplier;

             [Dependency]
             public SupplierData SupplierDetails
             {
               get { return supplier; }
               set { supplier = value; }
             }
         }
        http://msdn.microsoft.com/en-us/library/ff650320.aspx




19   © 2010 Omnicell, Inc.
Inversion of Control (IoC) – Interface Injection
      http://www.martinfowler.com/articles/injection.html



                                                            In this methodology we implement an
                                                            interface from the IOC framework. IOC
                                                            framework will use the interface method to
                                                            inject the object in the main class. You can see
                                                            in figure ‘Interface based DI’ we have
                                                            implemented an interface ‘IAddressDI’ which
                                                            has a ‘setAddress’ method which sets the
                                                            address object. This interface is then
                                                            implemented in the customer class. External
                                                            client / containers can then use the
                                                            ‘setAddress’ method to inject the address
                                                            object in the customer object.
     http://www.codeproject.com/KB/aspnet/IOCDI/InterfacebasedDI.JPG   http://www.codeproject.com/KB/aspnet/IOCDI.aspx




20   © 2010 Omnicell, Inc.
Inversion of Control (IoC) – Service Locator
     http://www.martinfowler.com/articles/injection.htm
     l




// UNITY Example                                          http://www.martinfowler.com/articles/injection.html
IUnityContainer container;                                #UsingAServiceLocator

container = new UnityContainer();

container.RegisterType<IMyDummyService, StupidDummyService>();

IMyDummyService myServiceInstance = container.Resolve<IMyDummyService>();

21   © 2010 Omnicell, Inc.
Inversion of Control - Service Locator vs Dependency Injection
     http://www.martinfowler.com/articles/injection.html#ServiceLocatorVsDependencyInjection




 • Service Locator allows to request explicitly the needed instance/type/service

 • Every user of a service has a dependency to the Service Locator
      • Potential issue if the component need to be provided to 3rd parties.
      • Favorable for closed platforms as the Service Locator allow more control

 • Testing is easier with Dependency Injection than a Service Locator if Service
 provided is not easily substituted

 • In general Service Locator is only the less compelling choice if the code is
 mainly used out of the control of the writer




22   © 2010 Omnicell, Inc.
Dependency Injection Container & more
     • Typically support all types of Inversion of Control mechanisms
            • Constructor Injection
            • Property (Setter) Injection
            • Interface Injection
            • Service Locator

     •.NET based DI-Container
            • Unity
            • Castle Windsor
            • StructureMap
                                            Related Technology:
            • Spring.NET                    • Managed Extensibility Framework (MEF)
            • Autofac                       • Windows Communication Foundation (WCF)
            • Puzzle.Nfactory
            • Ninject
            • PicoContainer.NET
            • and more
23   © 2010 Omnicell, Inc.
Summary

     Improving Reusability and Maintainability through:

     • Simplification and Specialization
       (KISS, SoC, SRP)

     •Decoupling
       (Interface, CoP, IoC or SOA)

     • Avoiding Code Blow (DRY, YAGNI)

     • Testability (all of them!)
                                      http://files.sharenator.com/11_lego_art_Lego_Art-s396x414-2755.jpg


24   © 2010 Omnicell, Inc.
References
     http://en.wikipedia.org/wiki/Keep_it_simple_stupid
     http://picocontainer.org/patterns.html
     http://en.wikipedia.org/wiki/Separation_of_concerns
     http://en.wikipedia.org/wiki/Don't_repeat_yourself
     http://en.wikipedia.org/wiki/You_ain't_gonna_need_it
     http://en.wikipedia.org/wiki/Component-oriented_programming
     http://en.wikipedia.org/wiki/Service-oriented_architecture
     http://www.martinfowler.com/articles/injection.html
     http://www.codeproject.com/KB/aspnet/IOCDI.aspx
     http://msdn.microsoft.com/en-us/magazine/cc163739.aspx
     http://msdn.microsoft.com/en-us/library/ff650320.aspx
     http://msdn.microsoft.com/en-us/library/aa973811.aspx
     http://msdn.microsoft.com/en-us/library/ff647976.aspx
     http://msdn.microsoft.com/en-us/library/cc707845.aspx
     http://msdn.microsoft.com/en-us/library/bb833022.aspx
     http://dotnetslackers.com/articles/net/A-First-Look-at-Unity-2-0.aspx
     http://unity.codeplex.com/
     http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=11

25   © 2010 Omnicell, Inc.
Q&A




     http://www.sharenator.com/Lego_Art/03_lego_art-2746.html



26   © 2010 Omnicell, Inc.

More Related Content

What's hot

Clean Code II - Dependency Injection
Clean Code II - Dependency InjectionClean Code II - Dependency Injection
Clean Code II - Dependency InjectionTheo Jungeblut
 
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampTheo Jungeblut
 
Clean Code I - Best Practices
Clean Code I - Best PracticesClean Code I - Best Practices
Clean Code I - Best PracticesTheo Jungeblut
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
Clean code & design patterns
Clean code & design patternsClean code & design patterns
Clean code & design patternsPascal Larocque
 
OO design principles & heuristics
OO design principles & heuristicsOO design principles & heuristics
OO design principles & heuristicsDhaval Shah
 
Object-oriented design principles
Object-oriented design principlesObject-oriented design principles
Object-oriented design principlesXiaoyan Chen
 
Matteo Vaccari - TDD per Android | Codemotion Milan 2015
Matteo Vaccari - TDD per Android | Codemotion Milan 2015Matteo Vaccari - TDD per Android | Codemotion Milan 2015
Matteo Vaccari - TDD per Android | Codemotion Milan 2015Codemotion
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class designNeetu Mishra
 
Design patterns illustrated 010PHP
Design patterns illustrated 010PHPDesign patterns illustrated 010PHP
Design patterns illustrated 010PHPHerman Peeren
 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for ProgrammersDavid Rodenas
 
From code to pattern, part one
From code to pattern, part oneFrom code to pattern, part one
From code to pattern, part oneBingfeng Zhao
 
Design Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID codeDesign Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID codePaulo Gandra de Sousa
 

What's hot (20)

Clean Code II - Dependency Injection
Clean Code II - Dependency InjectionClean Code II - Dependency Injection
Clean Code II - Dependency Injection
 
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampClean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
Clean Code - Design Patterns and Best Practices at Silicon Valley Code Camp
 
Clean Code 2
Clean Code 2Clean Code 2
Clean Code 2
 
Clean Code I - Best Practices
Clean Code I - Best PracticesClean Code I - Best Practices
Clean Code I - Best Practices
 
Binding android piece by piece
Binding android piece by pieceBinding android piece by piece
Binding android piece by piece
 
SOLID design principles applied in Java
SOLID design principles applied in JavaSOLID design principles applied in Java
SOLID design principles applied in Java
 
Clean code
Clean codeClean code
Clean code
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Exploring lambdas and invokedynamic for embedded systems
Exploring lambdas and invokedynamic for embedded systemsExploring lambdas and invokedynamic for embedded systems
Exploring lambdas and invokedynamic for embedded systems
 
Clean code & design patterns
Clean code & design patternsClean code & design patterns
Clean code & design patterns
 
OO design principles & heuristics
OO design principles & heuristicsOO design principles & heuristics
OO design principles & heuristics
 
Object-oriented design principles
Object-oriented design principlesObject-oriented design principles
Object-oriented design principles
 
Matteo Vaccari - TDD per Android | Codemotion Milan 2015
Matteo Vaccari - TDD per Android | Codemotion Milan 2015Matteo Vaccari - TDD per Android | Codemotion Milan 2015
Matteo Vaccari - TDD per Android | Codemotion Milan 2015
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class design
 
SOLID principles
SOLID principlesSOLID principles
SOLID principles
 
Design patterns illustrated 010PHP
Design patterns illustrated 010PHPDesign patterns illustrated 010PHP
Design patterns illustrated 010PHP
 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for Programmers
 
From code to pattern, part one
From code to pattern, part oneFrom code to pattern, part one
From code to pattern, part one
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
 
Design Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID codeDesign Patterns: From STUPID to SOLID code
Design Patterns: From STUPID to SOLID code
 

Similar to Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)

Dependency Injection and Autofac
Dependency Injection and AutofacDependency Injection and Autofac
Dependency Injection and Autofacmeghantaylor
 
Chegg - iOS @ Scale
Chegg - iOS @ ScaleChegg - iOS @ Scale
Chegg - iOS @ ScaleAviel Lazar
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit TestingJames Phillips
 
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampCut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampTheo Jungeblut
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckTheo Jungeblut
 
JPA - Java Persistence API
JPA - Java Persistence APIJPA - Java Persistence API
JPA - Java Persistence APIThomas Wöhlke
 
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...jaxLondonConference
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
 
Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Jim Driscoll
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Theo Jungeblut
 
Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Ismar Silveira
 
Object Oriented Programming With Real-World Scenario
Object Oriented Programming With Real-World ScenarioObject Oriented Programming With Real-World Scenario
Object Oriented Programming With Real-World ScenarioDurgesh Singh
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC PrinciplesPavlo Hodysh
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignJames Phillips
 
C# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesC# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesSami Mut
 

Similar to Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10) (20)

Dependency Injection and Autofac
Dependency Injection and AutofacDependency Injection and Autofac
Dependency Injection and Autofac
 
Mock your way with Mockito
Mock your way with MockitoMock your way with Mockito
Mock your way with Mockito
 
Robotium Tutorial
Robotium TutorialRobotium Tutorial
Robotium Tutorial
 
Chegg - iOS @ Scale
Chegg - iOS @ ScaleChegg - iOS @ Scale
Chegg - iOS @ Scale
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit Testing
 
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code CampCut your Dependencies - Dependency Injection at Silicon Valley Code Camp
Cut your Dependencies - Dependency Injection at Silicon Valley Code Camp
 
Oops
OopsOops
Oops
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
 
JPA - Java Persistence API
JPA - Java Persistence APIJPA - Java Persistence API
JPA - Java Persistence API
 
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
Java EE 7 Platform: Boosting Productivity and Embracing HTML5 - Arun Gupta (R...
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5
 
Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)Groovy DSLs (JavaOne Presentation)
Groovy DSLs (JavaOne Presentation)
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
 
Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9
 
E:\Plp 2009 2\Plp 9
E:\Plp 2009 2\Plp 9E:\Plp 2009 2\Plp 9
E:\Plp 2009 2\Plp 9
 
Object Oriented Programming With Real-World Scenario
Object Oriented Programming With Real-World ScenarioObject Oriented Programming With Real-World Scenario
Object Oriented Programming With Real-World Scenario
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC Principles
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
C# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slidesC# Tutorial MSM_Murach chapter-15-slides
C# Tutorial MSM_Murach chapter-15-slides
 

More from Theo Jungeblut

Accidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersAccidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersTheo Jungeblut
 
Clean Code III - Software Craftsmanship
Clean Code III - Software CraftsmanshipClean Code III - Software Craftsmanship
Clean Code III - Software CraftsmanshipTheo Jungeblut
 
Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Theo Jungeblut
 
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Theo Jungeblut
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Theo Jungeblut
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Theo Jungeblut
 
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Theo Jungeblut
 
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Theo Jungeblut
 
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Theo Jungeblut
 

More from Theo Jungeblut (9)

Accidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering ManagersAccidentally Manager – A Survival Guide for First-Time Engineering Managers
Accidentally Manager – A Survival Guide for First-Time Engineering Managers
 
Clean Code III - Software Craftsmanship
Clean Code III - Software CraftsmanshipClean Code III - Software Craftsmanship
Clean Code III - Software Craftsmanship
 
Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -Clean Code Part i - Design Patterns and Best Practices -
Clean Code Part i - Design Patterns and Best Practices -
 
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
Cut your Dependencies with - Dependency Injection for South Bay.NET User Grou...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
Clean Code III - Software Craftsmanship at SoCal Code Camp San Diego (07/27/2...
 
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
Clean Code II - Dependency Injection at SoCal Code Camp San Diego (07/27/2013)
 
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
Clean Code I - Design Patterns and Best Practices at SoCal Code Camp San Dieg...
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)

  • 1. Lego for Engineers - How to build Reusable and Maintainable Applications in C# Theo Jungeblut 10/10/2010 © 2010 Omnicell, Inc. © 2010 Omnicell, Inc.
  • 2. Theo Jungeblut • Senior Software Developer at Omnicell Inc. in Mountain View • Designs and implements .NET based applications for more than 6 ½ years • Previously was working for 3 ½ years in factory automation with focus on component based software and framework development • Degree in Software Engineering and Network Communications theo.jungeblut@gmail.com 2 © 2010 Omnicell, Inc.
  • 3. Overview • Why Lego for Software Engineers? • “Keep It Simple Stupid”-Principle (KISS)  The Power of Simplicity  Two Ways of doing Something Similar • Design Patterns and Principles • Dependency Injection Container & more • Summary • References •Q&A 3 © 2010 Omnicell, Inc.
  • 4. Why Lego for Software Engineers? Lego (trademarked in capitals as LEGO) is a line of construction toys manufactured by the Lego Group http://upload.wikimedia.org/wikipedia/commons/7/75/Lego_technic_gears.jpg 4 © 2010 Omnicell, Inc.
  • 5. KISS-Principle – “Keep It Simple Stupid” by Kelly Johnson http://blog.makezine.com/intro.jpg http://blogs.smarter.com/blogs/Lego%20Brick.jpg “Keep It Simple Stupid” design principal by Kelly Johnson 5 © 2010 Omnicell, Inc.
  • 6. The Power of Simplicity http://www.bitrebels.com/geek/cant-afford-a-car-build-a-lego-one/ http://www.sharenator.com/Lego_Art/05_lego_art-2748.html http://www.geekalerts.com/lego-iphone/ 6 © 2010 Omnicell, Inc.
  • 7. Different Ways of doing Something Similar http://www.ericalbrecht.com http://www.julianaheng.com/transformers-rotf-bumblebee- and-sam-action-figures/ http://www.ericalbrecht.com 7 © 2010 Omnicell, Inc.
  • 8. Why Reusable Components Rock http://www.modellversium.de/kit/artikel.php?id=1922 http://www.wilcoxusa.net/mindstorms/images/constru ctopedia/cs10-47-parts_identification.jpg 8 © 2010 Omnicell, Inc.
  • 9. Why Reusable Components Rock http://www.ericalbrecht.com/technic/8020/8020all.jpg 9 © 2010 Omnicell, Inc.
  • 10. Design Patterns and Principals • Separation of Concerns (SoC) • Single Responsibility Principle (SRP) • Component Oriented Programming (CoP) • Interface / Contract • Don’t Repeat Yourself (DRY) • You Ain't Gonna Need It (YAGNI) • Inversion of Control (IoC) •Constructor Injection •Setter Injection •Interface Injection •Service Locator 10 © 2010 Omnicell, Inc.
  • 11. Separation of Concerns (SoC) probably by Edsger W. Dijkstra in 1974 • In computer science, separation of concerns (SoC) is the process of separating a computer program into distinct features that overlap in functionality as little as possible. •A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors. http://en.wikipedia.org/wiki/Separation_of_Concerns 11 © 2010 Omnicell, Inc.
  • 12. Single Responsibility Principle(SRP) by Robert C Martin Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. http://en.wikipedia.org/wiki/Single_responsibility_principle public class Timer : IDisposable { public event EventHandler<ElapsedEventArgs> Elapsed; public int IntervalInMilliseconds { get; set; } public bool Enabled { get; } public void Start(){…}; public void Stop(){..}; http://www.ericalbrecht.com } 12 © 2010 Omnicell, Inc.
  • 13. Component Oriented Programming (CoP) http://upload.wikimedia.org/wikipedia/en/2/25/Component-based_Software_Engineering_(CBSE)_-_example_2.gif 13 © 2010 Omnicell, Inc.
  • 14. Interfaces / Contracts • Decouple Usage and Implementation through introduction of contract • Allows to replace implementation without changing the consumer public interface ILogger public class LoggingTest { { void Log(Message message); void Test Logging(ILogger logger) } { logger.Log(new Message(“Hallo”); } } 14 © 2010 Omnicell, Inc.
  • 15. Don’t Repeat Yourself (DRY) by Andy Hunt and Dave Thomas in their book “The Pragmatic Programmer” // Code Copy and Paste Method // DRY Method public Class Person public Class Person { { public string FirstName { get; set;} public string FirstName { get; set;} public string LastName { get; set;} public string LastName { get; set;} public Person(Person person) public Person(Person person) { { this.FirstName = string.IsNullOrEmpty(person.FirstName) this.FirstName = person.FirstName.CloneSecured(); ? string.Empty : (string) person.FirstName.Clone(); this.LastName = person.LastName.CloneSecured(); } this.LastName = string.IsNullOrEmpty(person.LastName) ? string.Empty : (string) person.LastName.Clone(); public object Clone() } { return new Person(this); public object Clone() } { } return new Person(this); } } public static class StringExtension { public static string CloneSecured(this string original) { return string.IsNullOrEmpty(original) ? string.Empty : (string)original.Clone(); } } 15 © 2010 Omnicell, Inc.
  • 16. You Ain't Gonna Need It (YAGNI) by Ron E. Jeffries What to avoid: • Gold Plating • Feature Creep • Code Blow Because new feature need to be: • Implemented • Tested • Documented • Maintained Balance concerns •Implement only what is required but design as far as needed 16 © 2010 Omnicell, Inc.
  • 17. Inversion of Control (IoC) by Martin Fowler 1994 http://www.martinfowler.com/articles/injection.html http://www.codeproject.com/KB/aspnet/IOCDI/ProblemsofIOC.JPG http://www.codeproject.com/KB/aspnet/IOCDI/IOCframework.JPG 17 © 2010 Omnicell, Inc.
  • 18. Inversion of Control (IoC) - Constructor Injection http://www.martinfowler.com/articles/injection.html // UNITY Example public class CustomerService { public CustomerService(LoggingService myServiceInstance) { // work with the dependent instance myServiceInstance.WriteToLog("SomeValue"); } } http://msdn.microsoft.com/en-us/library/ff650320.aspx 18 © 2010 Omnicell, Inc.
  • 19. Inversion of Control (IoC) – Setter (Property) Injection http://www.martinfowler.com/articles/injection.html // UNITY Example public class ProductService { private SupplierData supplier; [Dependency] public SupplierData SupplierDetails { get { return supplier; } set { supplier = value; } } } http://msdn.microsoft.com/en-us/library/ff650320.aspx 19 © 2010 Omnicell, Inc.
  • 20. Inversion of Control (IoC) – Interface Injection http://www.martinfowler.com/articles/injection.html In this methodology we implement an interface from the IOC framework. IOC framework will use the interface method to inject the object in the main class. You can see in figure ‘Interface based DI’ we have implemented an interface ‘IAddressDI’ which has a ‘setAddress’ method which sets the address object. This interface is then implemented in the customer class. External client / containers can then use the ‘setAddress’ method to inject the address object in the customer object. http://www.codeproject.com/KB/aspnet/IOCDI/InterfacebasedDI.JPG http://www.codeproject.com/KB/aspnet/IOCDI.aspx 20 © 2010 Omnicell, Inc.
  • 21. Inversion of Control (IoC) – Service Locator http://www.martinfowler.com/articles/injection.htm l // UNITY Example http://www.martinfowler.com/articles/injection.html IUnityContainer container; #UsingAServiceLocator container = new UnityContainer(); container.RegisterType<IMyDummyService, StupidDummyService>(); IMyDummyService myServiceInstance = container.Resolve<IMyDummyService>(); 21 © 2010 Omnicell, Inc.
  • 22. Inversion of Control - Service Locator vs Dependency Injection http://www.martinfowler.com/articles/injection.html#ServiceLocatorVsDependencyInjection • Service Locator allows to request explicitly the needed instance/type/service • Every user of a service has a dependency to the Service Locator • Potential issue if the component need to be provided to 3rd parties. • Favorable for closed platforms as the Service Locator allow more control • Testing is easier with Dependency Injection than a Service Locator if Service provided is not easily substituted • In general Service Locator is only the less compelling choice if the code is mainly used out of the control of the writer 22 © 2010 Omnicell, Inc.
  • 23. Dependency Injection Container & more • Typically support all types of Inversion of Control mechanisms • Constructor Injection • Property (Setter) Injection • Interface Injection • Service Locator •.NET based DI-Container • Unity • Castle Windsor • StructureMap Related Technology: • Spring.NET • Managed Extensibility Framework (MEF) • Autofac • Windows Communication Foundation (WCF) • Puzzle.Nfactory • Ninject • PicoContainer.NET • and more 23 © 2010 Omnicell, Inc.
  • 24. Summary Improving Reusability and Maintainability through: • Simplification and Specialization (KISS, SoC, SRP) •Decoupling (Interface, CoP, IoC or SOA) • Avoiding Code Blow (DRY, YAGNI) • Testability (all of them!) http://files.sharenator.com/11_lego_art_Lego_Art-s396x414-2755.jpg 24 © 2010 Omnicell, Inc.
  • 25. References http://en.wikipedia.org/wiki/Keep_it_simple_stupid http://picocontainer.org/patterns.html http://en.wikipedia.org/wiki/Separation_of_concerns http://en.wikipedia.org/wiki/Don't_repeat_yourself http://en.wikipedia.org/wiki/You_ain't_gonna_need_it http://en.wikipedia.org/wiki/Component-oriented_programming http://en.wikipedia.org/wiki/Service-oriented_architecture http://www.martinfowler.com/articles/injection.html http://www.codeproject.com/KB/aspnet/IOCDI.aspx http://msdn.microsoft.com/en-us/magazine/cc163739.aspx http://msdn.microsoft.com/en-us/library/ff650320.aspx http://msdn.microsoft.com/en-us/library/aa973811.aspx http://msdn.microsoft.com/en-us/library/ff647976.aspx http://msdn.microsoft.com/en-us/library/cc707845.aspx http://msdn.microsoft.com/en-us/library/bb833022.aspx http://dotnetslackers.com/articles/net/A-First-Look-at-Unity-2-0.aspx http://unity.codeplex.com/ http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=11 25 © 2010 Omnicell, Inc.
  • 26. Q&A http://www.sharenator.com/Lego_Art/03_lego_art-2746.html 26 © 2010 Omnicell, Inc.