Advice: Plugin preference strategy
Advice: Plugin preference strategy
- Subject: Advice: Plugin preference strategy
- From: John Pannell <email@hidden>
- Date: Thu, 2 Feb 2006 14:55:55 -0700
Hi all-
I've been re-designing the architecture for my app, and have hit a
question mark in the road related to plug-in bundles, application
preferences, and subprocesses. While I'm confident that I have a
solution, I'm concerned it may not be the *best* solution. Here's a
brief outline of the issues; I'm grateful for any insights or
suggestions anyone can offer!
My application consists of a number of interconnected pieces: the
application that people launch is responsible for the UI the people
see and work with, including the preferences for the application.
The application can host plug-ins to extend the app, and loads all
found plug-ins for the purpose of exposing them in the preferences.
Ideally, the user can configure the plug-ins, and I (and eventually
other developers) will provide nib-based UI in the plug-in bundle for
such a purpose. Note that the application doesn't actually *use* the
plug-in - it simply provides a way to configure the plug-in.
The application, during operation, creates a number of subprocesses
(not threads) that are instances of another faceless application that
are managed via distributed objects. These subprocesses are
instructed to load *one* of the plug-ins (as chosen by the user
during operation of the app), and will need access to this plug-in's
configuration prefs to operate properly.
The question... where to keep the plug-in prefs?
The application needs to be able to read and write these preferences,
while the faceless subprocess app need only read them. Anyone who
writes a plug-in needs to be able to specify the defaults and
whatever solution is used must allow evolution of defaults over time.
My current idea for a solution (no implementation yet) is to keep
plug-in prefs as individual dictionaries inside the NSUserDefaults
for the main UI app. They would be named by the bundle identifier
for the plug-in. This way the app can read and write, and I suppose
the subprocess could query the app for info (I could use
addSuiteNamed: to read the app prefs from the subprocess, but I
believe I would get sync problems, as the app keeps new values cached).
Something feels wrong about this to me, however. What if a single
plug-in corrupts the all of the prefs? It seems to me like I want
each plug-in to have its own prefs file, but I do not see a clean way
to do it...
If anyone has any experience with these topics or more insight,
please let me know... sorry for the long post!
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden