Sujet : Re: Code Reuse (was Re: The Continuous Amnesia Issue)
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.miscDate : 17. Apr 2024, 15:37:15
Autres entêtes
Organisation : Stefan Ram
Message-ID : <open-20240417153428@ram.dialup.fu-berlin.de>
References : 1 2 3 4
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
- Leverage them design patterns, architecture principles,
and software frameworks
The "Open-Closed Principle" is really ticklin' my fancy here.
The idea is that software entities should be open for extension,
but closed for modification.
But then you got Uncle Bob comin' in with his two cents,
sayin' that procedural software is a cinch to tack on more
verbs (procedures/functions), but a real headache when it
comes to addin' new data types. Flip that around, and you got
object-oriented software - a piece of cake for the data types,
but a real bear when you wanna slap on some new verbs (method
names).
Now, I know what you're all thinkin' - "Stefan, you're really
speakin' my language here, but what the heck do you mean by
'open for extension, but closed for modification'?"
Well, let me break it down for ya: Imagine you got this ol' software
program, right? And you wanna add some new bells and whistles to
it, but you don't wanna go messin' with the core guts of the thing.
That's where the "open for extension" part comes in - you wanna make
it easy to tack on new features without havin' to rip the whole darn
thing apart.
But then you got the "closed for modification" bit - you don't want
just any ol' Tom, Dick, or Harry comin' in and start tweakin' the
fundamental workings of your software. That's a one-way ticket to
Bugsville, my friends.
So, in a nutshell, you wanna make your software flexible enough
to grow and evolve, but sturdy enough to keep the foundation
intact. Kinda like building a house - you want the walls to
be strong and sturdy, but the decor and layout should be easy to
change up as your needs evolve.