Several months ago, I made a posting regarding a possible enhancement to
Ruby to facilitate Design by Contract (DbC). Matz and Justin were kind
enough to reply w/their thoughts and I was curious to know whether there is
any hope for such functionality in any near future release of Ruby.
Hello ken,
I dont know if there are any upcoming plans for this,
so will defer on that thought. The obvious idea though
is why not make a class with a method called 'contract’
and then use mixin’s to add the method(s) into whichever
class is going to be talking to the client (or other
class etc). This may be a ‘poormans’ version of 'DbC’
but its implementable right now
Design by contract always seems to be (at least in my
eyes) something thats very helpful for programs which
dont deal with ‘external’ applications or clients. If
your using design by contract to ~replace~ SEDLC
(Software Engineering Development Life Cycles) then I
think your coming at it from the ‘wrong’ approach.
anyway, i dont want to start a flamewar, so thats my
2cents as it were.
regards
Stef