click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject Proposal: drop stateful page support
Date Sun, 18 Jul 2010 04:47:12 GMT
Stateful pages have been giving me headaches ever since they were introduced in 1.4/1.5 and
proposing that we remove them.

Stateful pages not only complicate the Click codebase but conceptually they are difficult
understand compared to a stateless page which starts every request with a clean slate.

I also think they are too easy to use (and abuse). Consider this scenario: you have a table
sort and paging state that you want to store while the user navigates between pages. The obvious
answer is to make the page stateful. However, not only is the table sort and paging state
but the entire Page including its model Map, control List, i18n messages and every Page variable
stored as well. And all you really wanted was to store 4 objects in the session.

I propose we deprecate the method Page.setStateful for 2.3.0-M1. Sadly there isn't any upgrade
for existing code bases. Stateful pages simply have to be converted to stateless Pages and
the view
state will have to be managed by the users or custom Controls that manage their state themselves.

Any objections? ;)



View raw message