Service Factory: Entity Translation

For the third installment I've decided to talk about the entity translation (mapping) capability of the guidance package. Specifically, this is mapping between the entities that are [de]serialized to/from the wire representation and the entities that represent the business domain model. This time I used a high-quality mic (Shure) and better software (Camtasia Studio), but WMV is still the best output format for this delivery mechanism (MP4 isn't an option). I also tried 1024 x 768 instead of 800 x 600.

File: ServiceFactory-Mapping.wmv
Length: 15:15
Size: 5.93 MB

Comments (11)

  1. Good stuff, Don. I have a question about the generated translator classes, though:

    Is there any reason that they weren’t created as static classes? They don’t seem to have any functionality that would require them to be instanced.

    Keep these up! They’re great!

  2. Srdjan says:

    good stuff…

  3. LockSmithDon says:

    That’s a great question Matt. As a matter of fact we we’re asking ourselves that very question just yesterday. Many of us on the team agree with you that they would probably be more appropriate as static classes. However, the dev that implemented this functionality is an extreme TDD guy and generally doesn’t favor static methods as a general rule because they don’t test as well. With that said, don’t be surprised if they are static the next time you see them šŸ˜‰

  4. Is that a Shure SM57 or SM58? Sounds like your gain is up way too high.

    Yet another great screencast!

    – Mark

  5. KjellSJ says:

    Thanks for these really useful, on-topic blogcasts.

    Alas, since this is guidance, it would be nice if you stuck with best practices such as using a message contract to contain the data contract, as you did in the previous episode. Afterall, a bunch of developers will use this exactly as shown. Better to lead them onto the righteous path to WCF/WSCF services.

    This is the purist in me speaking šŸ™‚

  6. Ashi says:

    looking fwd for the next blogcast, which gives information on how to modify the recipies in guidance package…

  7. Markus says:

    Great stuff, please keep them coming. They are very informative.

  8. Craig Boland says:

    I’m still unclear where schema validation of the incoming message occurs in web service calls. For example, I create a USStateType schema entity that contains elements for all US states. I’ll set the type of the Organization.State element (from the blogcast demo) to USStateType. Since State is a string, it will deserialize to a string value, even if the value isn’t defined in USStateType.

    In practice, I’ve seen two solutions to the problem:

    1. Duplicate schema validation in web methods that receive an Organization object and manually check the Organization.State value.

    2. Have the web method receive a generic XmlDocument and use the .NET built-in validating readers.

    Neither of these are very good, but they can create a system that functions correctly (even though long-term maintenance will be a problem).

    Can you comment on this, Don?

  9. Gaurav says:


    I’m currently involved in an insurance project in which the input (request message) is ACORD message which define almost all elements as optional and have acord defined code values for enumerations. The purpose of this web service is to map the ACORD message to corresponding business entities. The two main challenges faced were 1. How to do code list conversion and 2. How to map the elements where request message does not contain all the infomration(as they are optional) but in business entity they are defined as either required or null able.

    Are you planning to issue some guidelines regarding these problems?



  10. Background Iā€™m in the process of writing a small windows application with a very straightforward architecture,

  11. This article is part of a series; · WCSF Application Architecture 1: Introduction · WCSF Application

Skip to main content