NHibernate 3.3 Proxy INotifyPropertyChanged

636 views
Skip to first unread message

Björn Peter

unread,
Apr 25, 2012, 8:59:01 AM4/25/12
to nhu...@googlegroups.com
Hello,

we would like to use NH v.3.3 with WPF and therefore need to implement INotifyPropertyChanged and ObservableCollection. Is it still advised to implement a proxy interceptor for INotifyPropertyChanged and ObservableCollection as recommended by Ayende back in 2009 [1]? Are there other new options to prefer? 

As stated NH got an own embedded proxy generator in version 3.2. Most examples show an interceptor for Castle Windsor. How do things work in NH 3.3?

Best regards,
Björn Peter





DaveW

unread,
Apr 26, 2012, 12:49:25 AM4/26/12
to nhu...@googlegroups.com
I'd probably leave the persistent classes alone, and just expose their data through the ViewModel classes (which can implement INPC in the normal way). 

Björn Peter

unread,
Jun 4, 2012, 4:59:35 AM6/4/12
to nhusers
Well, when using entities in subcollections of ViewModel this doesn't
work.

Any other suggestions?

Ricardo Peres

unread,
Jul 2, 2012, 2:02:30 PM7/2/12
to nhu...@googlegroups.com
Thanks, Björn! Have you tried it? I wanted to add it to NHForge Wiki, but their filesystem has been full for some days.
 
RP
 

On Monday, July 2, 2012 3:49:57 PM UTC+1, Björn Peter wrote:
Recently Ricardo Peres wrote a blog post about this topic:

http://weblogs.asp.net/ricardoperes/archive/2012/06/19/implementing-an-interceptor-using-nhibernate-s-built-in-dynamic-proxy-generator.aspx 

Thanks Ricardo for that,

Björn

Asher Newcomer

unread,
Jul 2, 2012, 2:19:00 PM7/2/12
to nhu...@googlegroups.com
I'll more or less second Dave's suggestion to use different classes for this. Dynamic proxies and the sort are great to get everything up and running with minimal code, but in my experience they lead to a world of hurt in anything but the smallest projects.

Create custom built UI objects and copy whatever data you need from the persistent classes into them. AutoMapper is your friend, and the future you will appreciate it.

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.


Reply all
Reply to author
Forward
0 new messages