• saving pages to disk is also not an option for performance reasons and because it will not work in a cluster where the nodes of the cluster do not share a common fiile system.

it is not really a peformace hit. And if working in a cluster it still works fine, because sticky sessions is really the way to go
Then only when one server does collapse. The transfered sessions don't handle the back button very well if the file system where you write it on was not shared.
So the negative sides are not that big.

But the how about referencing models through an id instead of through a straight java object reference? Why is that a bad solution. It would preserve the same mechanisms and it would do only minimal serialization.


this still doesn't fix this:

Person person = new Person();
Component parent = new Component("personPanel", new CompoundPropertyModel(person));
Component child = new Component("addressPanel", new CompoundPropertyModel(person.getAddress()));

so they don't share the same model but directly the same object.
You can say then but they shouldn't do that they should use a property model again wrapping the first compound
if you ask me what i would do? I would code it like above. It is clean and simple.
doing this:

Person person = new Person();
CompoundPropertyModel personModel = new CompoundPropertyModel(person);
Component parent = new Component("personPanel", personModel);
Component child = new Component("addressPanel", new CompoundPropertyModel(new PropertyModel("address", personModel)));

is in my eyes bloathed and by viewing just from the outside world totally unnessesary code.
So i am trying to figure out a way to handle the first example.
But i am affraid this can't be done... (except the wicket 2.0 way)

You could make such a id indirection model if you wish.
That gets the model by id from the page. But then you need to think about how you do versioning when to do it?
How do you know which model version you need to have?  When do you make a version of that model?
Where is that model then exactly attached to? Is the shared model still versioned twice if the parent and child both change?
Or do you say only the parent does it? But if only the child changes? Or only one time in a page version?
so you need to record that that only one time in a request/pageversion the shared model is cloned
the first time one component (which that is is not importand parent or child) is calling modelChanging()

johan




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to