ציטוט jeff emminger:
looking for some tips from the experienced...
Not sure I match but give it a try...


i've developed a simple wiki as a learning project. for my wiki crud pages, i've given them a WikiPage property so i can retrieve a WikiPage object from the database, and set it on the page along the lines of

WikiPageUpdate:
 @Persist
 public abstract void setWikiPage(WikiPage page);

then other pages can send to WikiPageUpdate e.g.

 @InjectPage("WikiPageUpdate")
 public abstract WikiPageUpdate getWikiPageUpdate();

 getWikiPageUpdate.setWikiPage(pageFromDatabase);

two questions currently:
1. is it better to have my crud pages define a property representing the whole domain object WikiPage so that i can just pass objects around, or should they only store the WikiPage id and be responsible for pulling this object from storage by the id?
since editing should in fact cross more than one request (its - "preview" -> "edit" -> "preview" -> "save", always with the same object) it looks resonable to pass the object itself and the synchronize it.


2. i've had to define the WikiPage property as persistent to get it to "stick" between form posts... is this the best/proper way to do it? i'm worried about concurrent users sharing the WikiPage objects.
the tapestry wiki flags a page as locked on each request when someone edits it. I guess one has to implement such a locking...

AFAIK, if you persist the wikiPage and the user opens another browser-tab/window, he gets to edit the same wikiPage -
you have one persistent page per session.

I preffer persisting such objects using hidden form fields.

Cheers,
ROn


thanks in advance


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to