<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Why interfaces are poor contracts</title>
	<atom:link href="http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/feed/" rel="self" type="application/rss+xml" />
	<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/</link>
	<description>a development driven blog</description>
	<lastBuildDate>Sat, 24 Oct 2009 00:16:00 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: TDD, Contracts, and Reading the Fine Print - Dave Laribee</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-220</link>
		<dc:creator>TDD, Contracts, and Reading the Fine Print - Dave Laribee</dc:creator>
		<pubDate>Tue, 23 Sep 2008 16:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-220</guid>
		<description>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor contracts.        Published Sep 18 [...]</description>
		<content:encoded><![CDATA[<p>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor contracts.        Published Sep 18 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TDD, Contracts, and Reading the Fine Print - Mirrored Blogs</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-205</link>
		<dc:creator>TDD, Contracts, and Reading the Fine Print - Mirrored Blogs</dc:creator>
		<pubDate>Fri, 19 Sep 2008 03:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-205</guid>
		<description>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor [...]</description>
		<content:encoded><![CDATA[<p>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TDD, Contracts, and Reading the Fine Print - Dave Laribee</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-204</link>
		<dc:creator>TDD, Contracts, and Reading the Fine Print - Dave Laribee</dc:creator>
		<pubDate>Fri, 19 Sep 2008 02:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-204</guid>
		<description>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor contracts.    Published Sep 18 2008, [...]</description>
		<content:encoded><![CDATA[<p>[...] more-robust contracts? Sifting through a quick Google search on the subject yields a nice post by Mario Gleichmann exploring the idea that interfaces all by themselves are poor contracts.    Published Sep 18 2008, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John "Z-Bo" Zabroski</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-89</link>
		<dc:creator>John "Z-Bo" Zabroski</dc:creator>
		<pubDate>Fri, 14 Dec 2007 03:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-89</guid>
		<description>One more comment I forgot to mention... Type systems provide confidence, not certainty.  There is always the human element; Fred Brooks calls it conceptual integrity.  Simple point, but easy to overlook.  It&#039;s why I don&#039;t care for blog entries about &quot;chicken typing&quot; and such stuff.  They&#039;re examining problems at too specific detail, and taking focus away from concepts like data correctness and data integrity.

Also, since I am unfamiliar with SpringContracts, can someone provide an example?  It seems like the goal is to use reflection to determine if the weakest precondition is satisfied, but how is state handled when it turns out a precondition is not met?</description>
		<content:encoded><![CDATA[<p>One more comment I forgot to mention&#8230; Type systems provide confidence, not certainty.  There is always the human element; Fred Brooks calls it conceptual integrity.  Simple point, but easy to overlook.  It&#8217;s why I don&#8217;t care for blog entries about &#8220;chicken typing&#8221; and such stuff.  They&#8217;re examining problems at too specific detail, and taking focus away from concepts like data correctness and data integrity.</p>
<p>Also, since I am unfamiliar with SpringContracts, can someone provide an example?  It seems like the goal is to use reflection to determine if the weakest precondition is satisfied, but how is state handled when it turns out a precondition is not met?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John "Z-Bo" Zabroski</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-88</link>
		<dc:creator>John "Z-Bo" Zabroski</dc:creator>
		<pubDate>Fri, 14 Dec 2007 03:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-88</guid>
		<description>Many programmers are capable of programming without knowing the details of a contract.  As a trivial example, open and close operations on a file require a contract that specifies the ability to map a file on persistent storage to a stream.  Without this assumption, file manipulation must be stateless.  As an example, NSF&#039;s RESTful commands do not support stream abstraction, and NSF is stateless.  For reading an entire file into memory, the client is therefore responsible for keeping track of what parts of the file have already been scanned.  The client can manipulate the file through a client-side interface that implements the Scanner pattern, protecting and hiding state-process related to advancing the iterator (a byte off-set indicating how far into the file client has read) and how large a token is (a number indicating how many bytes to scan past and retrieve).  In doing so, the client can support stream I/O principles, but there is still no synchronization between client and server.  The client is merely manipulating shadows, not a contract.

The notion of a Protocol pattern therefore makes sense in the context of REST as an implementation pattern for protecting and hiding state-process and creating a domain-specific language on top of an initial set of devices capable only of stateless operations.  On top of these stateless operations, we can synthesize arbitrarily complicated devices using primitive elements.  This gives us a bootstrapping technique for extending the usefulness of a primitive initial set of stateless devices.

Locating contracts at interface boundaries comes from Floyd&#039;s work with flow charts and Dijkstra&#039;s ensuing weakest precondition.  However, it doesn&#039;t matter where the contracts are located so long as contracts are enforced.  There is a clear separation of concerns with regards to defining rules and enforcing rules.  As an example, the SQL Standard attempts to separate entering rules into the database (through a Data Definition Language) from enforcing those rules (through role-based execution of a Data Manipulation Language).

&quot;Chicken typing&quot; seems like more programmer slang I can do without.  The bigger picture is not best captured through slang but simple concepts like data correctness and data independence.  For the same reason, the notion of &quot;hard&quot; duck typing and &quot;soft&quot; duck typing seems misguided.  All of these ideas -- &quot;chicken typing&quot;, &quot;soft&quot; duck typing, &quot;hard&quot; duck typing, &amp;c. -- are based on the more general engineering principle Pursuit of Simplicity through Constraint.  Sometimes, our goal as programmers is to build a family of devices whose information processing characteristics can be specified as simple I/O procedures.  Let&#039;s not forget that goal.</description>
		<content:encoded><![CDATA[<p>Many programmers are capable of programming without knowing the details of a contract.  As a trivial example, open and close operations on a file require a contract that specifies the ability to map a file on persistent storage to a stream.  Without this assumption, file manipulation must be stateless.  As an example, NSF&#8217;s RESTful commands do not support stream abstraction, and NSF is stateless.  For reading an entire file into memory, the client is therefore responsible for keeping track of what parts of the file have already been scanned.  The client can manipulate the file through a client-side interface that implements the Scanner pattern, protecting and hiding state-process related to advancing the iterator (a byte off-set indicating how far into the file client has read) and how large a token is (a number indicating how many bytes to scan past and retrieve).  In doing so, the client can support stream I/O principles, but there is still no synchronization between client and server.  The client is merely manipulating shadows, not a contract.</p>
<p>The notion of a Protocol pattern therefore makes sense in the context of REST as an implementation pattern for protecting and hiding state-process and creating a domain-specific language on top of an initial set of devices capable only of stateless operations.  On top of these stateless operations, we can synthesize arbitrarily complicated devices using primitive elements.  This gives us a bootstrapping technique for extending the usefulness of a primitive initial set of stateless devices.</p>
<p>Locating contracts at interface boundaries comes from Floyd&#8217;s work with flow charts and Dijkstra&#8217;s ensuing weakest precondition.  However, it doesn&#8217;t matter where the contracts are located so long as contracts are enforced.  There is a clear separation of concerns with regards to defining rules and enforcing rules.  As an example, the SQL Standard attempts to separate entering rules into the database (through a Data Definition Language) from enforcing those rules (through role-based execution of a Data Manipulation Language).</p>
<p>&#8220;Chicken typing&#8221; seems like more programmer slang I can do without.  The bigger picture is not best captured through slang but simple concepts like data correctness and data independence.  For the same reason, the notion of &#8220;hard&#8221; duck typing and &#8220;soft&#8221; duck typing seems misguided.  All of these ideas &#8212; &#8220;chicken typing&#8221;, &#8220;soft&#8221; duck typing, &#8220;hard&#8221; duck typing, &amp;c. &#8212; are based on the more general engineering principle Pursuit of Simplicity through Constraint.  Sometimes, our goal as programmers is to build a family of devices whose information processing characteristics can be specified as simple I/O procedures.  Let&#8217;s not forget that goal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Gleichmann</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-76</link>
		<dc:creator>Mario Gleichmann</dc:creator>
		<pubDate>Tue, 04 Dec 2007 19:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-76</guid>
		<description>Markus,

as always - thanks for your feedback!
i fully understand your concerns and will respond to them in a minute.

first of all, the core of the post tries to deliberate on the concept or metaphor of a contract and the widely accepted term of interfaces as contracts. while there are surely some solutions of DBC that have their specific shortcomings (SpringContracts is no exception), the post is more about the idea of a contract and in respect to that metaphor about Design by Contract as a principle.

now to your concerns - i share those in the main. thus, i want to give some of my thoughs:

- &quot;Choosing annotations over Java Code&quot;
it&#039;s most relevant to see invariants, pre- and postconditions as a part of the public interface! if you declare those conditions within a class, than they loose connection to the public interface (for me it&#039;s kind of hiding the contract, so clients (and even implementors) can&#039;t see what&#039;s the intended behaviour at first sight. that said, pre- and postconditions stay on the same informational level than the declared types of a methods arguments.

- &quot;introduced a proprietary language&quot;
that must not be true for all kind of implementations of dbc. take a look at Eiffel, where you specify invariants, pre and postconditions in the terms of the language itself (with some additional keywords like &#039;require&#039; (introducing preconditions), ensure (introducing postconditions) or &#039;old&#039;)

- &quot;Annotation rules&quot;
unfortunately they are the most appropriate instrument to annotate classes and methods nowadays  (sadly, there aren&#039;t such keywords like &#039;require&#039; or &#039;ensure&#039;).

- &quot;can’t be refactored&quot;
i think you want to say that they can&#039;t be automatically refactored by IDE support. of course you could refactor those conditions manually. i see your point - since you can&#039;t  put code inside annotations (a kind of closure for example) you are limited when it comes to refactoring the underlying interface or classes.

- &quot;can’t be debugged&quot;
that&#039;s again specific to the implementation. You could debug SpringContracts as work simply by adding a breakpoint to the aspects code that intercepts the method calls and evaluates the conditions (admitted - debugging the evaluation of the condition itself might be harder)

- &quot;are limited in language possiblities&quot;
that belongs to all kind of solutions where you have to express your intention. if you&#039;re using a dsl and want to express a condition that wasn&#039;t foreseen by the &#039;language&#039; you&#039;re in trouble.
but as said before the language you&#039;re using to express the contracts conditions are specific to the solution. SpringContracts for example allows you to switch to another language (maybe groovy or even java itself) simpy by configuring the underlying evaluator.

- &quot;and same rules will be repeated all over the code&quot;
i&#039;m a little bit irritated about that. for me, dbc is JUST about NOT to repeat the &#039;rules&#039; all over the code! 
let&#039;s see how this will look if you directly include the &#039;rules&#039; inside your code - you may will use assertions or guard clauses to check the preconditions and again assertions or some other routines to check the postconditions and invariants:
- you can only apply those checks to classes, not interfaces
- you have to apply invariant assertions to all of your methods (seems like a kind of pollution resp. violation of the DRY principle to me). and if you add a new method - don&#039;t forget to insert the invariants checks.
- assertions are NOT inheritet. if you extend a class and overwrite a method, the assertions of the superclass are lost, otherwise you have to repeat the assertions in all your subclasses.
not so with dbc: you declare the contract to an interface and all implementors and even subtypes of that implementors automatically inherit the contract and also gets checked automatically without further effort.
now what strategy will have more repeated code? :o)

Best Regards

Mario</description>
		<content:encoded><![CDATA[<p>Markus,</p>
<p>as always &#8211; thanks for your feedback!<br />
i fully understand your concerns and will respond to them in a minute.</p>
<p>first of all, the core of the post tries to deliberate on the concept or metaphor of a contract and the widely accepted term of interfaces as contracts. while there are surely some solutions of DBC that have their specific shortcomings (SpringContracts is no exception), the post is more about the idea of a contract and in respect to that metaphor about Design by Contract as a principle.</p>
<p>now to your concerns &#8211; i share those in the main. thus, i want to give some of my thoughs:</p>
<p>- &#8220;Choosing annotations over Java Code&#8221;<br />
it&#8217;s most relevant to see invariants, pre- and postconditions as a part of the public interface! if you declare those conditions within a class, than they loose connection to the public interface (for me it&#8217;s kind of hiding the contract, so clients (and even implementors) can&#8217;t see what&#8217;s the intended behaviour at first sight. that said, pre- and postconditions stay on the same informational level than the declared types of a methods arguments.</p>
<p>- &#8220;introduced a proprietary language&#8221;<br />
that must not be true for all kind of implementations of dbc. take a look at Eiffel, where you specify invariants, pre and postconditions in the terms of the language itself (with some additional keywords like &#8216;require&#8217; (introducing preconditions), ensure (introducing postconditions) or &#8216;old&#8217;)</p>
<p>- &#8220;Annotation rules&#8221;<br />
unfortunately they are the most appropriate instrument to annotate classes and methods nowadays  (sadly, there aren&#8217;t such keywords like &#8216;require&#8217; or &#8216;ensure&#8217;).</p>
<p>- &#8220;can’t be refactored&#8221;<br />
i think you want to say that they can&#8217;t be automatically refactored by IDE support. of course you could refactor those conditions manually. i see your point &#8211; since you can&#8217;t  put code inside annotations (a kind of closure for example) you are limited when it comes to refactoring the underlying interface or classes.</p>
<p>- &#8220;can’t be debugged&#8221;<br />
that&#8217;s again specific to the implementation. You could debug SpringContracts as work simply by adding a breakpoint to the aspects code that intercepts the method calls and evaluates the conditions (admitted &#8211; debugging the evaluation of the condition itself might be harder)</p>
<p>- &#8220;are limited in language possiblities&#8221;<br />
that belongs to all kind of solutions where you have to express your intention. if you&#8217;re using a dsl and want to express a condition that wasn&#8217;t foreseen by the &#8216;language&#8217; you&#8217;re in trouble.<br />
but as said before the language you&#8217;re using to express the contracts conditions are specific to the solution. SpringContracts for example allows you to switch to another language (maybe groovy or even java itself) simpy by configuring the underlying evaluator.</p>
<p>- &#8220;and same rules will be repeated all over the code&#8221;<br />
i&#8217;m a little bit irritated about that. for me, dbc is JUST about NOT to repeat the &#8216;rules&#8217; all over the code!<br />
let&#8217;s see how this will look if you directly include the &#8216;rules&#8217; inside your code &#8211; you may will use assertions or guard clauses to check the preconditions and again assertions or some other routines to check the postconditions and invariants:<br />
- you can only apply those checks to classes, not interfaces<br />
- you have to apply invariant assertions to all of your methods (seems like a kind of pollution resp. violation of the DRY principle to me). and if you add a new method &#8211; don&#8217;t forget to insert the invariants checks.<br />
- assertions are NOT inheritet. if you extend a class and overwrite a method, the assertions of the superclass are lost, otherwise you have to repeat the assertions in all your subclasses.<br />
not so with dbc: you declare the contract to an interface and all implementors and even subtypes of that implementors automatically inherit the contract and also gets checked automatically without further effort.<br />
now what strategy will have more repeated code? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
<p>Best Regards</p>
<p>Mario</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Gleichmann</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-75</link>
		<dc:creator>Mario Gleichmann</dc:creator>
		<pubDate>Tue, 04 Dec 2007 18:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-75</guid>
		<description>Michael B,

thanks for your quick response!
now it&#039;s me who may not get your point: do you want to emphasize again that an annotation alone doesn&#039;t buy you much? right so - i thought to make clear in my last answer that there of course have to be an &#039;appropriate environment&#039; that investigates and checks those contract elements.

of course - an annotation alone is useless without the &#039;environment&#039; that &#039;cares&#039;, just as well as declaration of transaction demarcation, resp. transaction attributes (be it by using a kind of @Transaction annotation or by using external declaration within a deployment descriptor) or declaring a bean to be a persistent one (again by using some kind of @Entity annotation or mapping files) is useless if there&#039;s no environment or container that evaluates and processes those declarations!

same is true for contract elements. i thought to make clear that there IS such an environment that detects and evaluates those conditions. in particular there is no need for artificial intelligence or &#039;human care&#039;, since all those statements are expressed in a formal language (EL - Expression Language in the posts example) and result to a boolean expression that can be easily evaluated.

to make things clear: SpringContracts for example offers such an evaluating &#039;environment&#039; that uses AOP to intercept method calls to instances of classes that may implement a &#039;contracted&#039; interface and checks the contract&#039;s statements (the invariants and the pre- and postconditions of the method that gets called) at runtime. since they represent a boolean expression they result to true or false (using an EL-Evaluator that evaluates the expression in our specific case). in case that the stated expression evaluates to false, that means the statement isn&#039;t fullfilled (one of the contracts conditions are violated) a ContractViolationException is thrown by default. as you can see - nothing magic needed to enforce such a contract (or do we now have to argue about the definition of enforcement :o)), even no AI is needed.

Hope that migth clarify some misunderstandings - if i&#039;m not hitting your point - please let me know.

Greetings

Mario</description>
		<content:encoded><![CDATA[<p>Michael B,</p>
<p>thanks for your quick response!<br />
now it&#8217;s me who may not get your point: do you want to emphasize again that an annotation alone doesn&#8217;t buy you much? right so &#8211; i thought to make clear in my last answer that there of course have to be an &#8216;appropriate environment&#8217; that investigates and checks those contract elements.</p>
<p>of course &#8211; an annotation alone is useless without the &#8216;environment&#8217; that &#8216;cares&#8217;, just as well as declaration of transaction demarcation, resp. transaction attributes (be it by using a kind of @Transaction annotation or by using external declaration within a deployment descriptor) or declaring a bean to be a persistent one (again by using some kind of @Entity annotation or mapping files) is useless if there&#8217;s no environment or container that evaluates and processes those declarations!</p>
<p>same is true for contract elements. i thought to make clear that there IS such an environment that detects and evaluates those conditions. in particular there is no need for artificial intelligence or &#8216;human care&#8217;, since all those statements are expressed in a formal language (EL &#8211; Expression Language in the posts example) and result to a boolean expression that can be easily evaluated.</p>
<p>to make things clear: SpringContracts for example offers such an evaluating &#8216;environment&#8217; that uses AOP to intercept method calls to instances of classes that may implement a &#8216;contracted&#8217; interface and checks the contract&#8217;s statements (the invariants and the pre- and postconditions of the method that gets called) at runtime. since they represent a boolean expression they result to true or false (using an EL-Evaluator that evaluates the expression in our specific case). in case that the stated expression evaluates to false, that means the statement isn&#8217;t fullfilled (one of the contracts conditions are violated) a ContractViolationException is thrown by default. as you can see &#8211; nothing magic needed to enforce such a contract (or do we now have to argue about the definition of enforcement <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )), even no AI is needed.</p>
<p>Hope that migth clarify some misunderstandings &#8211; if i&#8217;m not hitting your point &#8211; please let me know.</p>
<p>Greetings</p>
<p>Mario</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-74</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Tue, 04 Dec 2007 08:37:10 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-74</guid>
		<description>Choosing annotations over Java Code (concrete implementations) to enrich interfaces, seems not right for me.
 
You have introduced a proprietary language to make code smaller but at what price? 
Annotation rules 
  - can&#039;t be refactored,
  - can&#039;t be debugged,
  - are limited in language possiblities, 
  - and same rules will be repeated all over the code. 

Fullfilling a contract can be very demanding an complex, please leave it in Java.</description>
		<content:encoded><![CDATA[<p>Choosing annotations over Java Code (concrete implementations) to enrich interfaces, seems not right for me.</p>
<p>You have introduced a proprietary language to make code smaller but at what price?<br />
Annotation rules<br />
  &#8211; can&#8217;t be refactored,<br />
  &#8211; can&#8217;t be debugged,<br />
  &#8211; are limited in language possiblities,<br />
  &#8211; and same rules will be repeated all over the code. </p>
<p>Fullfilling a contract can be very demanding an complex, please leave it in Java.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael B</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-73</link>
		<dc:creator>Michael B</dc:creator>
		<pubDate>Mon, 03 Dec 2007 23:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-73</guid>
		<description>I guess I wasn&#039;t as clear as I had hoped.

&quot;but Design by Contract is also about checking and therefore ensuring that the stated constraints are observed and adhered by supplier and clients.&quot; 
-(but) a contract isn&#039;t about checking at all it&#039;s &#039;merely&#039; a collection of rules and expectations. As a point, a location, to define those rules interfaces fit nicely in this picture. 

Now why is all not well? As you hint at in your article, a documented method signature doesn&#039;t cut it. It leads to errors, bugs and other because of sloppy programmers.  And they are allowed to be sloppy because nothing is enforced: rules aren&#039;t checked. This brings about the conclusion that &#039;any form of a contract is meaningless UNLESS it is enforced&#039;.

To be able to enforce rules, they need to be specific and formal(unambiguous). If you specify pre and post conditions((part of) design by contract) you come a long way in fulfilling these requirements. To allow it to be automaticly enforced a computer needs to understand it. Since the artificial intelligence guys don&#039;t seem to have come quite far enough yet(to be able to interpret human text). We help it along by using annotations.

1 rules/expectations, 2 checking, 3 penalty
1, the contract, captured by an interface
2. compile-time or run-time checks
3. bugs/errors/exceptions

these are distinct area&#039;s to me and problems occur due the lack of the second the contract(1) is usually there and the third is undeniable. Design by contract principles add value to the 3 by chancing some results into handleable specific errors/exceptions. Ok, so perhaps, I am, arguing over the what is a contract definition.

However with the above in mind the java tutorial is quite correct. Alas also oblivious and unrealistic; you can leave enforcing/checking to humans, but in real life it&#039;s far to costly and time consuming. 

an unenforced rule/contracts breaks the system; it&#039;s a incomplete; a &#039;poor&#039; system vs a meaningless(unenforced) contract is a poor contract. -&gt; Its all a matter of which perspective one takes

I hope that made any sense.</description>
		<content:encoded><![CDATA[<p>I guess I wasn&#8217;t as clear as I had hoped.</p>
<p>&#8220;but Design by Contract is also about checking and therefore ensuring that the stated constraints are observed and adhered by supplier and clients.&#8221;<br />
-(but) a contract isn&#8217;t about checking at all it&#8217;s &#8216;merely&#8217; a collection of rules and expectations. As a point, a location, to define those rules interfaces fit nicely in this picture. </p>
<p>Now why is all not well? As you hint at in your article, a documented method signature doesn&#8217;t cut it. It leads to errors, bugs and other because of sloppy programmers.  And they are allowed to be sloppy because nothing is enforced: rules aren&#8217;t checked. This brings about the conclusion that &#8216;any form of a contract is meaningless UNLESS it is enforced&#8217;.</p>
<p>To be able to enforce rules, they need to be specific and formal(unambiguous). If you specify pre and post conditions((part of) design by contract) you come a long way in fulfilling these requirements. To allow it to be automaticly enforced a computer needs to understand it. Since the artificial intelligence guys don&#8217;t seem to have come quite far enough yet(to be able to interpret human text). We help it along by using annotations.</p>
<p>1 rules/expectations, 2 checking, 3 penalty<br />
1, the contract, captured by an interface<br />
2. compile-time or run-time checks<br />
3. bugs/errors/exceptions</p>
<p>these are distinct area&#8217;s to me and problems occur due the lack of the second the contract(1) is usually there and the third is undeniable. Design by contract principles add value to the 3 by chancing some results into handleable specific errors/exceptions. Ok, so perhaps, I am, arguing over the what is a contract definition.</p>
<p>However with the above in mind the java tutorial is quite correct. Alas also oblivious and unrealistic; you can leave enforcing/checking to humans, but in real life it&#8217;s far to costly and time consuming. </p>
<p>an unenforced rule/contracts breaks the system; it&#8217;s a incomplete; a &#8216;poor&#8217; system vs a meaningless(unenforced) contract is a poor contract. -&gt; Its all a matter of which perspective one takes</p>
<p>I hope that made any sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Gleichmann</title>
		<link>http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-72</link>
		<dc:creator>Mario Gleichmann</dc:creator>
		<pubDate>Mon, 03 Dec 2007 22:01:28 +0000</pubDate>
		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/02/why-interfaces-are-poor-contracts/#comment-72</guid>
		<description>naikrovek,

good points. i will elaborate on that on a blog entry of its own. watch out ... :o)</description>
		<content:encoded><![CDATA[<p>naikrovek,</p>
<p>good points. i will elaborate on that on a blog entry of its own. watch out &#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
</channel>
</rss>
