Re: OO as a Form of Modular Programming



Howard Brazee wrote:
Larger modules are easier to work with. A house built with modular
rooms goes together faster than a house built with modular walls. And
objects go together faster than COMPUTE statements which go together
faster than assembler which replace machine language.

Modules can also be stronger and safer - that modular wall could have
been built in ideal conditions and tested before being incorporated in
the house.

You're right - but that's where the "inheritance" principle in OO comes in. A "room" will have 4 or more "wall" object, who themselves may have "window" or "door" objects. While the room may be quite specific, the lower-level components, such as doors or windows, are more generic. Just because the room isn't assembled at the job site doesn't mean that it didn't have to get assembled somewhere. :)

And, your room analogy illustrates another advantage of OO design. Companies can combine low-level components into functional "larger modules", which themselves can become the lower-level components of an even larger module - for example, a house.

Certainly objects are a type of module - with more power and utility
than paragraphs and copy members.

The biggest problems we'd really started to run into was the global nature of COBOL variables. Now yes, I know you don't have to do it that way, but most people don't even know about nested subprograms, and even fewer use them in their design and construction. We had a terrible time with either left-over data, or data that was changed out from under the application program.

OO solves that dilemma by encapsulating the data with the code. The more I use it, the more I like it. :) And now, when I look at doing something in COBOL, I find myself thinking in nested subprograms instead of paragraphs.

(not that any of this is new to you - your post just brought those thoughts to mind...)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Albuquerque, NM! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"Who is more irrational? A man who believes in a God he doesn't see, or a man who's offended by a God he doesn't believe in?" - Brad Stine
.



Relevant Pages