I would like to have NHibernate get & set our entity values directly through their fields, rather than through their properties. It would seem to offer better performance.
More importantly, though, it would allow entities to get loaded by NHibernate that have values considered "illegal" by the property setter, so that they could be cleaned without resorting to direct SQL. These "illegal" values could occur even if only NHibernate saved data to the database, if validation rules in a property setter were tightened up after some entities were already persisted.
Members of our design team are very concerned about letting NHibernate access private fields through reflection. They say Microsoft has admitted that this capability is a bug and will eventually be removed. Is this true? Is anyone else using field access rather than property access?
The fact that this feature has existed for a long time in Java suggests to me that the Java world does not consider access to private fields through reflection a "bug", and has no intention of removing the capability ...
Last edited by Nels_P_Olsen on Wed Dec 07, 2005 6:19 pm, edited 1 time in total.
|