0

これによく似た問題があります。

サーバー上で実行されている既存のソフトウェア (データおよびビジネス レイヤー) があり、Silverlight GUI クライアントをそれに追加したいと考えています。現時点では通信は WCF サービスを介して機能しますが、代わりに WCF RIA サービスを使用したいと考えています。

私のアーキテクチャは次のようになります。

Database - DAL - BL - WCF Services - Silverlight client

すべてのビジネス ロジックはサーバー上にあり、Silverlight クライアントはほとんどがデータ ビューアーです。

質問:

1) WCF サービス (クライアントとサーバー間の通信に使用) を WCF RIA サービスに置き換えることは理にかなっていますか?

2) WCF サービスを WCF RIA サービスと通信させることは可能ですか? このような:

Database - DAL - BL - WCF Services - WCF RIA Service - Silverlight client

また

Database - DAL - BL - WCF Services - Translator - WCF RIA Service - Silverlight client

また

Database - DAL - BL - WCF RIA Service - Silverlight client

All the examples and tutorials for RIA services seem to use them to directly access a database, but what if I want to access a business layer instead? How would I represent the "data objects" on the business layer? And how would I call functions on the server from the client using a RIA service, e.g. to calculate something?

4

1 に答える 1

2

1) Silverlight コードを最新の状態に保つツールで得られるすべての利点を得るために、WCF RIA を使用することに大きく傾いています。サービス参照を使用すると、WCF サービスと Silverlight の実装が同期しなくなる可能性が高くなります。

2) 例 1 のように、WCF サービスを WCF RIA サービスでラップします。

Database - DAL - BL - WCF Services - WCF RIA Service - Silverlight client

WCF RIA DomainService は、WCF サービスのインスタンスを取り、それを単にラップする必要があります。

[EnableClientAccess]
public class FooDomainService : DomainService
{
    FooWcfService _fooWcfService;

    public FooDomainService(FooWcfService fooWcfService)
    {
        _fooWcfService = fooWcfService;
    }

    public IQueryable<Bar> GetBars()
    {
        return _fooWcfService.GetBars().AsQueryable();
    }
}
于 2012-07-26T14:58:00.863 に答える