start | find | index | login or register | edit
by earl, 6356 days ago
- create the visit as late as possible
Engine.getVisit() returns null if visit was not created before,
Engine.getVisit( cycle ) creates the visit, if it does not exist
BasePage.getVisit() cascades to Engine.getVisit( cycle ) !!
use the getEngine().getVisit() to simple read information from the visit, use any of the latter two, when you store information into the visit.

- what is the advantage of making Visit serializable? [transparent clustering?!]

- when making visit serializable:
1) keep serialized fields small. example: storing the user information in visit.
add two attributes: the user obj itself and a key sufficient to retrieving the user obj. make the user obj attribute transient (private transient User user). if user == null (re)retrieve the full obj.
2) check isAuthenticated() against the key attribute, not the obj itself

- to make a set of protected pages, derive a own class from BasePage (i.e. ProtectedPage)
powered by vanilla
echo earlZstrainYat|tr ZY @. • esa3 • online for 7099 days • c'est un vanilla site