Tuesday, February 28, 2006

 

Encapsulation Isn't Data Hiding

C. Keith Ray has a nice short post on what "encapsulation" really is.

I still run into far too many programmers who think that "encapsulation" just means making the data members private and writing a pair of get/set functions for each one. When I ask them what's good about that practice, they usually answer that they don't know, but that's what makes their code object-oriented. <sigh>


Comments:
I have come accross the same thing on more occasions than I care to count. What most amazes me is OOP really is not difficult to understand, especially to university leavers who do not have years of procedural programming under their belts. Yet the frequency of lack of understanding OOP from many graduates worries me.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?