How is behavior specified?
In particular, is the specification expressed as declaratives or as
imperatives?
H. S. Lahman - 04 Apr 2008 14:04 GMT
Responding to Cressey...
> How is behavior specified?
>
> In particular, is the specification expressed as declaratives or as
> imperatives?
The short answer is: anyway you want -- so long as the specification
semantics are compliant with the UML execution meta model.

Signature
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@pathfindermda.com for your copy.
Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
Bob Badour - 04 Apr 2008 15:01 GMT
> Responding to Cressey...
>
[quoted text clipped - 5 lines]
> The short answer is: anyway you want -- so long as the specification
> semantics are compliant with the UML execution meta model.
What the f.ck does UML have to do with anything useful?
Phlip - 04 Apr 2008 15:26 GMT
> How is behavior specified?
>
> In particular, is the specification expressed as declaratives or as
> imperatives?
As a series of unit tests, each using assertions which are generally imperative.
The methods in the objects are more declarative.

Signature
Phlip
Leslie Sanford - 04 Apr 2008 18:26 GMT
> How is behavior specified?
>
> In particular, is the specification expressed as declaratives or as
> imperatives?
I think it would be a mixture of both. At some level you have to write the
code that actually implements the algorithms/behavior. Once the
implementation is done, the "How" of the matter, you can move up a level in
abstraction and use a more declarative approach, the "What" of the matter.
So if I do something like this:
class DarkStar
{
public:
// Stuff...
void CancelBombDetonation()
{
// Code that actually implements the cancel bomb detonation
// algorithm... have philosophical conversation with bomb
// to convince it not to blow up...
}
};
The code for the CancelBombDetonation method is imperative; it determines
how the algorithm is carried out. I can now take a more declarive approach:
darkStar.CancelBombDetonation();
At the level where the behavior is invoked, I don't care about how the
algorithm is implemented, only that it does *what* I expect.
Does this make sense?
Tegiri Nenashi - 04 Apr 2008 21:49 GMT
> How is behavior specified?
>
> In particular, is the specification expressed as declaratives or as
> imperatives?
State machine? Declarative style would push the model towards
algebraic description: Kleene algebra, idempotent semiring, etc. The
connection between Kleene and Tarski relation algebra is well known.
The difference between Kleene and Relational Algebra is quite
significant, and IMO is the essence of the divide between procedural
(i.e. sequential) and relational worlds.
As usual, the object perspective have really no insight to contribute.
paul c - 06 Apr 2008 18:34 GMT
> How is behavior specified?
>
> In particular, is the specification expressed as declaratives or as
> imperatives?
Do you have an example in mind? eg., local store sells sardines at 89
cents a can or two for $1.59. That behaviour seems declarative to me.