Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Thanks again. :) - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
> Just a side question : when using a CompoundPropertyModel, is there a > way to "dispose" it later on the process or is it done automatically ? It seems that in the current implementation you could call setObject(null). Better is to provide a model as the target; for this model you can implement any attach/ detach behavior you want. > For example, I use a Value Object (VO) to edit my user profile > (because there are some extra data to consider). Is this VO deleted > when the page onSubmit processing is done ? > > In fact I've understood it's not deleted, but I'm kind of surprised > there is no way apart from the detachable model to deal with this kind > of issue. You could by setObject(null). Or by providing a model that does that as the target. Eelco - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Just a side question : when using a CompoundPropertyModel, is there a way to "dispose" it later on the process or is it done automatically ? For example, I use a Value Object (VO) to edit my user profile (because there are some extra data to consider). Is this VO deleted when the page onSubmit processing is done ? In fact I've understood it's not deleted, but I'm kind of surprised there is no way apart from the detachable model to deal with this kind of issue. Thanks in advance ZedroS - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
the answer is simple: do not reattach objects. do not keep them across requests unless you have a session that is open across requests. use a detachable model that loads the objects at the beginning of the request and discards them at the end. most times these are load-by-id operations which are very well cached by hibernate so there is no performance hit on loading them every request. if you use the detached object as a formbean then use merge() to apply the changes. -igor On 3/23/07, Ivo van Dongen <[EMAIL PROTECTED]> wrote: My favorite way is to use the domain objects directly, but let updates > (to the database) always go through services/ daos and *not* have > transactions per request. I'll still use value objects every now and > then because sometimes it's just easier to work with a 'flat' object > that is focussed on a particular case. A small question in between. How do you actually control the sessions and especially reattaching the domain objects to the session without breaking the application layers (eg reattaching in the view layer)? I've tried using a writable OpenSessionInViewFilter (Spring) but that ends in a lot of LazyInitializationException stuff. I'n now using an Aspect that catches this and reattaches the object, but this can cause a lot of nasty exception logging :) tnx Eelco > > - > > 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 > -- Ivo van Dongen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - 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 - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
My favorite way is to use the domain objects directly, but let updates (to the database) always go through services/ daos and *not* have transactions per request. I'll still use value objects every now and then because sometimes it's just easier to work with a 'flat' object that is focussed on a particular case. A small question in between. How do you actually control the sessions and especially reattaching the domain objects to the session without breaking the application layers (eg reattaching in the view layer)? I've tried using a writable OpenSessionInViewFilter (Spring) but that ends in a lot of LazyInitializationException stuff. I'n now using an Aspect that catches this and reattaches the object, but this can cause a lot of nasty exception logging :) tnx Eelco - 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 -- Ivo van Dongen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
I know I wasn't asked ;) but we had to revisit this question recently in converting a Tapestry app over to Wicket. We started off trying to use Hibernate objects directly for the usual reasons (avoid code duplication, more elegant, etc.) but ran into a few problems. A small but important problem was that we had to alter domain objects in less than ideal ways to account for the fact than any setter could be called at any time. This meant making some private setters public and adding redundant validation and logic that would normally go into a dedicated, multi-parameter "update..." method meant for public use. The biggest problems were related to transaction rollbacks after save ()-ing or reattaching Hibernate objects. Once you save a new object, Hibernate marks it as persistent but, if it didn't actually get committed to the database because your transaction rolled back, it's in an invalid state and Hibernate won't let you reattach it. Similarly, if you reattach an edited object and then the transaction rolls back, that object will be invalid. To solve this, we ended up reloading or recreating domain objects after transaction rollbacks and copying user-supplied values from the old object to the new one. Needless to say, that code looks a lot like what you have to do with form beans, except uglier. We avoided lazy load issues and transaction scope problems by using a read-only session per view and transactional service methods (a pretty standard architecture). Those parts worked fine. In the end we decided to go with form beans only because it ends up being a little simpler, keeps UI and domain needs separated and was actually slightly less code if you don't count the auto-created getters and setters on the form beans. I still think using Hibernate objects directly can be a nice way to go, and if you don't mind the inconsistency you might find that some forms can do that while others use beans. These model classes (based on an old post of Igor's) helped me immensely with Wicket/Hibernate integration. We still use them to back our DataTables and most of our view pages (which use Hibernate objects directly). The first is a superclass for any Hibernate entity. The second is an example subclass for use with a domain supertype. public class EntityModel extends LoadableDetachableModel { private final Class clazz; private final Serializable id; public EntityModel(Class clazz, Serializable id) { this.clazz = clazz; this.id = id; } public EntityModel(Class clazz, Serializable id, Object object) { super( object ); this.clazz = clazz; this.id = id; } @Override protected Object load() { return HibernateSessionLocator.getSession().get( this.clazz, this.id ); } } public class DomainSupertypeModel extends EntityModel { public DomainSupertypeModel(DomainSupertype object) { super( object.getClass(), object.getId(), object ); } // If the object is a proxy, its runtime type might not be the actual // persistent class, so sometimes you need to specify it. public DomainSupertypeModel(DomainSupertype object, Class clazz) { super( clazz, object.getId(), object ); } } hth, -Ryan On Mar 20, 2007, at 9:51 AM, ZedroS Schwart wrote: > That's was a really instructive post, thanks Eelco. > > In fact I'm actually struggling with this kind of issue. I've model > objects and then on my presentation layer the data are quite often a > bit different, and thus I wonder which way is the best. > > Igor had spoken about "form beans", but then I've to map them > somewhere with my actual domain objects, which can be quite annoying. > Merge and VO object may be a good way to avoid some part of this pain. > > However, you said you weren't a fan of this pattern, could you please > explain which approach you use ? I would really like it because I find > it really important for ease of development and maintainability. And > up to now I've found a way which fully pleases me. > > Thanks in advance > ZedroS > > -- > --- > 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 - 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 ___
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
> That's was a really instructive post, thanks Eelco. > > In fact I'm actually struggling with this kind of issue. I've model > objects and then on my presentation layer the data are quite often a > bit different, and thus I wonder which way is the best. > > Igor had spoken about "form beans", I think he meant the same thing (value objects). > However, you said you weren't a fan of this pattern, could you please > explain which approach you use ? I would really like it because I find > it really important for ease of development and maintainability. And > up to now I've found a way which fully pleases me. Tbh, I use it mixed, also because I'm not the only guy in the team (Igor and I actually work on the same project). My favorite way is to use the domain objects directly, but let updates (to the database) always go through services/ daos and *not* have transactions per request. I'll still use value objects every now and then because sometimes it's just easier to work with a 'flat' object that is focussed on a particular case. Eelco - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
That's was a really instructive post, thanks Eelco. In fact I'm actually struggling with this kind of issue. I've model objects and then on my presentation layer the data are quite often a bit different, and thus I wonder which way is the best. Igor had spoken about "form beans", but then I've to map them somewhere with my actual domain objects, which can be quite annoying. Merge and VO object may be a good way to avoid some part of this pain. However, you said you weren't a fan of this pattern, could you please explain which approach you use ? I would really like it because I find it really important for ease of development and maintainability. And up to now I've found a way which fully pleases me. Thanks in advance ZedroS - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
On 3/20/07, ZedroS Schwart <[EMAIL PROTECTED]> wrote: > Thanks again for all these answers. > > I just don't get right the last one : > > They are also good for when you work with value objects ('thin' > > representations of the your domain objects). > > Could you be more explicit please ? http://wiki.java.net/bin/view/Javapedia/ValueObject I guess that's still a bit of a broad definition as well. What I meant it was that if you have domain objects mapped by e.g. Hibernate for instance a class like: class School implements Serializable { long id; String name; Address address; Region region; List memberShips; } some people say you shouldn't use these objects directly in forms, as you can run into all kinds of problems like not having the (Hibernate) session available at the right time and if you defined transactions over requests (e.g. by using a filter, which for the record I'm personally not crazy about) you can end up saving more than you should. A solution is to use objects that map certain properties of these domain for specific cases. For instance, if I wanted to edit the address of a school in a form, I could create an object like this: class SchoolVO implements Serializable { final long schoolId; // not editable String addressLine; String postalCode; String regionCode; } and then in onSubmit School school = schoolService.load(schoolVO.getSchoolId()); schoolVO.merge(school); schoolService.save(school); Personally, I'm not a fan of this pattern as it results in code duplication and can be a bit of a pain to maintain when the domain model changes. Though *if* you use per request transactions it's probably sensible to use it as you'll avoid potentially hard to track down problems and inefficiencies. My 2c, Eelco - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Thanks again for all these answers. I just don't get right the last one : > They are also good for when you work with value objects ('thin' > representations of the your domain objects). Could you be more explicit please ? Thanks again ZedroS On 3/17/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > They are also good for when you work with value objects ('thin' > representations of the your domain objects). > > Eelco > > On 3/17/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: > > Still, if you know what you are doing non-detachable models may be > > appropriate. For example, I have used them for some slow-to-get database > > query results. But I also wrote my own custom cached page invalidator to > > make sure these results do not stay around for too long. > > > > Regards, > > Erik. > > > > Jonathan Locke wrote: > > > Non-detachable models probably are not the best way to work > > > with a database. And since they can't be detached, your whole > > > model stays in the session the whole time, while the detachable > > > ones shrink to a few bytes (object header + id + transient slot) > > > when they are detached by Wicket after each request. > > > > > > > > > > -- > > Erik van Oosten > > http://day-to-day-stuff.blogspot.com/ > > > > > > - > > 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 > > > > - > 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 > - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
They are also good for when you work with value objects ('thin' representations of the your domain objects). Eelco On 3/17/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: > Still, if you know what you are doing non-detachable models may be > appropriate. For example, I have used them for some slow-to-get database > query results. But I also wrote my own custom cached page invalidator to > make sure these results do not stay around for too long. > > Regards, > Erik. > > Jonathan Locke wrote: > > Non-detachable models probably are not the best way to work > > with a database. And since they can't be detached, your whole > > model stays in the session the whole time, while the detachable > > ones shrink to a few bytes (object header + id + transient slot) > > when they are detached by Wicket after each request. > > > > > > -- > Erik van Oosten > http://day-to-day-stuff.blogspot.com/ > > > - > 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 > - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Still, if you know what you are doing non-detachable models may be appropriate. For example, I have used them for some slow-to-get database query results. But I also wrote my own custom cached page invalidator to make sure these results do not stay around for too long. Regards, Erik. Jonathan Locke wrote: > Non-detachable models probably are not the best way to work > with a database. And since they can't be detached, your whole > model stays in the session the whole time, while the detachable > ones shrink to a few bytes (object header + id + transient slot) > when they are detached by Wicket after each request. > > -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Non-detachable models probably are not the best way to work with a database. And since they can't be detached, your whole model stays in the session the whole time, while the detachable ones shrink to a few bytes (object header + id + transient slot) when they are detached by Wicket after each request. ZedroS Schwart wrote: > > Thanks Jonathan for the tip. > > I've now read on the wiki about it and this detachable compound > property model seems the best way to do (or even the Detachable > BoundCompoundPropertyModel !) . > > I've just a question (a newbe one as usual lol) : how does wicket work > with non detachable models ? They're kept during the whole user > session even if they're updated every time there is a new access to > the page to whom they're linked ? > > Thanks again > ZedroiS > > > On 3/17/07, Jonathan Locke <[EMAIL PROTECTED]> wrote: >> >> >> you don't have to choose. you can wrap a compoundpropertymodel around a >> detachablemodel and get both access convenience and detachability. >> wicket >> models are much more flexible and powerful than most people realize at >> first. >> >> >> ZedroS Schwart wrote: >> > >> > Thanks for your comment Igor, I really appreciate. >> > >> > Just some questions : do you use CompoundPropertyModel or the >> detachable >> > one ? >> > >> > For the form beans, the user profile page I'm working on really proves >> > you right. I was willing at first to avoid "yet another bean" but in >> > fact it seems indeed to be the easiest way. >> > >> > For the optimistic locking, I've read >> > >> http://www.hibernate.org/hib_docs/reference/en/html/transactions.html#transactions-optimistic >> > Is it what you had in mind ? >> > >> > Thanks again >> > >> > ZedroS >> > >> > >> - >> > 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 >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Re%3A-Hibernate-Spring-and-Wicket-architecture-%22request-for-validation%22-%28was-Wicket%27s-questions%29-tf3405475.html#a9526281 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> 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 >> > > - > 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 > > -- View this message in context: http://www.nabble.com/Re%3A-Hibernate-Spring-and-Wicket-architecture-%22request-for-validation%22-%28was-Wicket%27s-questions%29-tf3405475.html#a9529946 Sent from the Wicket - User mailing list archive at Nabble.com. - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Thanks Jonathan for the tip. I've now read on the wiki about it and this detachable compound property model seems the best way to do (or even the Detachable BoundCompoundPropertyModel !) . I've just a question (a newbe one as usual lol) : how does wicket work with non detachable models ? They're kept during the whole user session even if they're updated every time there is a new access to the page to whom they're linked ? Thanks again ZedroiS On 3/17/07, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > > you don't have to choose. you can wrap a compoundpropertymodel around a > detachablemodel and get both access convenience and detachability. wicket > models are much more flexible and powerful than most people realize at > first. > > > ZedroS Schwart wrote: > > > > Thanks for your comment Igor, I really appreciate. > > > > Just some questions : do you use CompoundPropertyModel or the detachable > > one ? > > > > For the form beans, the user profile page I'm working on really proves > > you right. I was willing at first to avoid "yet another bean" but in > > fact it seems indeed to be the easiest way. > > > > For the optimistic locking, I've read > > http://www.hibernate.org/hib_docs/reference/en/html/transactions.html#transactions-optimistic > > Is it what you had in mind ? > > > > Thanks again > > > > ZedroS > > > > - > > 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 > > > > > > -- > View this message in context: > http://www.nabble.com/Re%3A-Hibernate-Spring-and-Wicket-architecture-%22request-for-validation%22-%28was-Wicket%27s-questions%29-tf3405475.html#a9526281 > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > 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 > - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
you don't have to choose. you can wrap a compoundpropertymodel around a detachablemodel and get both access convenience and detachability. wicket models are much more flexible and powerful than most people realize at first. ZedroS Schwart wrote: > > Thanks for your comment Igor, I really appreciate. > > Just some questions : do you use CompoundPropertyModel or the detachable > one ? > > For the form beans, the user profile page I'm working on really proves > you right. I was willing at first to avoid "yet another bean" but in > fact it seems indeed to be the easiest way. > > For the optimistic locking, I've read > http://www.hibernate.org/hib_docs/reference/en/html/transactions.html#transactions-optimistic > Is it what you had in mind ? > > Thanks again > > ZedroS > > - > 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 > > -- View this message in context: http://www.nabble.com/Re%3A-Hibernate-Spring-and-Wicket-architecture-%22request-for-validation%22-%28was-Wicket%27s-questions%29-tf3405475.html#a9526281 Sent from the Wicket - User mailing list archive at Nabble.com. - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Thanks for your comment Igor, I really appreciate. Just some questions : do you use CompoundPropertyModel or the detachable one ? For the form beans, the user profile page I'm working on really proves you right. I was willing at first to avoid "yet another bean" but in fact it seems indeed to be the easiest way. For the optimistic locking, I've read http://www.hibernate.org/hib_docs/reference/en/html/transactions.html#transactions-optimistic Is it what you had in mind ? Thanks again ZedroS - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
On 3/14/07, ZedroS Schwart <[EMAIL PROTECTED]> wrote: When I have to change an object on the "OnSubmit", I use the update methods from my managers. What I fear here is to update some data which have already been updated in between. hibernate and jpa provide optimistic locking that guards against this. see hibernate's manual for more info. Overall, I'm wondering whether my implentation is "good enough" and how to avoid "data collision". personally i prefer to work with form beans and then apply those beans to persistent objects. the reason is that in anything but trivial apps forms usually dont map very well to persistent objects, so you end up doing hacks. its easier to build a pojo that maps exactly to the form, and then apply that to wherever in a service method. but this is just my preference. otherwise sounds good. -igor What do you think of it ? Thanks in advance ZedroS - 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 - 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
Re: [Wicket-user] Hibernate/Spring and Wicket architecture "request for validation" (was Wicket's questions)
Hi all Among the questions I had, one of the core questions is the following one : is the architecture I plan to use appropriate ? Just to give a bit of insight, I'm new to Hibernate/Spring and Wicket (ouch !). lol But I'm really motivated :) I would like to be sure I don't do huge mistake in my architecture... since I'm not an expert it could be the case :( I took it mainly from a Spring book (not an english one though). For Wicket I user Pro Wicket. So, my architecture is the following : For each domains of my application, I've a manager, like the UserManager. The managers contain the access to the DAO Interfaces (which are properly injected by Spring) and render pure Pojo "Model" for my databased data (like an User object for the user info). Behind all t his stuff, the transaction manager is org.springframework.orm.hibernate3.HibernateTransactionManager and the sessionFactory is org.springframework.orm.hibernate3.LocalSessionFactoryBean. Using injection, I've put an instance of my userManager in my BasePage. >From it, where needed, I access the user info. For example, on login, I call it to retrieve an user and put in my session. For my pages, I use CompoundPropertyModel with the Pojo retrieve from my managers (which are injected on demand excepted for the usermanager which is always available as told before). When I have to change an object on the "OnSubmit", I use the update methods from my managers. What I fear here is to update some data which have already been updated in between. Overall, I'm wondering whether my implentation is "good enough" and how to avoid "data collision". What do you think of it ? Thanks in advance ZedroS - 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