View Single Post
Old Jan 31st, 2007, 7:51 AM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
Hiding code away within black box is exactly what object orientation is all about.
I disagree. Object orientation is about building things as objects. The encapsulation may be used to protect parts of the object from unintended use, if one wants to call that hiding. Don't attach a spring to the butterfly valve in my carburetor in order to make a gauge showing how much the accelerator is depressed. Find another way or ask me to expose something suitable. Similarly, enclosing a carburetor in a spherical rubber case is a silly, though perhaps interesting, way to make a basketball.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote