From: <an...@io...> - 2005-07-16 12:41:19
|
Chris Winters wrote: > There's nothing stopping us from replacing the prototype in that map > with a lazy loading routine. On the first access it will go through the > same functions currently in OI2::Setup::InitializeActions (which is > fairly minimal). Could we instead follow the same route which is planned for SPOPS objects and generate each action in advance to a file? We would generate OpenInteract2/Action/Xxx/action_name.pm (and possibly others) which would inherit OpenInteract2::Action::Xxx and set all the properties and params in new(). I think this would make it easier to detect code changes without restarting the server - maybe as easily as by setting Apache::Reload as PerlInitHandler. > Doing this for SPOPS is much trickier (and probably undoable) because > of the dependencies -- if an object contains other objects we need to > make sure the contained is loaded, and if the contained contains other > objects we need to ensure THAT is loaded.... yuck. Would this be easier if the SPOPS objects were generated to the filesystem and use/require all the objects it relates to? > Regarding restarting Apache, this is very difficult due to SPOPS and > the fact that it generates code at runtime. There's been a longstanding > request to store the generated code into modules on the filesystem and > I think that would solve the difficult reload issue. I couldn't find a jira issue for this.. Should this be scheduled for some releasse? What about the same for actions? And translation files? If those can be stored in the filesystem, are we left with any code generation at startup? Does template handling do any? Would it be a reasonable goal to get rid of _all_ code generation at startup and generate all the code to files? This generation could ofcourse be initiated also at the beginning of startup when in production, but we would have the option to do it beforehand and only paritially. I know that on the fly code generation is not black magic ;) but it would also be easier to understand and inspect (and control) the flow of execution if %INC would be populated properly. - Antti |