i saw this thread on wicket-user today and wanted to comment on
client-side state.

i think the right thing for wicket is to support a generalized interface for
storing session state.  it could be that the existing ISessionStore interface
or some modification of it is sufficient.  but whatever the interface, all we
need to do is start providing pluggable implementations.  the possibilities
are endless, but a few include:

 - HttpSessionStore
 - ClientPostBackSessionStore
 - CookieSessionStore
 - UrlSessionStore
 - DatabaseSessionStore

and so on... this should be very straightforward and elegant to do with our design.
it could also be that a re-think of the ISessionStore interface would help to make
this more elegant.  without really thinking it through, i'd say it might look more like:

public interface ISessionStore
{
    PageMap newPageMap(String name);
    PageMap getPageMap(String name);
    List<PageMap> getPageMaps();
    IPageMapStore getPageMapStore(PageMap);
}

public interface IPageMapStore
{
    void setPageMapEntry(IPageMapEntry entry);
    IPageMapEntry getPageMapEntry(int id);  
}

probably the same object would implement both interfaces.  and then
the ISessionStore interface would be retrieved by an overridable method
in application that returns:

public interface ISessionStoreLocator
{
    ISessionStore forRequest(Request request);
}

probably that could be implemented by the same object in many cases too.
this would get rid of all the dependencies on unabstracted concepts like
"attributes".

     jon

Reply via email to