Re: MyStyle database.

Doug Alcorn (alcornd@earthlink.net)
08 Feb 1999 09:46:52 -0500


Sasha Vasko <sashav@sprintmail.com> writes:

> Doug Alcorn wrote:
> > 
> > Sasha_Vasko@osca.state.mo.us writes:
> > 
> > >
> > > The disadvantage of course is that we'll need to break compatibility with
> > > old
> > > configuration files.
> > >
> > Another disadvantage is that the Style database (aka new look file)
> > will have to be read by each module at startup time.  Could we have
> > AfterStep cache the styles in memory somewhere?  This would be a poor
> > use of memory, but would cause startup to be faster.  If all of the
> > styles were in memory, then the individual modules could just read
> > from that shared memory location.  Updating the look would then be
> 
> That makes very good sense. I'm not sure how to implement this -
> but 
> that definately will be better to store Styles in shared memory
> pool.
> 

Actually, I came up with maybe a better idea.  We could maintain a
single MyStyle database; this file would be the single look
definition.  However, to "install" a look, we could copy the entries
from this single MyStyle file into the individual module config.  This 
would allow the modules to parse their config files independantly, but 
still give the performance gain of not having to parse the main config 
file every time.

For instance, I have a MyStyle "Wharf settings" in the main MyStyle
database, when I "install the look" I a script would copy the "Wharf
settings" style from the main MyStyle database into the top of the
wharf config.  I liked this idea on Sunday afternoon when I was
driving through the snow.  Right now it sounds kinda lame.  This is
still a bunch of file edits for the installastheme to do.  

However, I worked with shared memory segments back on AIX 3.2.5.  It
was non-trivial.  There was problem with connection corruption and
improper memory destruction.  I suppose that could have been due to
sloppy programming, but the guy I was working with was pretty sharp.
It also could have been a problem with the OS and libs we were using.
We didn't have the option to upgrade to a newer OS with possible bug
fixes.  This whole thing may be a decision for the "Un-Official Buck
Stops Here" guy.

While I am thinking about it, there are some additional problems with
themes.  First, the installastheme script would have to make sure that 
the modules had the correct MyStyle defined.  Let's take my theme
Challenge.  An easy way to manage this is to name the styles
"Challenge" or possibly "Challenge Wharf", "Challenge Pager", etc.
Then, each module's config file would have to be edited to change it's 
style to "Challenge...".

-- 
 (__)  Doug Alcorn
 oo /  alcornd@earthlink.net
 |_/   dalcorn@calltech.com