Daryl Zuniga - Viewing Code Contracts.NET in Visual Studio

Sign in to queue

The Discussion

  • User profile image
    RobertAMc​Carter

    This is great (and so is design-by-contract)! Thanks Daryl.

    Will this be included in VS2010 or will it be a seprate extension?

     

  • User profile image
    wkempf

    How does this handle contracts in the "if-then-throw" form?

  • User profile image
    aL_

    interesting Smiley did we just get a sneak preview of intellisense in b2 or was that some custom addon btw? :O

  • User profile image
    peli

    The intellisense is some sample that Daryl installed on his machine.

  • User profile image
    sokhaty

    I wonder if it is or someday would be possible to interrogate a method about its contracts at runtime, so the caller could ensure compliance before actually invoking the method? E.g. before sending big batch of data over the wire for pre-processing and loading into a database in one transaction, I get an abstract code tree from the transformation service that represents all or at least some of the checks and run them locally and perform corrective actions proactively.

  • User profile image
    mbarnett

    This will be a separate download that will be part of the Code Contracts installation. We hope to get it out in the next release, but we'll have to see if it is ready or not.

  • User profile image
    mbarnett

    This is something we've talked about, but haven't started work on. It might even be that a component could register its contracts with a component framework so that if there's a failure, the framework could check the contracts and assign blame properly. (Not as good as your idea of proactively preventing the problem, but another use of the same facility.)

  • User profile image
    sokhaty

    Thanks Mike. It sounds like registering contracts with the framework would be the core enabling technology for proper blame assignment and proactive failure prevention. It almost can be read as you guys are planning start working on that Smiley

Add Your 2 Cents