[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: design by contract



icontract is a post processor for source-code that reads declarations 
for pre-conditions, post-conditions, and invariants.  I read about 
icontract in The Pragmatic Programmer a few years ago.

http://www.reliable-systems.com/tools/iContract/iContract.htm
http://www.javaworld.com/javaworld/jw-02-2001/jw-0216-cooltools.html

Ajith Kallambella wrote:

>I studied Mike Meyer's "Object Oriented Software Construction( second
>edition )" during school and implemented design by contract using
>SmallTalk. It is my understanding the Java has limited support to achieve
>DBC - using interfaces and assertions.  Java lacks core language support
>for features such as class invariants and covariants. Having said that, I
>believe you can use some of the Java preprocessing tools to achieve this.
>
>BTW, if you call yourself a good OO programmer, you must read Meyer's book.
>
>Cheers,
>
>Ajith Kallambella
>http://www.javaranch.com/contact.jsp#AjithKallambella
>
>
>
>----------------------------------------------------------------------------------------
>
>This is a PRIVATE message. If you are not the intended recipient, please
>delete without copying and kindly advise us by e-mail of the mistake in
>delivery. NOTE: Regardless of content, this e-mail shall not operate to
>bind CSC to any order or other contract unless pursuant to explicit written
>agreement or government initiative expressly permitting the use of e-mail
>for such purpose.
>----------------------------------------------------------------------------------------
>
>
>
>
>                                                                                                                                                  
>                      "Fuqua, Andrew                                                                                                              
>                      (ISSAtlanta)"            To:      "Ed Jenkins" <andexor@yahoo.com>, "Gregory Pierce" <gregorypierce@mac.com>                
>                      <AFuqua                  cc:      "Xp-Atlanta (E-mail)" <xp-atlanta@yahoogroups.com>, "Ajug-Members (E-mail)"               
>                      @iss.net>                <ajug-members@www.ajug.org>                                                                        
>                                               Subject: RE: design by contract                                                                    
>                      06/24/2003 10:44                                                                                                            
>                      AM                                                                                                                          
>                                                                                                                                                  
>                                                                                                                                                  
>
>
>
>
>Ed Jenkins wrote:
>  
>
>>When you say "design by contract", I assume you mean developing an
>>    
>>
>interface and then one or more classes that implement that interface.
>
>Actually, I mean something much more than that. I'm talking assertions of
>preconditions, postconditions, invariants such as described in
>http://archive.eiffel.com/doc/manuals/technology/contract/ and
>http://www.javaworld.com/javaworld/jw-02-2001/jw-0216-cooltools.html and
>http://www.mmsindia.com/DBCForJava.html.
>
>regards
>andrew m fuqua
>
>
>-----Original Message-----
>From: Ed Jenkins [mailto:andexor@yahoo.com]
>Sent: Tuesday, June 24, 2003 9:42 AM
>To: Gregory Pierce; Fuqua, Andrew (ISSAtlanta)
>Cc: Xp-Atlanta (E-mail); Ajug-Members (E-mail)
>Subject: Re: design by contract
>
>
>I've been reading API docs in JavaDoc format since Java 1.0.  Then, if the
>next programmer (who is a user of your framework) codes to your interface
>instead of directly to a certain class, then the code they write is more
>stable and less likely to
>break when they upgrade to a newer version of your components.
>
>It seems like frameworks like this started to become popular with JDBC 1.0.
>Then they really
>became more popular with javax.swing and java.net in Java 1.1.  These days,
>it is also becoming
>popular for encryption and other uses.  I guess EJBs are considered to be
>DBC even though the
>beans don't implement the interface directly.
>
>So, I think if you study JDBC, Swing, Collections, JNDI, and other sorts of
>things like them, you
>can learn HOW Sun did it.  And if you've ever written a header file for a
>program in C, then it is
>easy to do.  The big question that remains is this:  when developing your
>own frameworks, how do
>you know WHEN you should create interfaces and do DBC and when not to?  As
>far as I can tell, the
>best time to do it is when you envision a provider and client type thing.
>When you want other
>people to be able to develop pluggable components that fit within your
>framework.  Another example
>is scripting, such as the Bean Scripting Framework from IBM, where you can
>use any number of
>scripting languages to write macros for your desktop application.
>
>Ed
>
>--- Gregory Pierce <gregorypierce@mac.com> wrote:
>  
>
>>Actually this is something best left on the list as there are talks
>>underway about the topics that deserve deeper focus within AJUG
>>meetings and this sounds like one of them. Are there any other lurkers
>>out there who have a particular interest in this topic?
>>
>>On Monday, June 23, 2003, at 05:47  PM, Fuqua, Andrew (ISSAtlanta)
>>wrote:
>>
>>    
>>
>>>Hi Gregory.
>>>
>>>I'd like to have a session on DBC at a future XP-atlanta or AJUG
>>>meeting so I'm trying to identify knowledgeable people who can talk
>>>about it. I think both groups would enjoy an intro or intermediary
>>>presentation on DBC in general. If I can find someone who knows about
>>>DBC in Java, then AJUG may be the more appropriate venue. If I can
>>>find someone who has done DBC in something other than Java or who has
>>>done some refactoring and unit testing with DBC, then xp-atlanta may
>>>be the more appropriate venue. And in either case, a case study or
>>>experience report would tie it all together with examples.
>>>
>>>If we can find 2 or 3 people, then we could even have a panel.
>>>
>>>Thanks for responding. In what way would you be able to contribute?
>>>(We can take this off-line if you wish.)
>>>
>>>andrew m fuqua
>>>
>>>-----Original Message-----
>>>From: Gregory Pierce [mailto:gregorypierce@mac.com]
>>>Sent: Monday, June 23, 2003 4:30 PM
>>>To: Fuqua, Andrew (ISSAtlanta)
>>>Cc: Xp-Atlanta (E-mail); Ajug-Members (E-mail)
>>>Subject: Re: design by contract
>>>
>>>
>>>Hi Andrew, I've done a lot of Design by contract. Its a very useful way
>>>of designing systems (generally when there is little tight/formal
>>>communication). What aspect of the design method are you seeking to
>>>gain more information on? Are you looking for something more along the
>>>lines of a case study or are you just looking for kind of a 'how too'
>>>type of thing?
>>>      
>>>
>
>
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>
>
>
>
>
>
>  
>