﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Chris Holmes commented on NHibernate &amp; INotifyPropertyChanged</title><description>Okay, that makes sense. I figured it had to be something like that; I am just not very familiar yet with how NHibernate does things yet. 
  
  
Thanks Oren!
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment17</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment17</guid><pubDate>Thu, 10 Sep 2009 16:57:38 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate &amp; INotifyPropertyChanged</title><description>Chris,
  
This is because we aren't creating an instance yet.
  
If you want Load to support it as well you need to provide a ProxyFactoryFactory implementation that will support it.
  
In other words, there are two places that you need it. In the interceptor (when NH create the actual instance) and in the proxy factory (when NH creates the proxy)
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment16</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment16</guid><pubDate>Thu, 10 Sep 2009 16:50:46 GMT</pubDate></item><item><title>Chris Holmes commented on NHibernate &amp; INotifyPropertyChanged</title><description>Oren, 
  
  
I ran into a problem with this that is really strange (but maybe makes sense). 
  
  
When I call Get
&lt;t to fetch an object from NHibernate, this works and I can cast it to INotifyPropertyChanged and perform the wire-up. When I use Load
&lt;t, this does not work. The DataBindingIntercepter's Instantiate() method is not getting called. Now, Load() works quite a bit differently than Get(), as you've pointed out on your blog recently. But I am wondering if there is a way to make it work for Load() as well?
&gt;</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment15</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment15</guid><pubDate>Thu, 10 Sep 2009 16:45:40 GMT</pubDate></item><item><title>Chris Holmes commented on NHibernate &amp; INotifyPropertyChanged</title><description>Jon, 
  
  
All you need to do is add one line of code to your Fluent Buildup. Here's what mine looks like: 
  
  
var intercepter = new DataBindingIntercepter();
  
                SessionFactory = Fluently.Configure()
  
                    .Database(MsSqlConfiguration.MsSql2005
  
                                  .ConnectionString(x =&gt; x.FromConnectionStringWithKey("Movies"))
  
                                  .DefaultSchema("dbo")
  
                                  .ShowSql
  
                                  )
  
                    .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf
&lt;datasource())
  
                    .ExposeConfiguration(x =&gt; x.SetInterceptor(intercepter))
  
                    .BuildSessionFactory();
  
                intercepter.SessionFactory = SessionFactory;
  
  
That last line sets the SessionFactory on the interceptor. 
  
  
&gt;</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment14</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment14</guid><pubDate>Thu, 10 Sep 2009 16:43:17 GMT</pubDate></item><item><title>Jon Masters commented on NHibernate &amp; INotifyPropertyChanged</title><description>Turns out the issue was that SessionFactory on the DataBindingInterceptor was null.  I had been setting the interceptor in the fluent buildup of the factory 
  
  
.ExposeConfiguration(config=&gt;config.SetInterceptor(new DataBindingInterceptor()))
  
  
Instead I modified my OpenSession method to:
  
  
IInterceptor dataBinding = new DataBindingInterceptor {SessionFactory = factory};
  
            return factory.OpenSession(dataBinding)
  
  
Works great now.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment13</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment13</guid><pubDate>Tue, 18 Aug 2009 14:04:47 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate &amp; INotifyPropertyChanged</title><description>Jon,
  
Not off the top of my head.
  
Try creating a small test case that shows this.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment12</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment12</guid><pubDate>Tue, 18 Aug 2009 02:02:03 GMT</pubDate></item><item><title>Jon Masters commented on NHibernate &amp; INotifyPropertyChanged</title><description>I'm really excited about getting this to work, but i've run into a problem implementing.  My domain objects are in a different project from my repositories, which I believe causes all the Type.GetType(clazz) to return null.
  
  
I was able to get around it by using 
  
  
        public Type FindType(string typeName)
  
        {
  
            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
  
            {
  
                Type foundType = assembly.GetType(typeName);
  
  
                if (foundType != null)
  
                    return foundType;
  
            }
  
            return null;
  
        }
  
  
but 
  
  
SessionFactory.GetClassMetadata(clazz).SetIdentifier(instance, id, entityMode);
  
  
errors with a null reference exception.  I tried to switch from clazz, to type that was returned from FindType, but same result.
  
  
Any ideas?
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment11</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment11</guid><pubDate>Tue, 18 Aug 2009 01:54:41 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate &amp; INotifyPropertyChanged</title><description>Glenn,
  
Virtuals are not an issue, NH already has that requirement.
  
  
Type wrapping is actually something we are considering for DP 3.0
  
  
The problem is with instance management and leaking this at that point.
  
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment10</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment10</guid><pubDate>Sat, 15 Aug 2009 20:08:28 GMT</pubDate></item><item><title>Glenn Block commented on NHibernate &amp; INotifyPropertyChanged</title><description>Nice post Oren! I like the way you went further and added nested subscriptions. One thing though, this requires all the props to be virtual.
  
  
Another idea I had been toying with to some success was to use mixins to create a proxy that delegates to a poco rather than deriving from it.. This way the poco does not need to have virtual props. You could take the approach further to then allow specifying exactly which members are exposed in the ViewModel rather than automatically adding all of the members to the VM surface.
  
  
Any thoughts on this?
  
  
Glenn
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment9</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment9</guid><pubDate>Sat, 15 Aug 2009 19:23:20 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate &amp; INotifyPropertyChanged</title><description>Jernej,
  
I have no idea, ISTR that DDD mentions factories, but regardless, I don't care about DDD in this context.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment8</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment8</guid><pubDate>Mon, 10 Aug 2009 23:45:42 GMT</pubDate></item><item><title>Jernej Logar commented on NHibernate &amp; INotifyPropertyChanged</title><description>One question. How does this way of creating entities go together with aggregates (as in DDD)? You can't have the agg POCO create a proxied POCO this way.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment7</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment7</guid><pubDate>Mon, 10 Aug 2009 22:39:10 GMT</pubDate></item><item><title>Jos&amp;#233; Romaniello commented on NHibernate &amp; INotifyPropertyChanged</title><description>Besides of what Tuna said, I implement the code in unhaddins.wpf to work with INotifyPropertyChanged, INotifyCollectionChanged, IEditableObject (two implementatios). For InotifyPropertyChanged my IInterceptor is very similar (although I have another interceptor for the entity name thing)... and I use another extension point of nhibernate to inject the proxy...
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment6</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment6</guid><pubDate>Sat, 08 Aug 2009 14:30:08 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate &amp; INotifyPropertyChanged</title><description>Dmitry,
  
Yes, sort of. You would need to write a accessor, take a look at how NHibernate Generics was implemented.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment5</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment5</guid><pubDate>Sat, 08 Aug 2009 13:18:16 GMT</pubDate></item><item><title>Tuna Toksoz commented on NHibernate &amp; INotifyPropertyChanged</title><description>Here is a post on the same issue, he also has INotifyCollectionChanged etc. very cool posts.
  
  
[jfromaniello.blogspot.com/.../...anged-as-aop.html](http://jfromaniello.blogspot.com/2009/07/inotifypropertychanged-as-aop.html)</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment4</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment4</guid><pubDate>Fri, 07 Aug 2009 22:26:39 GMT</pubDate></item><item><title>Frank Quednau commented on NHibernate &amp; INotifyPropertyChanged</title><description>I've used a similar approach on a project last year. It was more of a mapping between a ViewModel described just as an interface and some POCO. The interface would implement INPC and its nature allowed us to do funny things like declaratively adding Undo, Commit &amp; Rollback functionality towards an associated POCO.
  
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment3</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment3</guid><pubDate>Fri, 07 Aug 2009 21:28:32 GMT</pubDate></item><item><title>Dmitry commented on NHibernate &amp; INotifyPropertyChanged</title><description>I really like this implementation. As you said, it is simple and elegant.
  
  
Is there a way for NHibernate to instantiate BindingList&lt;T&gt; for POCO properties of type IList&lt;T&gt; ?
  
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment2</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment2</guid><pubDate>Fri, 07 Aug 2009 21:18:02 GMT</pubDate></item><item><title>Krzysztof Koźmic commented on NHibernate &amp; INotifyPropertyChanged</title><description>This is like 5th impl of INPC via DynamicProxy I've seen in last month :) Seems everyone is doing it. Anyway, this is a great example, although I would split all the logic you put into the interceptor, between InterceptorSelector, the interceptor and use mixin for the actual INPC implementation. I understand however that you probably did it in one place to keep the example short.
</description><link>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment1</link><guid>http://ayende.com/4106/nhibernate-inotifypropertychanged#comment1</guid><pubDate>Fri, 07 Aug 2009 20:50:25 GMT</pubDate></item></channel></rss>