Abstraction and Encapsulation
ColdFusion
OO design is a pretty new concept to me. Not too long ago, I was asking "What is an object?" "What does it 'look' like?" I was doing some reading the other day and came across a really good real-world example of the two OO concepts Abstraction and Encapsulation.
Abstraction: An object should be designed so that it knows how it does what it does, and should only be asked to do ___(whatever that thing is).
Encapsulation: An object should not expect some other "thing" to be available. It should be able to function without any dependencies.
From BarneyBlog: Designing an OO Backend
Abstraction: An object should be designed so that it knows how it does what it does, and should only be asked to do ___(whatever that thing is).
Encapsulation: An object should not expect some other "thing" to be available. It should be able to function without any dependencies.
From BarneyBlog: Designing an OO Backend
The "black box" on an commercial airliner is a good example of both. Everyone knows what it does (records everything about the plane), but most people don't know how (for instance, what's the recording media?), and it's also totally self contained so that if the plane completely breaks, it'll keep functioning.




Loading....