Framework Design Guidelines

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    06/05/09 19:20 © 2008 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.

    11 Favorites

    Framework Design Guidelines - Presentation Transcript

    1.  Krzysztof Cwalina Program Manager Microsoft Corporation http://blogs.msdn.com/kcwalina
      •  Brad Abrams
      • Product Unit Manager
      • Microsoft Corporation http://blogs.msdn.com/brada
    2.  
    3. Dow Jones Industrial Average @ 9,000
    4. Dow Jones Industrial Average @ 9,000
    5.  
    6.  
      • Framework Design Artifacts:
      • Properties
      • Methods
      • Events
      • Constructors
    7. public class XmlFile { string filename; Stream data; public XmlFile(string filename) { this.data = DownloadData(filename); } } public XmlFile(string filename) { this.filename = filename; } lazy
    8. public class ArrayList { public int Count {get;} }
    9.  
    10. EmployeeList l = FillList(); for (int i = 0; i < l.Length; i++){ if (l.All[i] == x){...} } if (l.GetAll()[i]== x) {...} public Employee[] All {get{}} public Employee[] GetAll() {} Moral: Use method if the operation is expensive Calling Code
    11.  
    12.  
    13.  
    14.  
    15.  
    16.  
    17.  
    18.  
    19.  
    20.  
    21.  
    22.  
    23. Time to cut…
    24.  
    25.  
    26.  
    27. public class TheBase : Object { public override string ToString() { return “Hello from the Base&quot;; } } public class Derived : TheBase { public override string ToString() { return “Hello from Derived&quot;; } }
    28. Derived d = new Derived(); Console.WriteLine (d.ToString()); TheBase tb = d; Console.WriteLine (tb.ToString()); Object o = tb; Console.WriteLine (o.ToString());
    29.  
      • All Virtual members should define a contract
      • Don’t require clients to have knowledge of your overriding
      • Should you call the base?
    30. Barbara Liskov
    31. public interface IComparable { int CompareTo(object obj); }
    32.  
    33.  
    34. Careful dependency management is the necessary ingredient to successful evolution of frameworks. Without it, frameworks quickly deteriorate and are forced out of relevance prematurely.
    35.  
    36.    BCL WPF XML Reflection
    37.  
    38.  
    39.  
    40.  
    41.  
    42.  
    43.  
    44.  
    45. Climbing a mountain?
    46. Scaling a peak?
    47. Running across a desert?
    48. Falling into a pit?
    49.  
    50.  
    51.  
    52.  
    53.  
    54.  
    55.  
    56.  
    57.  
    58.  
      • Read the manual??
    59.  
    60.  
    61.  
    62.  
    63. The Power of Sameness
      • P ascal C asing – Each word starts with an uppercase letter
      • c amel C asing – First word lower case, others uppercase
      • SCREAMING_CAPS – All upper case with underscores
    64. public class MemberDoc { public int CompareTo(object value) public s tring Name { get;} }
    65. public class CMyClass { int CompareTo (object objValue) {..} string lpstrName {get;} int iValue {get;} }
    66.  
    67.  
    68.  
    69.  
    70.  
    71.  
    72. Brad Abrams http://blogs.msdn.com/brada Krzysztof Cwalina http://blogs.msdn.com/kcwalina Please fill out the session evals!
    73. © 2008 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.

    + bradabrada, 2 years ago

    custom

    5672 views, 11 favs, 9 embeds more stats

    I am very excited to be giving a Framework Design G more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 5672
      • 5592 on SlideShare
      • 80 from embeds
    • Comments 0
    • Favorites 11
    • Downloads 245
    Most viewed embeds
    • 63 views on http://lastmind.net
    • 8 views on http://www.hanrss.com
    • 2 views on http://photoudo.com
    • 2 views on http://djajar.com
    • 1 views on http://www.slideshare.net

    more

    All embeds
    • 63 views on http://lastmind.net
    • 8 views on http://www.hanrss.com
    • 2 views on http://photoudo.com
    • 2 views on http://djajar.com
    • 1 views on http://www.slideshare.net
    • 1 views on http://team.malltb.com
    • 1 views on http://feeds.feedburner.com
    • 1 views on http://www.photoudo.com
    • 1 views on http://static.slideshare.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories