Spec Creation

2 views
Skip to first unread message

kilfour

unread,
Nov 22, 2009, 9:34:28 AM11/22/09
to QuickNet
This started out as an overloaded constructor, later builder methods
were added.

If : defines the PreCondition , if any.
IfAfter : defines the PostCondition , if any.
Throws<TException> : defines the expected exception, if any.

DoBefore : an action which is usefull to copy state from the input
before the transition.

The invariant is currently still passed in through the constructor as
all I could come up with was Invariant and I didn't really like it.

Better suggestions ?

And do we still need the overloaded constructors ?
The builder methods are more elegant I think.

Davy Brion

unread,
Nov 22, 2009, 2:57:51 PM11/22/09
to quic...@googlegroups.com
i also prefer the builder methods... as for passing in the invariant through the constructor: it's definitely clear enough IMO, so i'd keep it like that

the overloaded constructors can be removed, though their presence doesn't hurt either :)

kilfour

unread,
Nov 22, 2009, 3:50:20 PM11/22/09
to QuickNet
I'm leaning towards removing the constructors. They might hurt.
Reason being : backwards compatibility.
Currenty there's no way to define an ExpectedException through the
constructor.
Also the DoBefore action is not supported through constructor
initialization.
If I can remember why it might be usefull, and I distinctly remember
thinking this once, the reason for it currently escapes me though, I
might add a DoAfter action. Again it will either be unsupported
through constructor initialization, or we would have to add another
constructor. Keeping things logical, i.e like we now define the pre-
condition before the invariant, and the postcondition after the
invariant, would mean reordering of the constructor's parameters. This
would break existing implementations. Or we would have to add a
parameter to the constructor as we develop it. Leading to bad
expression of intent.
I say we throw it out while we still can, even if in some cases it is
slightly more verbose.

Davy Brion

unread,
Nov 22, 2009, 3:56:09 PM11/22/09
to quic...@googlegroups.com
agreed

kilfour

unread,
Nov 24, 2009, 8:02:39 AM11/24/09
to QuickNet
overloaded constructors have been removed
Reply all
Reply to author
Forward
0 new messages