On Mar 6, 2006, at 10:47 AM, Theodore H. Smith wrote:
So for speed purposes, it will often be much more efficient to not
force the class to return results which are not necessary.
So how to do manage this?
How can I signify that these methods should only be called during
the event, is there a good naming convention? Something like
"WhereDuringEvent() as string"?
Or can I hide the methods somehow that should not be called outside
of the event, so that they can only be called during the event?
Maybe return a typecasted version of my "SuperSearch" instance, as
a class interface with a public declaration of a private method?
That is "WhereWasTheItemFound() as string" would be a private
method, but exposed via a class interface that it implements?
Interesting problem eh?
Whenever possible, I try to model my classes off of one of the core
REALbasic classes -- it stands to reason that the original author of
that particular class had a reason to implement it that way and that
it was designed to integrate with the other classes and controls.
So for this example, you could use the HTTPSocket class as a model...
it works quite well with the events when you drag it like a control
to the window, but it will also work when a user creates a HTTPSocket
subclass to implement the events.
Using this technique may not be the best or the most efficient, but
it seems to work very well in my own projects.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>