Krzysztof Cwalina

Designing Reusable Frameworks

Blog - About

About Krzysztof Cwalina

Krzysztof Cwalina is a Principal Architect on the .NET Framework team at Microsoft. He started his career at Microsoft designing APIs for the first release of the Framework. Currently, he is leading the effort to develop, promote, and apply the design guidelines to the .NET Framework. He is a coauthor of Framework Design Guidelines (Addison-Wesley, 2005). Reach him at his blog at blogs.msdn.com/kcwalina.

  • Krzysztof Cwalina

    Disposable Collection

    • 12 Comments
    Somebody asked me today, if we have a collection that is disposable and calls dispose on all its items when the collections.Dispose method is called. You can implement such collection by inheriting from List<T> and adding Dispose logic. If you add...
  • Krzysztof Cwalina

    Krzysztof’s Laws of API Design

    • 10 Comments
    I always thought about writing down the laws of APIs design. By "laws", I mean principles that don’t seem to change based on the particular scenario at hand, whether the API is low of high level, etc. Here is my first try. I would appreciate any comments....
  • Krzysztof Cwalina

    I don’t like the “Base” suffix

    • 6 Comments
    Today, I was reviewing a set of recommendation for naming types intended to be inherited from. The author suggested using the “Base” suffix for such types. I personally don’t like to do this. Here are the reasons: First, what do you call base of a...
  • Krzysztof Cwalina

    Channel 9 video showing a real usability study

    • 1 Comments
    Channel 9 just posted a video in which our API usability engineers talk about one of the studies they conducted recently, but what’s even more interesting, in part two of the story, they show a clip from an actual study where a participant writes a workflow...
  • Krzysztof Cwalina

    Immutable Collections

    • 4 Comments
    I just saw an interesting post that talks about a general pattern of immutable reference types. Good read. I highly recommend it! At the end of the post the author suggests that we add “value object” generic collection to the BCL. It’s an interesting...
  • Krzysztof Cwalina

    Why Do We Have EventArgs Class?

    • 9 Comments
    There is an interesting thread on MSDN newsgroups (see "event arguments" thread) about the design of our eventing APIs. The question is why do we even have EventArgs class (which is empty)? Should we just allow the second parameter to the event handlers...
  • Krzysztof Cwalina

    Activator.CreateInstance<T> - System.Type vs. Generic Method

    • 9 Comments
    Daniel Moth asked, in his post , how to choose between a generic type parameter vs. a formal parameter of typed as System.Type. For example, the following two members seem equivalent. public class Activator { public static object CreateInstance(Type...
  • Krzysztof Cwalina

    Fix to TxRef

    • 0 Comments
    The Framework Design Guidelines book comes with a tool called TxRef. The tool was built with Beta 2 version of the Framework 2.0 and will not compile on the RTM version. Kathy just posted a fix to the problem. See http://blogs.msdn.com/kathykam/archive...
  • Krzysztof Cwalina

    FDG book readership beyond our wildest dreams

    • 0 Comments
    The Framework Design Guidelines book is being read by readers we never thought would be interested in API design. Richard has captured a photo showing one of the readers being simply glued to the Type Design chapter.
  • Krzysztof Cwalina

    SYS-CON TV Interview

    • 3 Comments
    I did an interview for SYS-CON TV. I talked about the Framework Design Guidelines book and other API related things. The interview can be viewed at http://www.sys-con.tv/read/137736.htm .
  • Krzysztof Cwalina

    Ship Party!

    • 2 Comments
    Online publishers have started shipping the Framework Design Guidelines book. Before, it was pre-order-only. I think Brad and I deserve a ship party :-) BTW, “ship party” is the term we use at Microsoft for a party we organize for ourselves after releasing...
  • Krzysztof Cwalina

    Free Chapter from the Framework Design Guidelines Book

    • 2 Comments
    Addison Wesley, the publisher of the Framework Design Guidelines book has posted a freely downloadable chapter . The chapter talks about type design.
  • Krzysztof Cwalina

    Why we don’t recommend using List<T> in public APIs

    • 30 Comments
    We don’t recommend using List<T> in public APIs for two reasons. List<T> is not designed to be extended. i.e. you cannot override any members. This for example means that an object returning List<T> from a property won’t be able...
  • Krzysztof Cwalina

    System.Collections vs. System.Collection.Generic and System.Collections.ObjectModel

    • 24 Comments
    Many people ask how the new.NET Framework 2.0 generic collections relate to the non-generic collections we shipped before. So, here you go. The most important types are in bold font. List<T> is basically a better ArrayList. It is optimized for...
  • Krzysztof Cwalina

    Workflow Application Model

    • 0 Comments
    I just found a very interesting blog written by Dave Green (an architect of the Windows Workflow Foundation). One of the posts explains the main motivations for creating a workflow framework. In general I am a big fan of the work this team has done...
  • Krzysztof Cwalina

    Value Type EventArgs

    • 6 Comments
    I just wanted to blog about some interesting API design discussion we had recently . We discussed whether to relax the event design guidelines to allow value type "event args." This would make raising some events cheaper. public struct SomethingHappenedEventArgs...
  • Krzysztof Cwalina

    Tracing APIs in .NET Framework 2.0

    • 1 Comments
    I found a very encouraging post about the new tracing APIs that we added to .NET Framework 2.0. Kathleen Dollard wrote : “ Sometimes Microsoft absolutely amazes me. I know .NET is big, and I know that the 2.0 release is rather overwhelming even to Softies...
  • Krzysztof Cwalina

    PDC 2005 Summary

    • 1 Comments
    I just wanted to post something to summarize the PDC 2005. PDC started for me on Monday. Brad and I were presenting at a precon on Designing Reusable APIs. 6 hours total. The slides can be downloaded here . We were tweaking slides till midnight...
  • Krzysztof Cwalina

    The Role of the API designer: Design what the user needs

    • 0 Comments
    Since I have been preparing for the PDC and finishing the book , I neglected blogging. All ideas for posts were just ending up in the “to do” folder (yes, Outlook drives my life J). Now, I will try to catch up. I was reading Paul Grahm’s essay on Design...
  • Krzysztof Cwalina

    Framework Design Guidelines book went to print

    • 5 Comments
    I have just heard from the publisher that the Framework Design Guidelines book just went to print. To celebrate and to thank for the contributions, I thought I would blog the list of people who provided annotations for the book: Brad Abrams , Mark...
  • Krzysztof Cwalina

    List<T> vs. ArrayList Performance

    • 0 Comments
    Rico just posted a new performance quiz where he compares performance of List<T> and ArrayList in some simple scenarios. List<T> is my Whidbey baby, so of course I had to answer that List<T> is faster :-)
  • Krzysztof Cwalina

    Factories in APIs

    • 0 Comments
    Steven Clarke has an excellent post about using factories in APIs . The post explains why some developers find factories difficult to use.
  • Krzysztof Cwalina

    Book Progress and Progrssive APIs

    • 1 Comments
    After posting about the Scenario Driven Design and the Design Guidelines book we are working on, I got several questions on that is "progressive API". Coincidentally I just submitted the final manuscript for a chapter that has a section on progressive APIs, so here is the related excerpt:...
  • Krzysztof Cwalina

    PowerCollections Beta Avaliable

    • 1 Comments
    The beta release of the PowerCollections library has been posted today. See http://wintellect.com/WEBLOGS/pgolde/archive/2005/06/03/1304.aspx .
  • Krzysztof Cwalina

    Should Exceptions Carry Error Code Information

    • 5 Comments
    Recently somebody asked me to clarify one of the exception guidelines . They were asking whether it's ok to have a property on exception types that provides access to an error code. I added the following annotation to one of the guidelines: Do not...
Page 3 of 4 (100 items) 1234