Encapsulate That!

Error message

  • Strict warning: Declaration of role_expire_handler_field_rid::pre_render() should be compatible with views_handler_field::pre_render(&$values) in require_once() (line 83 of /home2/netobje2/public_html/sites/all/modules/role_expire-7.x-1.0-beta2/role_expire/role_expire.views.inc).
  • Strict warning: Only variables should be passed by reference in eval() (line 3 of /home2/netobje2/public_html/modules/php/php.module(80) : eval()'d code).

Encapsulation is a word that’s been with us in software development for a long time; but if you asked people what it means, many would say something like “hiding data”. In fact, there are quite a few books and websites that would use that as the definition of the word. However, we have found that an examination of the true meaning of encapsulation can be enormously beneficial and can make many other aspects of Object-Oriented design (design patterns, for instance) easier to understand and to use.

We’ll begin simply, by showing encapsulation in its most obvious and straightforward forms, and then expand these concepts into the patterns, and all the qualities of code that make it fundamentally easier to maintain, debug, enhance, and scale. What we will see is that encapsulation, given its more useful definition, is a fundamental, first principle of OO.

All the Details

Type:
Article
Published:
Wednesday, December 10, 2008
Author: