So, I found a couple things that weren't quite working right for me
which I plan to modify a little bit, but as I thought about this more
I'd like to suggest that we consider these 5 phases of the app lifecycle
(at least these 5 for now) ...
1. preparation - app being prepared to be bootstrapped (install/ugprade
stuff happens here)
2. bootstrap - wiring up the backend so the app can function
3. initialization - initializing services, such as starting background
tasks, etc
4. app running - pretty self explanatory
5. shutdown - again, pretty simple
Breaking that down into actual code I see things working something like
this ...
1. preparation - RollerStartup (or something) controls this phase. key
requirement is that we can't rely on the app being bootstrapped here.
most work will be just with raw sql and services outside of the
Weblogger business tier such as the database provider and config.
2. bootstrap - RollerFactory controls this phase. key requirement is
that preparation is considered to have been done already.
3. initialization - the Roller instance should control this. key
requirement is that bootstrapping has already been done.
4. app running - work is done by Roller instance. technically only
bootstrapping is required for this, not initialization.
5. shutdown - Roller instance controls this. bootstrapping has to have
happened for this to work.
So, to accomplish this I want to make a couple simple tweaks to what we
have now ...
1. create the RollerStartup class so that preparation work can be
managed there. this is the only piece we are really missing right now
and we have all of Dave's new EZ install code, it just needs to be
managed through this class.
2. tidy up RollerFactory a little bit to make bootstrapping process
simple and clear. i already have this in my workspace.
3. setup initialization process through Roller instance. this is really
just the complement to the Roller.shutdown() method, so I plan to add a
Roller.init() method and add that method to our existing manager methods
so that this happens in the most logical fashion. again, this is just a
small amount of code shuffling, not much new code.
That's pretty much it. The only other thing is some restructuring of
the RollerContext which is the normal place where we run through these
phases.
sound good?
-- Allen
Dave wrote:
Comments below...
On 6/19/07, Allen Gilliland <[EMAIL PROTECTED]> wrote:
One thing I am a little unsure of from looking at the code is what the
expected behavior is meant to be for the 'manual' vs. 'auto' install
types. This is what I would expect, let me know if this matches what
you are thinking ...
if( install == 'auto' ) {
if( install/upgrade required ) {
// skip bootstrapping/initialization and wait for user involvement
} else {
// app is up to date, so startup as usual
}
} else {
// startup app as usual
}
Yes, that is correct.
The "manual" mode is supposed to work exactly as Roller did before.
For example, in manual mode the database upgrade code does not run the
database upgrade scripts.
So a couple things that I am expecting in particular are that if the
install type is set to 'manual' then we don't do any special
install/upgrade logic. Also, if the install type is 'auto' and we
recognize that there is work still needed, then we are requiring user
involvement, namely for the user to actually click a button indicating
that they want to do the install/upgrade.
Assuming that's correct then I have a few things to commit around this.
I'm working on the Guice branch today so you won't be stepping on my
toes if you want to make improvements/fixes.
- Dave