Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

Print:
PDF:

Object-Oriented Thinking

Window Objects

Visual Coding Is Not Just For Controls

Issue: 4.4 (March/April 2006)
Author: Charles Yeomans
Article Description: No description available.
Article Length (in bytes): 4,718
Starting Page Number: 37
RBD Number: 4415
Resource File(s): None
Related Web Link(s):

http://www.declareSub.com/

Known Limitations: None

Excerpt of article text...

An oft-overlooked feature of the REALbasic IDE is the ability to drop objects other than controls onto windows. This is really quite powerful. In conjunction with events, you can do things that would otherwise be ugly or even impossible. Let's take a look at an example from my own code.

Most of the software I write makes heavy use of the Observer pattern. In short, this pattern provides solutions to the problem of communicating changes in the state of one object to other objects. To offer a concrete example, consider some sort of accounting software. When an account name is changed, menus that list accounts might want to be notified. When a transaction is entered or modified, open reports need to be notified so that they can update themselves.

The basic pattern is to maintain notifier objects with which objects that wish to be notified can register themselves. For example, I have an AccountManager object with methods like AddUpdateReceiver(theReceiver as UpdateReceiver). UpdateReceiver is a class interface to be implemented by objects seeking to be notified of updates. It has a single method HandleUpdate(theObject as PersistentObject).

...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