MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

Migration from SL5 app and WCF dataportal to WPF app core 3.1 and dataportal core 3.1 #896

Open bdeluard opened 4 years ago

bdeluard commented 4 years ago

Question I'm on the process to start a big migration from a SL5 app using dataportal (with EF). The target is a WPF client on Windows and netcore 3.1 platform. On the server side, I would use a datapoprtal on netcore 3.1 hosted in IIS.

For the beginning, I tried the ProjectTracker, but the WPF client is under FW 4.6. Is it possible to have a WPF client created on netcore 3.1 and using CSLA? Also, there is nothing in the app.config related to the dataportal access.

I read an article about using gRPC between client and dataportal : is it a good idea?

Thanks for your answers.

Bruno

Version and Platform CSLA version: 4.13 towards last version (5.1 now) OS: Windows Platform: WPF on client

rockfordlhotka commented 4 years ago

The primary data portal channel is HTTP. That's what's built into the core framework, because it works on all current .NET platforms.

All the samples (including ProjectTracker) have been slowly migrated to using a more modern code-based configuration scheme. It turns out that getting configuration from a config file is an anti-pattern (see https://12factor.net/config). CSLA 5 supports modern .NET Core config patterns, though the samples still tend to hard-code the server URL (where in real life those should come from the environment).

I recently created the gRPC and RabbitMQ data portal channels.

The gRPC channel is directly equivalent to the HTTP channel, except that it uses gRPC as a transport instead of HTTP. From a CSLA perspective they are basically interchangeable, and I doubt you'll see any real performance differences. So I have no opinion on which to choose - it depends on your enterprise architecture guidance in your org.

The RabbitMQ channel is quite different, as it relies on async queued messaging instead of synchronous TCP messaging. It is designed to support cloud-native server-side scenarios that need high levels of fault tolerance, geographic fault tolerance, scaling, etc. without spending a lot of money to accomplish those goals.

You wouldn't generally use the RabbitMQ channel from client to server. It is for server-to-server communication.

bdeluard commented 4 years ago

Thanks for your advice. I's alwlays a pleasure to use CSLA.Net!

Bruno

BlagoCuljak commented 4 years ago

Hi Bruno, just off upgrade, 4.7 to 5.1 and EF6.3 to EF Core 3.1! Have a ton of experince!

To use dataportal url from appsettings.json in WPF (I still use dotnet 4.7 in WPF):

  1. In startup.cs: `public void Configure() {

        //CslaConfiguration.Configure().DataPortal().DefaultProxy(typeof(Csla.DataPortalClient.HttpProxy), "http://localhost:8040/api/dataportal");
    
        var config = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json")
        .Build()
        .ConfigureCsla();
    }`
  2. appsettings.json : { "csla": { "dataPortal": { "proxy": "Csla.DataPortalClient.HttpProxy", "portalUrl": "http://localhost:8040/api/dataportal" //"proxyFactory": "" } } }

Have a good one!

bdeluard commented 4 years ago

Hi, Sorry for the delay :) I will begin a poc next week and will give back infos about it!

Bruno