Quote:
> Ever since I started wading out into the OOP pool, I've been
> constantly coming up against "Design Patterns". Is this a OOP-unique
> concept / construct, or are there design patterns for the non-OOP
> (structured?) paradigm?
None I would have heard of. But even though I do code in C most of the
time, I decided to get the original book on Design Patterns by that
fabulous "gang of four", and found that although many of the ideas do
indeed center on inheritance and other OOP concepts, there's quite a
large fraction of them that make sense from a Structured Programming
point of view, too. Just replace every occurence of 'inheritance' by
usage of a finely crafted function pointer, and you'll be in the game.
Actually, quite a lot of the stuff they write points *away* from the
usual OOP view of "everything is inheritance", and towards object
containment as a frequently preferrable alternative. And that's even
easier to model in C than inheritance.
The real tie I found between OOP and Design Patterns is that both are,
at least partly, seen as ways of solving the "big projects" problem
more easily. These days, it's considered a bad idea to do any such
big project in anything else but OOP, and thus C++. It probably never
occured to those guys that these ideas would be valid for plain old C
programs, too :-)
--
Even if all the snow were burnt, ashes would remain.
--