Your SlideShare is downloading. ×
0
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Framework engineering JCO 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Framework engineering JCO 2011

2,962

Published on

JCO 2011 발표 자료용 …

JCO 2011 발표 자료용
- DSM 관련 내용 업데이트
- Code Metrics 관련 내용 업데이트

Published in: Design, Technology, Education
2 Comments
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
2,962
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
57
Comments
2
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Framework EngineeringArchitecting, Designing, and Developing Reusable Libraries <br />http://www.arload.net<br />
  • 2. 손영수 arload@live.com동완이 아빠, 인옥이 남편!!EVA팀 리더PLoP패턴 저자AsianPLoP공동의장Blog http://www.arload.net<br />
  • 3. Framework is ..<br />
  • 4. Framework is…<br />
  • 5. Douglas C. Schmidt Says..<br />Frameworks define “semi-complete” application<br /> that embody domain-specific object structures and functionality.<br />
  • 6. Libraries is..<br />Application Block<br />DATABASE<br />ADTs<br />MATH<br />NETWORKING<br />App Specific<br />Logic<br />OO Design<br />Invocations<br />GRAPHICS<br />GUI<br />Event<br />Loop<br />Singleton<br />Strategy<br />Selections<br />Reactor<br />Adapter<br />State<br />Active Object<br />Design Pattern<br />Class Library <br />Component Architecture<br />
  • 7. But Framework is ..<br />Active Object<br />State<br />NETWORKING<br />GUI<br />Control – Flow (IoC)<br />MATH<br />Reactor<br />Event<br />Loop<br />App Specific<br />Logic<br />Invocations<br />Callbacks<br />ADTs<br />Singleton<br />Adapter<br />DATABASE<br />GRAPHICS<br />Application Framework<br />Component Architecture<br />
  • 8. Why Do You Need Framework?<br />Productivity<br />Avoid Duplication<br />
  • 9. Why Do You Need Framework?<br />De Facto War<br />
  • 10. Welcome to<br />My Framework<br />Journey!<br />
  • 11. Seed References<br />“Framework Engineering”, TechED 2007 Europe<br />“Framework Design Guidelines” , Addison Wesley<br />Krzysztof Cwalina<br />Program Manager on .NET Framework Team<br />
  • 12. 5 Topics..<br />D<br />O<br />P<br />A<br />V<br />
  • 13. OrganizationThe most powerful design tool<br />O<br />
  • 14. Project Management Triangle<br />Scope<br />Time<br />Cost<br />O<br />
  • 15. Organization<br />Project Management Triangle + 1<br />O<br />
  • 16. Do understand how organizational structure, culture, and decision making processes impact your product. <br />O<br />
  • 17. Conway's law<br />If you have 4 groups working on a compiler,<br />you’ll get a 4-pass compiler.<br />O<br />
  • 18. Conway's law<br />O<br />
  • 19. Conway's Clean State Approach<br />O<br />
  • 20. Your Company Culture Is ..<br />Voluntary ??<br />O<br />
  • 21. Your Company Culture Is ..<br />Familial ??<br />O<br />
  • 22. Remember Your Company Culture ..<br />O<br />Peremptory<br />
  • 23. Organizational InfluencesSize of Organization<br />Simple Design<br />Consistency Design<br />Focus on 80/20 Rules<br />Small Team<br />O<br />
  • 24. Organizational InfluencesSize of Organization<br />Powerful Design<br />Lack Consistency<br />Remove Requirements<br />Large Team<br />O<br />
  • 25. Organizational InfluencesOrganization’s Culture/Biases<br />Customer-Focused<br />End-2-End Scenarios<br />O<br />
  • 26. Organizational InfluencesOrganization’s Culture/Biases<br />Technology-Focused<br />Long Lasting Architecture<br />O<br />
  • 27. Decision Making Process is..<br />呼兄呼弟<br />O<br />
  • 28. Solution ??<br />Give this book your boss..<br />
  • 29. Planning Ensuring we are building the right thing <br />P<br />
  • 30. P<br />
  • 31. P<br />
  • 32. Skyscrapers<br />Peanut Butter<br />Focus: features<br />Results: stability, incremental improvements, not great end-to-end scenarios<br />Focus: scenarios <br />Results: Excitement, breakthroughs, but beware of leaving existing customers behind <br />P<br />
  • 33. Moderation (中庸)MileStone = Scenarios + Feature<br />Vision statement<br />RTM<br />Feature complete<br />Release<br />Testing<br />Planning<br />M1<br />M2<br />Technology Preview<br />Beta 1<br />Beta 2<br />RC1<br />P<br />
  • 34. ArchitectureEnsuring the long term health of the framework<br />A<br />
  • 35. Right Way??Choose right types.<br />A<br />
  • 36. Taxonomy of TypesLibraries , Primitives, Abstractions<br />A<br />
  • 37. Primitives<br />Very little policy (behavior design decisions)<br />Stable design<br />Commonly appear in publicly accessible APIs<br />Almost impossible to evolve/change design; <br /> any design changes have huge breaking change impact on other APIs<br />Example: Int32, String<br />A<br />
  • 38. Libraries<br />Definition:<br />Libraries are types that are not passed <br /> between components<br />Examples<br />EventLog, Debug. <br />Easy to Evolve<br />Leave old in, add new one<br />Beware of duplication!<br />A<br />
  • 39. Abstractions<br />Definition:<br />Abstractions are interfaces or classes with unsealed members that are passed between components.<br />Examples<br />Stream, IComponent<br />Hard to Evolve<br />Unfortunately, pressure to evolve<br />A<br />
  • 40. Primitive Oriented Design<br />A.K.A. “Handle based design” (functional)<br />Great evolvability, poor usability (sometimes)<br />Low level stable primitives + high level reusable components with limited dependencies other than to the primitives<br />E.g. Type.GetType(object) – works, but not as convenient as Object.GetType<br />A<br />
  • 41. Extension Method for primitive.. C# 3.0 New Feature<br />namespace MyCompany.StringManipulation { <br /> public static class StringExtensions{<br />public static bool IsNullOrEmpty(this string s){ return String.IsNullOrEmpty(s);<br /> } <br /> }<br />}<br />…<br />using MyCompany.StringManipulation;<br />string message= “hello world”;<br />if(message.IsNullOrEmpty()){ <br /> Console.WriteLine(“EMPTY”);<br />}<br />
  • 42. Component Oriented Design<br />Rich APIs with lots of features, thus with lots of dependencies<br />Great usability, poor evolvability<br />Good for higher level components, not for the core of a platform<br />A<br />
  • 43. Do Manage Dependencies..<br />A<br />A<br />
  • 44. Component is ..<br />Lego, Plug ??<br />A<br />
  • 45. Component is ..<br />.. a set of types that ship and evolve as a unit.<br />A<br />
  • 46. Types of Dependencies<br />A<br />
  • 47. API Dependency<br />Component A has an API dependency on component B, <br /> if a type in B shows in the publicly accessible API surface of a type in A. <br />This includes:<br />Base types and implemented interfaces<br />Generic parameter constraints<br />Return types and parameters of members<br />Applied attributes<br />Nested types<br />A<br />
  • 48. Implemenatin Dependency<br />If a type in A uses a type in B in its implementation.<br />Hard Dependencies (required to run)<br />Soft Dependencies (optional)<br />A<br />
  • 49. Circular Dependency<br />Component A depends on component B and<br />Component B depends on component A (even indirectly).<br />A<br />
  • 50. Solution is Layering..<br />A<br />
  • 51. Solution is Layering..<br />A<br />
  • 52. WPF<br />XML<br /><br /><br /><br />BCL<br />Reflection<br />A<br />Dependency Management<br />
  • 53. 상황을 파악하는 좋은 방법DSM (Dependency Structure Matrix)<br />
  • 54. 간단한 DSM<br />
  • 55. 잘 계층화된 DSM<br />
  • 56. 엄격한 계층화를 유지한 시스템의 DSM<br />
  • 57. 불완전한 계층구조를 가진 시스템<br />Circular Dependency 발생.<br />
  • 58. 또 하나의 도구– Code Metrics<br />
  • 59. xDepend(Ndepend, Xdepend, CDepend)<br />NDepend - http://www.xdepend.com<br />
  • 60. Solution is..<br />Create a new package.<br />A<br />
  • 61. circular dependency<br />GUI<br />Comm<br />Analysis<br />Protocol<br />Modem Control<br />Comm Error<br />Database<br />Message<br />Manager<br />A<br />
  • 62. Indirect circular dependency<br />A<br />X<br />B<br />Y<br />A<br />
  • 63. Use Interface.<br />A<br />X<br />Y<br /><<interface>><br />BY<br />B<br />A<br />
  • 64. Heavy Depedency..<br />A<br />
  • 65. Solution is IoC<br />A<br />
  • 66. Heavy Dependency.<br />// your API<br />public class Tracer {<br />MessageQueue mq = new MessageQueue(…);<br /> public void Trace(string message){ <br />mq.Send(message);<br /> }<br />} <br />// your customer’s program that is hard to test<br />Tracer tracer = new Tracer();<br />public void ProcessOrder(Order order){<br /> tracer.Trace(order.Id);<br /> …<br />}<br />A<br />
  • 67. Inversion of Control<br />// your better API<br />public abstract class TraceListener {<br /> public abstract void Trace(string message);<br />} <br />public class Tracer {<br />TraceListener listener;<br /> public Tracer(TraceListener listener){<br /> this.listener = listener;<br /> }<br /> public void Trace(string message){ <br /> listener.Trace(message);<br /> }<br />} <br />A<br />
  • 68. Dependency Injection<br />// your customer’s program that is easier to test<br />Tracer tracer = new Tracer(new FileListener());<br />public void ProcessOrder(Order order){<br /> tracer.Trace(order.Id);<br /> …<br />}<br />A<br />
  • 69. Dependency Injection Containers<br />// customer’s program that is even easier to test<br />Tracer tracer = container.Resolve<Tracer>();<br />public void ProcessOrder(Order order){<br /> tracer.Trace(order.Id);<br /> …<br />}<br />Check outDI Containers (a.k.a. IoC Containers):autofac, Castle Windsor, PicoContainer.NET, Spring.NET, StructureMap, Unity, nInject and others.<br />http://www.nInject.org<br />A<br />
  • 70. Packaging Principle<br />Package Cohesion Principle<br />REP (Release Reuse Equivalency)<br />CCP (Common Closure Principle)<br />CRP (Common Reuse Principle)<br />Package Coupling Principle<br />ADP (Acyclic Dependencies Principle)<br />SDP (Stable Dependencies Principle)<br />SAP (Stable Abstraction Principle)<br />A<br />Robert C. Martin, Principle of Package Architecture<br />http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf<br />
  • 71. Do balance advances with compatibility.<br />A<br />
  • 72. Types of “Compatibility” <br />Backward<br />Cross-Version<br />Forward<br />A<br />
  • 73. Cross-Redist.<br />A<br />
  • 74. A<br />
  • 75. Establishing Compatibility Bar<br />Define what’s a “breaking change”<br />This definition depends on the objective<br />E.g. Enable portable code between Silverlight and .NET Framework<br />E.g. Enable cross-version portability?<br />A<br />
  • 76. Avoid duplication and overlap.<br />A<br />
  • 77. Team Space<br />Show and Tell<br />Problem Space<br />PLoP – Capable, Productive and Satisfied Patterns for Productivity<br />http://hillside.net/plop/plop98/final_submissions/P54.pdf<br />A<br />
  • 78. When to Replace Existing APIs<br />When the new technology is “10x better”<br />Make sure you understand the impact on the ecosystem<br />What would happen if the BCL team added a new String?<br />What’s the migration path for code using the old API?<br />Support Automatic Migration Tool. <br />(VB -> VB.NET, .NET 1.0 -> .NET 2.0)<br />Provide Code Based Migration Manual. <br />COM+ -> WCF , ASP.NET Web Service -> WCF<br />A<br />
  • 79. DesignThis is where quality happens<br />D<br />
  • 80. Is using your framework correctly like…<br />Running across a desert?<br />D<br />
  • 81. You need Feedback.<br />D<br />
  • 82. Do design APIs by <br /> first writing code samples for the main scenarios <br /> and then <br />defining the object model to support the code samples.<br />D<br />
  • 83. Code Samples<br />D<br />
  • 84. Read File<br />static void Main(string[] args)<br />{<br />StreamReadersr = File.OpenText("MyFile.txt");<br /> string s = sr.ReadLine();<br /> while (s != null)<br />{<br /> s = sr.ReadLine();<br />Console.WriteLine(s);<br />}<br />}<br />D<br />
  • 85. Feedback (Read File)<br />static void Main(string[] args)<br />{<br />foreach (string s in File.ReadAllLines("MyFiles.text"))<br /> {<br />Console.WriteLine(s);<br />}<br />}<br />D<br />
  • 86. Object Model Listing<br />D<br />
  • 87. Framework Design Studio Assembly Exploer<br />Project -> Add -> Assembly<br />D<br />Download here - http://code.msdn.microsoft.com/fds<br />
  • 88. Framework Design Studio Assembly Review Comment<br />D<br />
  • 89. Framework Design StudioCompare API Versions<br />D<br />
  • 90. Framework Design StudioCompare API Versions<br />Red is removed, <br />Green is added,<br />Grey means inherited.<br />D<br />
  • 91. Framework Design StudioExporting to Microsoft Word<br />Tools -> Export to Document<br />D<br />
  • 92. Do treat simplicity as a feature.<br />D<br />
  • 93. KISS (Keep It Simple! Stupid!)<br />Remove Requirements (ATAM).<br />Reuse Existing Concepts or APIs<br />Adjust Abstraction Level <br />Consider framework users(experience, knowledge)<br />Three Example<br />D<br />
  • 94. Domeasure, measure, and measure!<br />D<br />
  • 95. Specification Document: Qualities<br />Performance Goals (XML Parser..)<br />Baseline: What do is the best my API could do?<br />Measure delta from the baseline<br />Threat Models (Security ..)<br />Threat: What is the worst that my component could do?<br />Mitigate the threats<br />Keep a balance between many other qualities you want your framework to have (ATAM)<br />D<br />
  • 96.  The POWER oFSameness<br />D<br />
  • 97. Read the manual??<br />When you pick up your rental car….<br />Push the seat all the way back<br />Find an NPR station<br />Find the exit<br />D<br />
  • 98. Oh, down to lock…<br />D<br />
  • 99. How to use a key…<br />D<br />
  • 100. Oh, you push the PRESS button…<br />D<br />
  • 101. Who actually needs this data?<br />D<br />
  • 102. Why you don’t read manuals ???<br />You know how to drive your car<br />All cars work basically the same way<br />Your rental car is a car<br />Therefore, you can drive your rental car<br />That is…<br />The power of sameness<br />D<br />
  • 103. Static Analysis Tool <br />http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis<br />D<br />
  • 104. DevelopmentThe bits customers get, … or not<br />V<br />
  • 105. Branches and Integrations- Feature Crew<br />http://www.codeplex.com/BranchingGuidance/Wiki/View.aspx?title=Feature%20Crews%3a%20How%20Microsoft%20Does%20It<br />V<br />
  • 106. Avoid integrating unfinished features.<br />V<br />
  • 107. Feature Complete & Quality Gates<br />Functional Specification<br />Developer Design Specification<br />Test Plan<br />Threat Model<br />API review<br />Architectural Review<br />Dependency Management<br />Static Analysis<br />Code Coverage<br />Testing (Unit and Integration Tests)<br />0 Bugs<br />Performance <br />V<br />
  • 108. Do pay your debt.<br />V<br />
  • 109. Milestone Quality<br />Vision statement<br />RTM<br />Feature complete<br />Release<br />Testing<br />Planning<br />M1<br />M2<br />Technology Preview<br />Beta 1<br />Beta 2<br />RC1<br />Milestone Quality<br />V<br />
  • 110. Milestone Quality (MQ)<br />Initiatives that are hard to do in regular milestones<br />Large productivity and efficiency improvements<br />Infrastructure changes<br />For example, a new source control system <br />Refactoring of fragile subsystems<br />Internal implementation documentation<br />Bugs backlog<br />V<br />
  • 111. Summary<br />Dounderstand how organizational structure, culture, and decision making processes impact your product. <br />Avoidpeanut-butter in Scenario Based Application.<br />Domanage your dependencies.<br />Dobalance advances with compatibility.<br />Avoidduplication and overlap.<br />Do design APIs by first writing code samples for the main scenarios and then defining the object model to support the code samples.<br />Do treat simplicity as a feature.<br />Domeasure, measure, and measure!<br />Avoidintegrating unfinished features.<br />Do pay your debt.<br />
  • 112. Resources<br />Krzysztof Cwalina, Brad Abrams<br />Framework Design Guidelines:<br />Conventions, Idioms, and Patterns for Reusable .NET Libraries<br />http://channel9.msdn.com/pdc2008/PC58/<br />http://www.gotdotnet.com/team/fxcop<br />
  • 113. Resources<br />Douglas C. Schmidt (PLoP Editor, POSA 2, 4 Writter)<br />JAWS: An Application Framework for High Performance Web System<br />http://citeseer.ist.psu.edu/81775.html (En)<br />http://www.devpia.com/net2/EvaCast/Lecture/?cu=view&r=11 (Kr)<br />Ralph Johnson (GoF , Design Patterns)<br />Evolving Frameworks<br />http://st-www.cs.uiuc.edu/users/droberts/evolve.html (En)<br />http://arload.wordpress.com/2008/09/15/evolvingframeworks/ (Kr)<br />
  • 114. Resources<br />Robert C. Martin<br />Principles of Package Architecture (Design Principles and Design Patterns)<br />http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf (En) <br />http://www.devpia.com/net2/EvaCast/Lecture/?cu=view&r=108 (Kr)<br />For Korean People..<br />Load to Architect<br />http://www.arload.net<br />EvaCast (Online Free Lecture)<br />http://www.evacast.net<br />
  • 115. 최근 저서 및 곧 나올 저서..<br />
  • 116. 곧 나올 저서..<br />
  • 117. Question?<br />이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-동일조건변경허락 2.0 <br />대한민국 라이센스에 따라 이용하실 수 있습니다. <br />This work is licensed under Creative Commons Korea Attribution 2.0 License.<br />

×