Is it possible to develop a good object model without having a use-case
scenario? Uh, no. Is it possible to develop a good object model (OM) without
writing some code that will use it first (or
three in the case of a public framework)? No.
I think it is a classic mistake to just architect what you think will be a
great OM on paper. What almost always happens is that it and turns out to be
virtually unusable or very difficult to use - certainly not all you hoped and
dreamed for when you started. You have to think through and at least pseudocode
a client app first - or very least in parallel. I read a post about this last
year where Chris Sells
called this
Client-Driven Development (CDD). I'm glad he give this concept a
formal name. Like
Test-Driven
Development (TDD), this is certainly not something most of use learned in
college or writing classic VB apps. Personally, I've found the concept of CDD to
be true over time starting with making mistakes at my
first job as
doing some C++ development. Funny how they started giving out OO design tests
~6mo after we started on a particular project, but I digress...TDD is something
that I've only recently adopted (within the last 12-18 months) and you don't
have to use NUnit to adopt this philosophy. Why am I writing about this? My
Framework Design Guidelines book and some blog feedback got me thinking
about it. What I took away from that book was that creating too many
abstractions, and certainly abstractions without any concrete implementations,
is bad. The authors and annotators make that abundantly clear. However, what
seems to be more obvious but is at the same time a huge riddle wrapped in an
enigma to most people (Mort especially) is that you have to "design before you
implement." That does not mean design an OM on its own and then write the
code. Designing your OM properly is to design how it will be used, not
how it will be implemented. Of course it would be very nice to have a
nice, clean OM. But what the Framework Design Guidelines emphasize even more is
that it has to be very usable to the client. This is true for even n-tier,
layered, DNA, or whatever buzzword architecture you choose. Along with great
power comes great responsibility. :-)
Have you adopted the concept of CDD? TDD? Other? How is it working out for
you?