David Pollak <[email protected]> writes:
> Folks,
>
> I spent today "cracking the code" on how to implement a more dynamic Lift
> development cycle.
Awesome!
> Specifically, I figured out how to support (during development mode)
> having changes in compiled code reflected in the running application.
> The change to your Lift app will be a change in how you do things in
> Boot.scala. Basically, anything that could change between page loads
> will be wrapped as such in Boot:
>
> LiftRules.dynamicDevelopmentMode(List("com.liftcode.model",
> "com.liftcode.lib"))(() => {
> LiftRules.dispatch.append {...}
>
> LiftRules.setSiteMap(....)
> })
>
> The list is a list of packages to exclude from the dynamic reloading.
> Because schemification isn't going to happen on every page reload, it's best
> not to reload the models.
>
> The dynamic mode will impose the following limitations:
>
> - Lift will only service one request at once in development mode
I think I can live with that
> - Page loads in development mode will be 10x-50x slower than in
> non-development mode
Is this always or just when code has changed? If always, this may be a
bit dramatic increase :-)
> - Comet objects will not change once they've been instantiated -
> There will cases where classes created in one classloader are not
> recognized as the same class for casting and/or pattern matching
> purposes if the classes are created across calls - There may be
> problems related to running out of PermGen space because each page
> reload will cause all the applications classes to be reloaded...
> and this may happen faster than the classes are GCed.
>
> With those limitations, do you guys thing the feature would be
> valuable?
As the one who probably initiated this, yes :-) I'm still unsure about
how well it works in practice. Only time will tell. It looks like it
doesn't need JRebel, which I think many consider really useful for doing
rapid development. I wonder if page/loads etc can be improved if JRebel
was used?
I think the important part now is to get the ball rolling an try it out
in real life. If the model is sound, the implementation can be
improved....
> Should it be part of development mode or should there be another demarcation
> of the dynamic reload mode?
On first look, it seems if one doesn't use dynamicDevelopmentMode there
are no drawbacks? If that's the case, I don't see the need for another
demarcation.
/Jeppe
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.