Design by Contract - some questions

Sérgio Agostinho sergioag at di.fct.unl.pt
Sat Jan 27 04:49:19 PST 2007


Hi there,

I am doing a master thesis on Design by Contract, and as part of it, I am doing a survey on DbC solutions. I have found the D programming language very interesting, and one of the few real attempts to bring DbC to mainstream programming.

After reading the site documentation, there are a couple of questions that I have, that you might be able to answer, namely:
* is it possible to specify pre/postconditions in constructors and private methods?
* is it possible to declare local variables within the 'in', 'out' or 'invariant' scope?
* is there any concurrency insurance in contract execution (if the method is declared as 'synchronized', will the contract also be thread-safe)?

Regarding the D authors' design options, I also have some questions:
* has the 'old' construct been considered?
* have interface contracts been considered (since D does not support multiple-inheritance)?
* has (automatic) documentation generation support for contracts been considered?
* has a finer grain of checking been considered, other that development/on and release/off (the ability to specify that contract checking for specific classes and/or specific assertion types)?

Thank you for your time,

Sérgio Agostinho


More information about the Digitalmars-d-learn mailing list