InterviewSolution
| 1. |
Why Doesn't My Proxy Work? |
|
Answer» To be able to create a proxy for a class, the class should have its properties, METHODS and EVENTS declared as virtual. This is not required if the class is PROXIED through an interface it implements (specified using proxy="SomeInterface"). There is no CODE in NHibernate 1.0 to validate your proxy classes, but that will be added in NHibernate 1.1. NHibernate USES the library Castle.DynamicProxy that is part of the Castle Project. DynamicProxy generates IL - not modifying your IL - at runtime for a subclass of your class, or the IL to implement an interface. To be able to create a proxy for a class, the class should have its properties, methods and events declared as virtual. This is not required if the class is proxied through an interface it implements (specified using proxy="SomeInterface"). There is no code in NHibernate 1.0 to validate your proxy classes, but that will be added in NHibernate 1.1. NHibernate uses the library Castle.DynamicProxy that is part of the Castle Project. DynamicProxy generates IL - not modifying your IL - at runtime for a subclass of your class, or the IL to implement an interface. |
|