The Artima Developer Community
Sponsored Link

Absolutely not



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Absolutely not

Posted by Mike Mannion on 24 Nov 1998, 7:27 AM

> I'm not sure what Mike is looking for here, but it sure sounds like an abstract class.

What I'm talking about is an abstract behavioural specification.

What are objects all about? Most objects possess a set of features and encapsulate some state.
Features can be used to query the state of the object or they can be used to modify the state of an object.
It's the features which modify state which are interesting from a behavioural perspective, indeed we could say that they embody the behaviour.
It's these features which give objects "life" and which distinguish them from pure data.

Given the fundamental nature of such features to OO, it is always surprises me that in typical models, a complete specification of the required (or the modelled) behaviour is missing completely.
Such features are typically described by means of a method signiture and a (with luck) a textual description of its purpose.

An abstract behavioural specification on the other hand describes the state the object must be in before a particular feature is invoked, and the state of the the object after the feature has been invoked.
It does this in the form of unambiguous boolean predicates, which must hold true at the appropriate times. These are called pre- and postconditions.

Non of this has anything to do with the eventual implementation, which may be as complex, as simple. as efficient or as elegant as the programmer chooses.

So what?

So we then have an unambiguous, implicitely documented statement of the software's semantics, which can, if required, be verified at runtime.

At least we would have that if Java supported Design by Contract.

- Java Developer Connection, Bug parade, Bug #4071460
- JavaReport September '98


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us