I've received a flood of questions recently as to the status of the Booch
Components for Ada 95. I'd like to answer some of these questions (sort
of a Mini-FAQ).
Well, that's a good question, and one that deserves a pretty lengthy answer. Unfortunately, I'm going to be brief.... the alternative to the following line
pragma Assert(Curr /= null, "Attempt to Insert at NULL location");
Would be...
Added to package BC:
Assertion_On : constant Boolean : True; -- False for assertions off
Then, in each place pragma Assert existed...
if Assertion_On then
if Curr /= null then
Raise_Exception(Exception_Identity(Assertion_Exception),
"Attempt to Insert at NULL location");
end if;
end if;
That should give you the general feeling of what pragma Assert does. The utility of assertions is twofold:
- Assertions give us a compact representation of an optional error-handling scheme
- Assertions require no modification of source code.
pragma Assert is currently supported by Aonix ObjectAda and GNAT. There are strong (but unconfirmed :-) rumors that Rational will support the same style of assertion syntax. I think that OC Systems supports it also. I have no communication whatsoever with DDCI or RR Software, so I won't even hazard a guess. In any case, I have very strong opinions about the utility of pragma Assert, and have no desire to remove them without some very compelling arguments. Any reader is welcome to put in their comments :-)
The original FAQ
What role does Grady Booch have in this?
- Grady's role is primarily advisory, but I do try to keep him informed and
aware. He has the final say on the architecture of the components as they're
being developed, but he has yet to tell me not to do something :-)
How are the components being released?
- At the moment, the components will be released under a unique "dual-licensing"
technique. For most individuals, the license will be a modified version
of the Perl Artistic License, the Ada Community License, that will be less restrictive than existing GNU-based licenses.
For corporations, the components will be distributed through compiler
vendors that may attach special terms for maintenance of the components. This is a rather radical concept, and one that will
no doubt generate controversy in the future as we work the details out.
The important thing to remember is: THE SOURCE WILL REMAIN FREE.
Who is the maintainer of the components?
- I will remain in that role for a while, and the mechanism to submit changes
will be similar to that used for other GNU-based products. Companies with
special vendor licensing will follow the guidelines set forth in their licensing
terms.
Why not just use C++?
- I'd rather swim naked in the Great Salt Lake with a million paper cuts on
my body. After using C++ for over 8 years, I'm "Proud to Be ++ Free"
Who is Dave Weller?
- Good question. Even he isn't sure :-)
What is the difference between Guarded and Synchronized Components?
- Imagine a need to do "batch" processing of a list in a concurent environment.
In that particular case, you might want to "lock" a component while you
perform several operations on it (add, change, delete, etc.). The Guarded
form permits this approach. On the downside, the Guarded form requires that
you explicitly lock and unlock a component (and all the potential problems
therein). For this reason, it is generally advised to use the Synchronized
form unless you specifically need the features of the Guarded form.
When should I use the Dynamic Form?
- I haven't done much timing on it, but the Dynamic form should generally
be the default form. I'm still pondering the implementation of this one,
I might come up with something really cool by the summertime.
What was the naming scheme you used for your packages and types?
- Naming schemes are interesting, since people always love to argue about
them. I always work from the perspective of the user that enjoys a relatively
terse notation (after all, I was a C programmer long before I was an Ada
guy :-). I selected long names for the packages, and short names for the
types. However, I have injected enough information in the type names to
allow the user to understand the form without having to know which package
it came from. In general, this means the type names look like something
out of the "Scrabble Game from Hell", but I find the names work out OK.
Naturally, your mileage may vary :-)
[index]