Hello all,

this question is not directed solely at Wicket, but extends beyond that to web app architecture and best practices. I have been working mostly with the open-session-in-view pattern and Wicket's loadable detachable models backed with Hibernate or similar ORM for my applications.

This combination works fairly well until one starts to deal with transient objects that may at some point become persistent, and have references to other objects that already are persistent in the database. This object graph composed of a mix of persistent and transient cannot safely be serialized, nor can references to transient objects be removed at detach phase as they would then be lost.

These situations usually arise in AJAX or Wizard-style scenarios. I have dealt with them in various ways, but have not yet found a way that I am really satisfied with: 1) always persist objects (undesirable in many cases as it might require you to drop integrity constraints and do additional filtering when fetching objects from the database to avoid "incomplete" instances or additional tables and therefore overhead) 2) clear references to persistent objects and store that information elsewhere (eg. in the model) 3) avoid setting references to the persistent instances in the transient one to begin with (and again store IDs or models of selected persistent objects elsewhere) 4) deviate from open-session-in-view pattern on certain pages (may cause you to run out of database connections or force you to deal with database timeouts etc.)

I don't think I am the only one running into these kinds of issues, so I'd like to hear which patterns other developers apply or what they consider best practices.

Kind regards,
 Edmund

--

Mit freundlichen Grüßen
Edmund Urbani
Liland IT Team

Email: edmund.urb...@lilandit.com <mailto:edmund.urb...@lilandit.com>

Liland IT GmbH ...does IT better
Tel: +43 463 220111
Fax: +43 463 220111-33
Tel(GER): +49 221 65028588

Find us at Facebook http://facebook.com/Lilandit
http://green-badges.com
http://iventcloud.com
http://Lilandit.com

<http://www.LilandIT.com> <http://www.LilandIT.com>

Copyright © 2015, Liland IT GmbH

Diese Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese Email irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This email may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this email in error) please notify the sender immediately and destroy this email. Any unauthorised copying, disclosure or distribution of the material in this email is strictly forbidden.

Reply via email to