Alex Hunsley said:
Why bother with the word "demonstration"? Wouldn't the words "act of
showing or making evident" have done just as well?
Indeed, but no one misunderstood me because I said "demonstration".
The problem here is not with definitions, but rather with taking a set
of several design decisions that are demonstrated together in some book,
and using a single word to refer to all of them. To be fair, there's
often (though not always) some degree of synergy between the various
design decisions demonstrated in a pattern. Nevertheless, their primary
benefit is that you've now seen each of those design decisions being
made, and what implications they had, at least in a very limited
context.
No, it wouldn't have hurt. It's a trade-off - if someone knows the
principle already, by a certain name, it can be simpler to be terse, if
you believe they are going to know what you mean.
And I am disputing that there is "a" principle here. My copy of the GoF
book defines Flyweight using an inheritance tree for the flyweight class
and a separate factory class which are in no way related to the idea of
sharing objects, as well as implying some kind of hierarchical
composition which certainly isn't relevant to your point, but is
nevertheless very often associated with this pattern name in people I've
talked to. Though I've often used shared objects, I can't recall ever
using the whole set of classes in this book.
And that's the point. Your comment was not about Flyweight, but about
the performance cost of creating a large number of objects. The term
"Flyweight" is, in my experience, pretty much useless in terms of real
design discussions because of all this conceptual baggage that quite
rarely comes together in exactly that way. Flyweight is a bit extreme
in that sense, but the general idea applies to most patterns (and, when
it doesn't, the "pattern" name was generally in wide use prior to anyone
writing a patterns book anyway).
I think you're jumping the gun a little here.
And I figured you would probably think so. If you didn't disagree with
me, it would have been a little silly for you to have written that prior
message.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation