> These are the alternatives I've thought of myself.
>
> Alternative #1: (Use the database)
>
> I could store all the enumerations in a table, that maps indexes
> to labels. Each set of labels would have to be a seperate label. In
> other words, I could have a table called "user_types" that holds the
> above strings, and a primary key for each label.
>
> Advantages:
> The enumerated type is configurable.
>
> Disadvantages:
> It seems overkill. While the enumerated types are configurable,
> that's either another WO screen of detail to administrate, or some
> SQL hacking. Also, there's no good way to map back and forth between
> the type information stored in the database and the code.
> In practice, your WOApplication object either needs to fetch the
> list of user types on startup, or you need to have a WODisplaygroup
> for each popup. If you fetch the list of user types on startup, you
> need to update the list if it gets added/subtracted from...
> So this method is appropriate for some things, but not others. In
> my case, I could also store in the "user-type" table what steps are
> appropriate to take for that type by default, and have a completely
> customizable user set. I thought that was overkill, which was why I
> didn't do that!
>
> What have y'all done in similar situations? Is there something I
> haven't thought of?

I always use the above. It makes it much easier to adapt the program
to changes, and lets you sometimes do things with a simple db mod
that otherwise require building a new app. Even better,  components
developed for one application can work in another, simply by referring
to a table populated with different strings.

If you select cache in memory in the EOModel, then performance
degradations is negligible. The WODisplayGroups can be shared
across the entire WO app to save resources. This way, you can
shut down a WO app with WOMonitor, and new sessions start up
a new WO app, which is the way to force reading in an updated
set of types from the table. This may seem cumbersome, but it
beats compiling and installing a new version of the app...

Ronald
==============================================================================
"The reasonable man adapts himself to the world; the unreasonable one persists
in trying to adapt the world to himself. Therefore all progress depends on the
unreasonable man."  G.B. Shaw   |   [EMAIL PROTECTED]   |   NeXT-mail welcome

Reply via email to