Inteligent references, or smart pointers are special kind of objects.
They simulate other objects and add some special functionality.
TransparentProxy is a kind of inteligent reference - it adds remoting
features to proxied object.
I used TransparentProxy to implement lazy load mechanism in my O/R mapping
framework, but I probably need something more efficient.
I think, that RealProxy/TransparentProxy mechanism is very efficient if you
use it in distributed applications.
Tahnk you for your replay,
Jacek.
> Hi Jacek,
>
[quoted text clipped - 12 lines]
>
> <Performance Considerations for Run-Time Technologies in the .NET Framework>
http://msdn.microsoft.com/netframework/using/understanding/perf/default.aspx
?pull=/library/en-us/dndotnet/html/dotnetperftechs.asp#dotnetperftechs_topic
> 7
>
> Also here is some performance couter for .NET Remoting, it will help you
> investigate this problem.
>
> <Remoting Performance Counters>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
> ml/gngrfremotingperformancecounters.asp
>
[quoted text clipped - 14 lines]
> This mail should not be replied directly, "online" should be removed before
> sending.
"Ying-Shen Yu[MSFT]" - 07 Jan 2004 08:44 GMT
Hi Jacek,
Thanks for your reply!
Probably, you misunderstand my meaning. I want to know what the
"Intelligent Reference" referrs to in your O/R mapping framework scenario.
From my understanding now, you are writing an O/R mapping framework and you
are using the .NET Remoting to implement the lazy load mechanism. the O/R
mapping framework needn't support the cross app-domain situation.
The advice on this issue is largly depends on the your design, so I need
know more info on your O/R mapping framework, and especially how you use
the transparent proxy in the lazy load mechanism?
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
Jacek Hełka - 07 Jan 2004 10:44 GMT
Hi Ying-Shen,
My lazy loading mechanism works as follows.
I defined subclass of RealProxy with. It's Invoke() method checks, wheather the real object was read into memory. If not, it reads it.
public override IMessage Invoke(IMessage msg)
{
if(persistentObject == null)
persistentObject = ReadObject();
IMethodCallMessage mtd = (IMethodCallMessage)msg;
object result = mtd.MethodBase.Invoke(, mtd.Args);
return new ReturnMessage(
result,
mtd.Args,
mtd.ArgCount,
mtd.LogicalCallContext,
mtd);
}
Then I create TransparentProxy object simulating underlying persistent object. When you use persistence framework you can access persistent objects only through proxies.
This is very comfortable for users, because the lazy loading is transparent.
Regards,
Jacek.
> Hi Jacek,
>
[quoted text clipped - 22 lines]
> This mail should not be replied directly, "online" should be removed before
> sending.
"Ying-Shen Yu[MSFT]" - 08 Jan 2004 09:18 GMT
Hi Jacek,
Thanks for your reply.
If you would like to make the lazy load mechanism completely transparent to
the object, I couldn't find a way other than TransparentProxy/RealProxy
approach. Unfortunately, the TransparentProxy was created by CLR Execution
Engine, we are not able to implement our own transparent proxy. You may try
investigating the cause of the inefficiency using some profilering tool,
.NET remoting will pass the IMessage reference direct to the remote object
if both of them are in the same AppDomain, so I guess the problem might not
be the serialize issue, however the message dispatching might cost some
time. you may also take a look at the SSCLI rotor to see more detail
implementation in this part, maybe you can manage the remoteobject in your
real proxy on the client side and call it directly to bypass some message
sinks.
Hope it helpful,Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
Jacek He?ka - 08 Jan 2004 11:41 GMT
Hi,
> Hi Jacek,
>
[quoted text clipped - 9 lines]
> be the serialize issue, however the message dispatching might cost some
> time.
Yes, I know, that serialization is used only between AppDomains.
> you may also take a look at the SSCLI rotor to see more detail
> implementation in this part, maybe you can manage the remoteobject in your
> real proxy on the client side and call it directly to bypass some message
> sinks.
Thank you, I will try.
> Hope it helpful,Thanks!
>
> Best regards,
>
> Ying-Shen Yu [MSFT]
Regards,
Jacek
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
>
> This posting is provided "AS IS" with no warranties and confers no rights.
> This mail should not be replied directly, "online" should be removed before
> sending.