Download presentation
Presentation is loading. Please wait.
1
Tech·Ed North America 2009 11/18/2018 10:26 AM
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
2
Understanding Code Extensibility
Tech·Ed North America 2009 11/18/ :26 AM Understanding Code Extensibility Jason “For The Developers!” Olson © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
4
Deeply saddened by the deaths of her daughter Annie in 1866 and her young husband in 1881, and seeking solace, Winchester consulted a medium on the advice of a psychic. According to popular history, the medium, who has become known colloquially as the "Boston Medium," told Winchester that she believed there to be a curse upon the Winchester family because the guns they made had taken so many lives. The psychic told Winchester that "thousands of people have died because of it and their spirits are now seeking deep vengeance." Although this is disputed, popular belief holds that the Boston Medium told Winchester that she had to leave her home in New Haven and travel West, where she must "build a home for yourself and for the spirits who have fallen from this terrible weapon, too. You must never stop building the house. If you continue building, you will live forever. But if you stop, then you will die too." Under Winchester's day-to-day guidance, its "from-the-ground-up" construction proceeded around-the- clock, without interruption, from 1884 until her death on September 5, 1922, at which time work immediately ceased.[2] The cost for such constant building has been estimated at about US $5.5 million[3] (if paid in 1922, this would be equivalent to almost $70 million in 2008 dollars).[4]
5
What this talk IS… About the importance of Extensibility in software
A guided tour of core object-oriented design principles How to make your code better
6
You might be in the wrong room if...
you know all these terms... Inversion of Control SOLID DIP Open/Closed Composition over Inheritance Single Responsibility Dependency Inversion OCP SRP
7
You might be in the wrong room if...
you know all these terms... you write perfect code...
8
You might be in the wrong room if...
you know all these terms... you write perfect code... you’ve never written a line of code in your life...
9
quiz Spot The Defect, Before! 11/18/2018 10:26 AM
If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Spot The Defect, Before! © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
10
The Problem… Software Maintenance Original Software Development
Nearly 80% of software development costs is in the maintenance of software. Original Software Development
11
S O L I D ingle Responsibility Principle (SRP)
pen/Closed Principle (OCP) iskov Substitution Principle (LSP) nterface Segregation Principle (ISP) ependency Inversion Principle (DIP)
12
Open/Closed Principle (OCP)
Software entities should be open for extension, but closed for modification.
13
Extension via Inheritance
11/18/ :26 AM demo If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Extension via Inheritance © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
14
Composition over Inheritance
15
Single Responsibility Principle (SRP)
A class should have one, and only one, reason to change.
17
Single Responsibility Principle: There can be only one!
11/18/ :26 AM demo If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Single Responsibility Principle: There can be only one! © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
18
Dependency Inversion Principle (DIP)
Depend on abstractions, not concretions.
19
Inversion of Control (IoC)
20
The process of supplying external dependencies
Dependency Injection The process of supplying external dependencies to a software component.
21
Extension via Composition
11/18/ :26 AM demo If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Extension via Composition © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
22
Never worry about constructing
IoC Containers Never worry about constructing an object again...
23
Dependency Injection with Ninject
11/18/ :26 AM demo If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Dependency Injection with Ninject © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
24
The importance of context!
25
Context-Aware Dependencies Dude, Where’s My Car?
11/18/ :26 AM demo If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Context-Aware Dependencies Dude, Where’s My Car? © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
26
Don’t be surprised if you have more classes and interfaces in your code!
27
Opening the flood gates…
New behavior is a snap… Testing code is a joy (oh TDD, how I love thee…) Understanding code is easier…
28
quiz Spot The Defect, After! 11/18/2018 10:26 AM
If you would like to host your demo on the Virtual Server, please use the myVPC demo slide, not this slide. Spot The Defect, After! © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
29
The Problem… Software Maintenance Original Software Development
Nearly 80% of software development costs is in the maintenance of software. Original Software Development
30
Solving The Problem… Original Software Development Software
Maintenance Original Software Development Nearly 80% of software development costs is in the maintenance of software.
31
Resources - Books Clean Code, Robert C. Martin
Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Resources - Books Clean Code, Robert C. Martin Design Patterns, “Gang of Four” Head-First Design Patterns, Freeman/Bates/Sierra Refactoring, Martin Fowler
32
Related Content Breakout Sessions
Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Related Content Breakout Sessions DTL328 – Managed Extensibility Framework WUX314 – SOLIDify Your ASP.NET MVC Apps DPR204 – Lean Practices, Agile Techniques BOF54 – Agile Development w/ Microsoft .NET
33
Complete an evaluation on CommNet and enter to win!
Required Slide Complete an evaluation on CommNet and enter to win!
34
Required Slide 11/18/ :26 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.