> >
> > custom session: yes, very easy in Wicket. Just subclass it and provide
> > your type safe getter and setter. However, you are right, you can
> > simply plug and play the component. A pnp component would have to use
> > a non-type safe approach. IMO it isn't that worse, because it would
> > all be encpasulated in a single (your) component and the app-author
> > wouldn't have to be concerned at all.
> >
> > you are free to develop a nameing convention to store and access
> > information in wickets session object and thus to prevent accidental
> > changes. We currently do nt provide it (as far as I know).
> >
> 
> So I'd have a (public) method saveModel(String someKey, IModel model) on
> the Session and override detacheModel() on the Panels. Is detacheModel()
> only called when the whole Session is transferred? I do not have a use
> case but just for curiosity how would you handle the case where there is
> an instance specific model and a shared model?
> 

Use cases for detached models are e.g. database data. As the data are
already stored in the database there is no need to keep them in the
model, and potentially copy them across a cluster. Model data get
detached / released at the end of the request and re-attached at the
beginning of the next request. Remember there may be minutes between
requests and you may not want to keep all the data in memory.

If think your use case is different. Wicket always creates a session
because it maintains the component hierarchy across requests. Your
component could very easily be based on a shared model maintained in
the session and you don't have to care about relasing it from session,
because wicket takes care of releasing the session (and your model).
IMO it is straightforward and very easy.
.
Juergen


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to