|
![](/i/fill.gif) |
Warp wrote:
> There really *are* design patterns which might sound obvious to you
> and me, but are not all that obvious to many programmers who are starting
> to dig into OOP.
>
> One example I like (and which name I rather ironically cannot remember
> now) is the design pattern which you can use to create primitives and
> unions of primitives, so that the union itself is a primitive (thus
> allowing a union to contain other unions, containing other unions,
> thus forming a whole hierarchy of primitives).
It's called Container or Composite or something like that. (Also related
to the Decorator pattern - although that does the same thing for a
different reason.)
> This is a simple idea and might be obvious to some, but it certainly
> might not obvious to the new OO programmer.
Many good ideas seem obvious *after* somebody told you. ;-)
For example, (A*B)^2 - 4*(A+B) = (A-B)^2. Obvious once you know, but
DAMN... I've have never thought of it!
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |