CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Custom Proxy Factory with WinRT in v.4.5.501

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 2 Replies | 2 Followers

    Top 25 Contributor
    202 Posts
    Tim posted on Thu, Jun 12 2014 10:17 AM

    I'm following the Using CSLA Data Portal e-book where it talks about implementing a custom proxy factory so that an app can support occasionally connected scenarios.

    The SL example project shows the custom class that implements Csla.DataPortalClient.ProxyFactory. This doesn't appear to be valid interface within the Csla namespace for WinRT in v4.5.501. I do see IDataPortalProxyFactory, but this interface doesn't contain an overridable GetProxy method, which is necessary.

    Are there changes in 4.5.501 that changes how I should create a custom proxy factory? Thanks.

    Tim

    Answered (Verified) Verified Answer

    Top 10 Contributor
    9,475 Posts
    Verified by Tim

    Yes that is the intent of the new interface.

    The ResetProxyType method is used to clear any cached proxy type your implementation may store. In your case you aren't storing a proxy type so you don't care, but in the DefaultPortalProxyFactory the proxy type is cached to improve performance.

    Rocky

    All Replies

    Top 25 Contributor
    202 Posts
    Tim replied on Fri, Jun 13 2014 7:04 AM

    After some experimenting, it seems like this works (i.e. the BO executes on either the local or remote portal when necessary). Is this a legitimate way of creating a custom proxy factory?

    public

     

     

    class ProxyFactory : Csla.DataPortalClient.IDataPortalProxyFactory
    {

    public IDataPortalProxy Create(Type objectType)
    {
        if (bPullFromLocal)
            return new Csla.DataPortalClient.LocalProxy();
        else
            return new Csla.DataPortalClient.WcfProxy();
    }

     }

    Also, what does the ResetProxyType method do? When should I use it?

    Tim

    Top 10 Contributor
    9,475 Posts
    Verified by Tim

    Yes that is the intent of the new interface.

    The ResetProxyType method is used to clear any cached proxy type your implementation may store. In your case you aren't storing a proxy type so you don't care, but in the DefaultPortalProxyFactory the proxy type is cached to improve performance.

    Rocky

    Page 1 of 1 (3 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems