realbasic-nug
[Top] [All Lists]

Re: How to handle prefs with OO

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How to handle prefs with OO
From: Thomas Reed <tareedlists at mac dot com>
Date: Thu, 31 Mar 2005 22:12:06 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050331145657 dot 6E66E8113B0 at lists dot realsoftware dot com> <b2f7f92d1021886259cac89592cee894 at gmx dot de>
On Mar 31, 2005, at 1:20 PM, Beatrix Willius wrote:

You mentioned
factories and whatnot -- too messy.  Not needed.

I have lots of code like:

if MailClient = "AppleMail" then
'do something
elseif MailClient = "Entourage" then
'do something else
'more mail clients, even more to be added
end if

I really want to get rid of this. To add a new MailClient I need to change code in about 10 places. So I would like to know why is the factory approach is too complicated.

Well, what you're describing is totally separate from preference handling. You're talking about how to respond to the data contained within one particular preference. There's nothing wrong with using a factory to build an object in this case, but this decision is going to be specific to each individual preference. I thought you were talking about trying to create some sort of general-purpose preferences system that used a factory.

-Thomas

Personal web page: <http://homepage.mac.com/thomasareed/> My shareware: <http://www.bitjuggler.com/> Free REALbasic code: <http://www.bitjuggler.com/extra/>

There are 10 kinds of people in the world -- those who understand binary
numbers and those who don't.

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

<Prev in Thread] Current Thread [Next in Thread>