Le 24/11/10 10:29, Tim Rentsch a écrit :
An impressively large document (meaning the included
documentation ccl.pdf). I didn't have time to read it
thoroughly, but I did skim about 10 or 20 pages, and
looked through the table of contents.
My answer is in two parts.
A. Not as I meant the term, no. This document describes
externally visible behavior, but what I was asking about is
a statement of requirements from the point of view of an
implementor, that is, a more complete statement about what
attributes and properties, etc, must be observed in the
implementation. Externally visible behavior is one part of
that, but only part.
B. My original question is just about requirements for the
"observer" behavior that you had asked about. Maybe I missed
it, but I didn't see anything in this document about observer
functionality. Before trying to complete an implementation,
it would be good to write down at least some of what you
think the requirements should be - again, from the point of
view of an implementor - to help judge various design
choices. This can be an iterative process if you like,
alternating back and forth between writing requirements and
implementing, but still it's good to try to get the
requirements down first rather than afterwards.
Does that make more sense now?
(1) The motivation for the specifications should be part of the
document. What happened is that I had a long explanation about why it
is necessary to write and develop a container library in C, but then I
dropped it, leaving a few sentences in the "Introduction", in the
documentation.
I dropped it because I did not like a plaintive tone it had. There is
nothing to complain about, I should be positive and try to propose
solutions rather than complaining about stuff.
(2) A requirements document about the design principles that should
guide implementors is missing, and in that you are right.
For instance the sample implementation is EXTENSIBLE. If you respect
the abstract container interface you can write your OWN containers that
can be handled in the same manner as the described ones, adding some
functionality but basically allowing old code to call new code without
having to recompile or rewrite the old code. I have nowhere specified
this.
What the observers are concerned, you are again right. I have to develop
a short document that would specify what they should do, then code.
The problem is that I am used to iterate through code. I write a program
that solves something, then, thinking about it, I see some part missing,
write abstract specifications (sometimes) and then I arrive
at other, enhanced programs.
The advantage of this approach is that you see the problems that are
associated with the specifications you have in mind. The disadvantage
is that you can start into a wrong path quite easily, noticing it when
it is too late... Any modifications would make a lot of code obsolete.
For instance I started coding the containers without thinking about a
generic container class, that could be done simply by following a
specified order in the method pointers. I arrived at that conclusion
much later, and I had to rewrite ALL interfaces in the same manner, a
lot of work that could have been avoided if I had thought about making
an abstract container class before.
Thanks for your suggestion. I will try to follow it.
jacob