2007/6/23, Robert . <[EMAIL PROTECTED]>:

this is better because if you use applications to hold non-proxied daos
> you have to be very careful not to leave a reference to it anywhere. because
> dependencies injected throgh @SpringBean are special proxies you dont have
> to worry about it because the proxies can be safely serialized.
>

I do understand that. But isn't it very easy to avoid it? For example the
PersonClass would be something like this:

class PersonModel extends LoadableDetachableModel {
   private final long id;
   public PersonModel(long id) {
     this.id=id;
   }

  private PersonDao getDao() {
    return MyApplication.get().getPersonDao();
   ...
}

With this getter there is no temptation to save the DAO as a field.


With the above approach you have a dependency from your model to your
Application class. Not everybody wants this.
If it works for you, go ahead :-) AFAIK there is not a fatal problem with
this.

The pros and cons of both approaches are discussed in the wiki as well:
http://cwiki.apache.org/WICKET/spring.html

--
greetings from Berlin,

Rüdiger Schulz

www.2rue.de
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to