Hi Matthias,

> For example, for the new site that I'm developing, the only information that
> I can see is needed to be stored between requests in the session objects is
> whether the user is logged in or not (and his/her user-id). For such a site,
> is something like Wicket overkill in terms of state management? The homepage
> talks about how the "back-button"-problem is solved, but with my
> requirements I can't even see where the problem is. Why should I care where
> the user is when each request is independent?

You have different kind of models to feed your components. If you want
to keep your state exclusively inside the db, you can always use a
LoadableDetachableModel that brings it from the db upon every request
by simply overriding a load() method. Some stuff will still be kept in
the session, of course, as your component hierarchy, but nothing
really data-intensive. That said, if you do things like field by field
ajax-validation, for example, sometimes it's very convenient and
natural to kept the entire form state in the session. With models you
can choose on a case by case basis. As you, at first I was reluctant
to store my domain objects inside the session, but in practice I found
the approach of making them Serializable and keeping them as
field-members of my forms more natural and somewhat easy-going. I
think you can fine-tune the page and version cache parameters too,
although I've never done that.

> And one more specific question regarding Wicket template system. For my web
> application, I'll most likely need some part of each page that either
> displays some information about the logged in user, or otherwise a form
> allowing the user to log in. With some other framework, I'd have a

You can define a couple of components, one for each case, and -say- a
static helper method like Helpers.addLoginComponent(page) that decides
which one to instantiate and add. Or you can add this logic to the
constructor of a base page class which you inherit from every class in
you application. Etc. Namely, logic is done java-side, you have the
full power of java and ooad at your disposal.

My 2c.

Cheers,
Carlos

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to