Re: More CChildFrame questions
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Fri, 22 Jun 2007 12:03:39 -0400
You can write a bad FORTRAN program in any language, including UML.
joe
On Fri, 22 Jun 2007 16:40:44 +0100, "GT" <ContactGT_remove_@xxxxxxxxxxx> wrote:
[snip] - I / We have sorted the original problem, but I feel the need toJoseph M. Newcomer [MVP]
defend myself / UML:
UML is simply a language - we cannot blame UML for bad design. We can only
blame bad designers for bad design. You have obviously encountered work from
many bad designers who chose to document their work using the UML,
unfortunately!
OO/UML projects are completely iterative - the design is not finished until
the product is released. In this case a coding issue has fed more
information back to the static design (class design) and the design has
evolved. This is how UML is supposed to work.
Note that if you "know UML" then why didn't UML tell you that your design
was bad?
UML can't prove a design will work - its just a language to enable visual
representation of analysis, design, testing etc. In my case, the design
looked fine at the point of documenting it - I had a view class containing
all the methods and variables that belong with that view. That view class
was shown at one side of an association. At the other end of the association
was a frame, which could be a docking pane or CChildFrame. I did not know
that the view-frame relationship is actually a composition, whereby the part
(view) is destroyed along with the whole (frame). My design was not bad, it
was just not refined enough! I had used the UML to document a conceptual
class which in reality (coding time) has turned into 2 concrete classes! We
have effectively enhanced the original UML design using a variant of the
State pattern.
This
is what I meant by "Voodoo design". You can create all the UML diagrams
in the world, and
they don't tell you that you have confused two orthogonal concepts!
They don't need to - either experience will prevail and someone will modify
the design before coding starts (you in the case below), or (as in this
case) coding will throw up a problem which will feed back into the design.
I've had to review designs done by "UML Experts" and they are uniformly
bad designs.
That doesn't mean the experts didn't do the UML properly - it just means
they didn't do their design very well!
Pretty pictures picturing bad designs doesn't contribute to the design
process, and they
were convinced that because they had pretty pictures, they had good
designs. One project
I worked on had a set of UML diagrams which ran for 20 pages claimed to
enumerate all the
possible state transitions; we found six that they hadn't considered, and
in fact were not
handled by their code; the only effort we had to spend was reading those
20 tedious pages
to make sure that each of our cases wasn't actually covered. But the
diagrams were quite
pretty. Useless, but pretty.
I would suggest that the diagrams were not useless, they were simply not
complete. It is not normal to have to go through pages and pages of
statechart diagrams - these are usually used to 'flesh out' the static
model, one per class and ONLY when necessary! Why they needed to produce 20+
statechart diagrams does not make sense - bad use of UML!
We wrote the state machine as an FSM diagram and studied the code and
realized that they
had not designed from a formal model, just an enumeration of all the
states they had
thought of, and so we went back to verify that it all was consistent, and
it wasn't. But
when we wrote our critique, the answer came back that "the design is
complete and we have
the UML diagrams to prove it", and it took weeks of arguing with their
manager that the
code was wrong before he was willing to accept that the code couldn't
work. We finally
generated a test case that locked the code up into a non-recoverable
state. Since this
code would run in an embedded system, this would have been a serious bug
requiring a
massive recall, had it actually shipped.
Sounds like they didn't know what they were doing!
I've hit a lot of UML "True Believers" and as far as I can tell, every one
of them thought
that if they used UML their design would be correct, and in NO case have I
found a correct
design as a result. In these cases, the code accurately reflected the
design, and the
code was uniformly wrong. In addition, it usually reflected fundamental
bad design such
as violation of abstraction boundaries, poor control constructs, poor data
abstraction,
and so on.
joe
Sounds like you don't like the UML due to bad experiences, but I would like
to defend the language as it is simply that - a modelling language. It has
industry wide acceptance, but unfortunately not everyone in the industry
uses it properly and/or knows what they are doing! I should include myself
in the last category over this particular problem!!
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: More CChildFrame questions
- From: Tom Serface
- Re: More CChildFrame questions
- From: GT
- Re: More CChildFrame questions
- References:
- More CChildFrame questions
- From: GT
- Re: More CChildFrame questions
- From: Ajay Kalra
- Re: More CChildFrame questions
- From: GT
- Re: More CChildFrame questions
- From: David Wilkinson
- Re: More CChildFrame questions
- From: GT
- Re: More CChildFrame questions
- From: Joseph M . Newcomer
- Re: More CChildFrame questions
- From: GT
- Re: More CChildFrame questions
- From: Joseph M . Newcomer
- Re: More CChildFrame questions
- From: GT
- More CChildFrame questions
- Prev by Date: Re: More CChildFrame questions
- Next by Date: Re: More CChildFrame questions
- Previous by thread: Re: More CChildFrame questions
- Next by thread: Re: More CChildFrame questions
- Index(es):
Relevant Pages
|