These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Lazy Proxy Subclasses and Metaprogramming
PostPosted: Wed Jun 18, 2008 12:34 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:09 pm
Posts: 23
Hibernate version:
1.2.1

.Net version:
1.1

Hi,

I use metaprogramming for several things like building export data, mapping imports data, audit trails, etc. To do that I've been using reflection and property introspection via type.GetProperties(), prop.GetValue(), etc.

Just recently I've added more proxies for performance reasons. For the most part everything is fine, I just call NHibernate.NHibernateUtil.GetClass(proxyObj) to get the nonProxyClass type when I need it.

The problem I'm having is with proxies representing subclasses. That is because their properties list, via type.GetProperties() is missing properties that the subclass class has got, but which aren't on the base class. So when I call prop.GetValue(proxyObj, Nothing) I'm getting an exception because the property doesn't exist on the proxied object.

In my case I'm letting the proxy override the class instead of providing an Interface. Unfortunately I can't use an Interface because the objects need to be sent over webservices, and that doesn't handle interfaces.

So, my question is, how can I work around this to get the at a proxied subclass's object property value for a property that isn't on the base class? I don't mind treating this as a special case and having a nasty work around.

I plan to work on this some more, but maybe someone else already knows the solution, or has some ideas on a direction which would prove to be fruitful. At any rate I'll update if I find anything.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.