Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

PDF:

Object-Oriented Thinking

Wrapper Classes

Issue: 1.2 (October/November 2002)
Author: Charles Yeomans
Article Description: No description available.
Article Length (in bytes): 4,271
Starting Page Number: 36
RBD Number: 1117
Resource File(s): None
Related Web Link(s):

http://www.quantum-meruit.com/RB/

Known Limitations: None

Excerpt of article text...

The wrapper class is a standard trick of object-oriented programming. Apparently, it is so standard that I could not even find a definition of the term on the web. This may be because the notion of a wrapper class has become so general as to defy a precise definition. Nevertheless, its use is often suggested on the REALbasic mailing list to solve various problems, so it's worth a discussion.

Originally, a wrapper class was a class used to encapsulate, or wrap, a non-object thing so as to be able to treat it as an object. A first, obvious, application for RB coders is to wrap OS calls.

Declares can sometimes be tricky to get right. Once you've done so, it is frequently convenient to wrap them in a class for reuse, instead of cutting and pasting. For example, I wrote a wrapper class which reads a Macintosh application's 'SIZE' resource (project available at http://www.quantum-meruit.com/RB/). The class hides the dirty work of reading and parsing the resource inside an object with a simple interface.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com