Am 31.03.2005 um 16:56 schrieb Thomas Reed <tareedlists at mac dot com>:
On Mar 31, 2005, at 6:00 AM, Beatrix Willius wrote:
How can I implement this better:
I'm partial to Apple's solution to this problem in the Core Foundation
on Mac OS X.
Yes, I am aware of the Core Foundation stuff and use this already.
If you're doing cross-platform work, though, you can mimic this
behavior with a class that reads from a file into a dictionary pretty
easily. Somebody (Kevin Ballard, maybe?) has a class for turning XML
into a dictionary and vice versa, though I forget what it's called and
have never used it.
This looks like the way to be cross plattform.
Beyond that, I wouldn't get complicated with it. You mentioned
factories and whatnot -- too messy. Not needed. Remember, whatever is
accessing a particular preference should know what to do with it better
than your abstracted preferences class!
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.
Mit freundlichen Grüßen/Regards
Trixi Willius
http://www.mothsoftware.com
Mail Archiver X: archive, clean and search email
http://www.beatrixwillius.de
Fractals, 3d landscapes etc.
_______________________________________________
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>
|