{"id":26,"date":"2004-11-05T18:19:08","date_gmt":"2004-11-05T18:19:08","guid":{"rendered":"http:\/\/gaisan.com\/wordp\/?p=26"},"modified":"2004-11-05T18:19:08","modified_gmt":"2004-11-05T18:19:08","slug":"design-by-contract-in-c","status":"publish","type":"post","link":"https:\/\/gaisan.com\/blogs\/?p=26","title":{"rendered":"Design By Contract in C"},"content":{"rendered":"<p>Charlie Mills creates a Design-By-Contract library for C <i>(which could equally be used for C++ with minor changes)<\/i> in his most recent <a href=\"http:\/\/www.onlamp.com\/pub\/a\/onlamp\/2004\/10\/28\/design_by_contract_in_c.html\">OnLamp article<\/a>. DBC views functions and methods as contractual agreements between the functional caller and the object\/module providing the function. Charlie&#8217;s implementation is a really neat idea using Object Constraint Language <i>(OCL)<\/i>to describe:<\/p>\n<ul>\n<li>function preconditions<\/li>\n<li>function postconditions<\/li>\n<li>type and function invariants<\/li>\n<\/ul>\n<p>The implementation is hacked up using Ruby and Racc and is available <a href=\"http:\/\/dbc.rubyforge.org\/wiki\/wiki.pl\">here<\/a>.. I&#8217;m currently playing around with DBC for Java using <a href=\"http:\/\/www.javaworld.com\/javaworld\/jw-02-2001\/jw-0216-cooltools.html\">iContracts<\/a> and I&#8217;ll post the inevitable success stories here soon&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Charlie Mills creates a Design-By-Contract library for C (which could equally be used for C++ with minor changes) in his most recent OnLamp article. DBC views functions and methods as contractual agreements between the functional caller and the object\/module providing the function. Charlie&#8217;s implementation is a really neat idea using Object Constraint Language (OCL)to describe: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/26"}],"collection":[{"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":0,"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"wp:attachment":[{"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaisan.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}