exactly. Class proxies in LinFu behave as a interface proxies in Castle DP.

So, given  a fictional scenario like this:

public class Comment : IComment {
  public Post Post{get;set;}
  public void Response(IComment response){
      Post.AddComment(response);
      response.InResponseTo = this;
  }
}

When calling Response method before initializing Post, will fail with LinFu
and will fail with Castle DP if you set an interface. I don't know about
spring, but I think it works as Castle DP.

2009/12/31 Richard Brown (gmail) <[email protected]>

>  Ahh ... there wouldn't be two Comment classes (proxy & real) ... just
> one?
>
> If that's the case then (as José mentions) LinFu won't allow you to
> self-proxy (like DynamicProxy does) ... LinFu forces you to redirect calls
> to a second object (I think).
>
>  *From:* José F. Romaniello <[email protected]>
> *Sent:* Thursday, December 31, 2009 10:54 AM
> *To:* [email protected]
> *Subject:* Re: [nhibernate-development] Ghost objects
>
> You may have to forbid the usage of interface proxies in Comment.
> <class name="Comment" table="Contact"proxy="IComment" >
>
> This will fail if you use the Post property inside the comment class. (I'm
> talking just for DynamicProxy), linfu proxies has another behavior which is
> worse.
>
>
>
> 2009/12/31 Ayende Rahien <[email protected]>
>
>> No, the reference should be inflated when you access the Post property.
>>
>>
>> On Thu, Dec 31, 2009 at 12:44 PM, Richard Brown (gmail) <
>> [email protected]> wrote:
>>
>>>  I take it the reference would inflate when *any* method is called on
>>> the Comment proxy?
>>> (and not just the property accessor)
>>>
>>>
>>>  *From:* Ayende Rahien <[email protected]>
>>> *Sent:* Thursday, December 31, 2009 9:32 AM
>>> *To:* nhibernate-development <[email protected]>
>>> *Subject:* [nhibernate-development] Ghost objects
>>>
>>> I am trying to figure out if we can support the following:
>>>
>>> class Comment
>>> {
>>>    public virtual Post Post {get;set;}
>>> }
>>>
>>> class Post {}
>>> class Article : Post {}
>>>
>>> And *not* generate a PostProxy for the property, but instead detect the
>>> property access, force a load to return the correct type.
>>> We can do it right now by specifying lazy=false, but that pre-load the
>>> entity, while I would like to try to get it to load only on access time.
>>>
>>> There are several potential problems with this:
>>> a) we need to replace the reference on first access, which means that the
>>> _parent_ must be a proxy as well.
>>> b) we disallow field access entirely.
>>> c) identity map issues?
>>>
>>> other thoughts?
>>>
>>
>>
>

Reply via email to