This sounds good, I did something similar for an app I wrote a couple of years ago. However, lately I've just been using the CMF with a path structure for the config value. This makes things very flexible and it seems appropriate since it's basically just reading and writing values with fixed identifiers.

On 23 May 2007, at 23:13, David HM Spector wrote:

I'm thinking about a general purpose system control panel for my app.
I'd rather not use the Java config storage system since it stores
its data on the local file system (problematic if I run the app across
multiple web servers), what I was thinking is a simple string based DB table that I can add to as I add features to the system, and at the same time not make it so complex that there's all sorts of conditional code required
to display it.  What I was thinking is a table like this:

table SysOpParams {
area String(64); // A string indicating what part of the system (Ads, access, news, faqs...) this parameter is form. Each
"area"
                                               // is a collection of
params grouped together visually by the System Control Panel Element
   param_name  String(64);     // name of system parameter. E.g.,
MAX_NEWS_ITEMS, ALLOW_LOGINS, ALLOW_COMMENTS, etc.
l10n_key String(64); // a key that can be used to localize
the control panel labels
   actual_type    String(16);     //  the actual type of the object
represented, one of: "float", "int", "boolean", "string"
   value              Text;              // the operational value,
stored as a string
value_default Text; // the default value, stored as a string
   value_min      Text;              // the min value (where
applicable), stored as a string
value_max Text; // the max value (where applicable),
stored as a string
}

of course this pushes the multi-web-server sync problem up a layer...
but seems like a cleaner solution since the data are only in one place... the only big issue is how to make these data loadable and persistent at app startup like the repository so I am not continuously beating on the
DB...
multiple server instances could be told to re-sync via a listener.

Use Terracotta! Just create in in-memory pojo structure that is populated from DB and that is persisted to it too. However, the declare the memory structure as a shared root and Terracotta will automatically cluster it out to all your nodes.


thoughts? reasonable general solution, or am I way off in the weeds..?

David

_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to