WindnTrees CRUDView and WPF Forms

WindnTrees CRUDView and WPF Forms

Abstract

In this tutorial we'll learn developing distributed client server desktop applications using WPF windows and CRUD2CRUD (CRUDS) communication architecture with AdapterServiceRepository and CRUDView.

AdapterServiceRepository enables WCF complex types (or KnownType) class objects communication using IService, IServiceAsync, IWCFService and IWCFServiceAsync communication channels and implement ICRUD, ICRUDL and ICRUDM interfaces.

Keywords: WCF, WPF, CRUD, WindnTrees, CRUDView, CRUD2CRUD, CRUDS
  • Strategy

    Achieve tutorial objectives by developing followings:

    1. Setup Database (Script Included).
    2. Application Server Project (.NET Framework).
    3. WFP Application Clients (.NET Framework and .NET 5.0).
    4. Shared Library Project (.NET Standard).

    Database Setup

    Install or run "tutorials" database script in MS-SQL Server 2017 or latest edition that includes related tables and data.

    Application Server Project

    Application server enables distributed clients with operational logic using same database, repositories and standard data models.

    1. Setup new windows .NET Framework console application project.
    2. Install WindnTrees.CRUDS and dependent latest nuget packages.
    3. Create Entity Framework Entity Model (.edmx) that includes database application context and POCO models.
    4. Configure Entity Model with Shared Library project for distributing standard data models (POCO classes) across different projects.
    5. Write IWCFService service respositories for .NET Framework and .NET Core Framework.
    6. Create new ApplicationServer class and inherit from WindnTrees.CRUDS.Server class.
    7. Host simple and adapter service repositories using IWCFService interface channel in ApplicationServer.

    WPF Windows Application (.NET 5.0)

    WPF Windows enable desktop clients and are setup as mentioned below:

    1. Setup WPF .NET 5.0 application project.
    2. Install Windows.ICRUDS.Standard nuget package.
    3. Add shared library project reference.
    4. Instantiate CRUDView using protocol, IP address, port and relative service URI address.
    5. Integrate application logic and continue developing distributed clients using CRUDS architecture and controller to controller communication interface. Make sure IP and port configurations are correct.

  • Shared Library

    Shares common data model or data contract definitions required to communicate data across or within different components of a sub-system. In this application we'll use following data contract model:

    1. Product (EntityFramework)
    2. ProductFeature (EntityFramework)
    3. Product (Adapter Communication Object)
    4. ProductFeature (Adapter Communication Object)

    CRUDView and ViewModel

    WindnTrees CRUDView returns updated WPF view model that includes following:

    1. ContentModel
    2. ContentListModel
    3. Errors

    Bind and update WPF view (.xaml) with CRUDView.CRUDViewModel. CRUDView uses CRUDL and CRUDM interfaces and achieve CRUD2CRUD data communication requirements.

    Visit http://www.invincibletec.com/sdk/index/windntrees to learn about ServiceClient, WCFServiceClient and CRUDView APIs.

    Application Server Nuget Packages

    WCF CRUDS Server (CRUD2CRUD) depend upon following nuget packages.

    1. WindnTrees.CRUDS
    2. WindnTrees.ICRUDS
    3. WindnTrees.ICRUDS.Standard
    4. WindnTrees.CRUDS.Repository
    5. WindnTrees.CRUDS.Repository.Standard

    WPF (.NET 5.0) Nuget Packages

    WPF application depend upon following CRUD2CRUD nuget packages.

    1. WindnTrees.ICRUDS.Standard

    Summary

    CRUDView provides elegant means of data view model integration. Download project code here. Nuget packages are not included in download.