A hybrid/mixed approach for using WCF/SC/DC/SF

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Jun 4, 2008 at 5:37 PM
I wanted to verify a hybrid-approach that I am thinking to address few performance concerns in my large C#/C++ based product:

- We have a smart client application that very chatty and very data-centric.
- We have different clients where we host our product [Both services and client apps]
- Clients need some services so that they can integrate with our core product

Solution:
     - For our Smart Client UI:
              1. We break the rule and create single-class that is both Business Entity and Data Contract -right in DAL layer
              2. This dual-duty entity will travel all the way from DAL layer to UI layer [but it will only carry data]
              3. We will have our service interfaces defined in core-service/Business layer where we re-use services through interfaces
                    - We are not able to clearly distinguish service implementation and business logic layer? Any thoughts?
                       (My understanding is, service implementation will just implement service inteterface and we re-use some set of business logic objects [by sharing type]
                         instead of implementing any business logic in service implementation layer)
                               - Is this assumption correct? Is so, are we not again adding dependency across services by sharing type [business logic libraries?]
              4. We will be hand-coding all service and data contracts that we use for our UI [as we are splitting them to different lower levels] and don't know how to customize SF to do so.
              5. We will still use WCF calls from UI to get to our service but we will not be using Service Factory or get any benefit from it for our Smart Client application

    - For our Client environments where end-clients want to integrate with core-product:
              1. Only here we will be creating set of Service Contracts/Data Contracts using Service Factory
              2. Here we will deal with re-using set of services created above and packaging them differently
              3. For end-clients we expose different set of service contracts and data contracts 
              4. We will do required entity translation etc.

Pros for this hybrid/mixed approach:
        - Our own smart client application that we are building on top of services will not take any hit around translations and reduces our coding 
           [From creating multiple copies of same or similar class in different layers]

        - Same time our end-clients get cleaner WCF contracts that won't change even if we change they we play with our own Smart Client

I want run it by some WCF/SF experts and see what their thoughts are around this OR need their blessings :)

Regards
RJ