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

https://dev4net.members.winisp.net/blogcasts/ServiceFactory-Mapping.wmv

Comments

  • Anonymous
    April 28, 2006
    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!

  • Anonymous
    April 29, 2006
    good stuff...

  • Anonymous
    April 29, 2006
    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 ;)

  • Anonymous
    April 30, 2006
    The comment has been removed

  • Anonymous
    May 01, 2006
    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 :)

  • Anonymous
    May 03, 2006
    looking fwd for the next blogcast, which gives information on how to modify the recipies in guidance package...

  • Anonymous
    May 12, 2006
    Great stuff, please keep them coming. They are very informative.

  • Anonymous
    May 14, 2006
    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?

  • Anonymous
    May 30, 2006
    Hi,
    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?
    Thanks,
    Gaurav

  • Anonymous
    October 29, 2007
    Background I’m in the process of writing a small windows application with a very straightforward architecture,

  • Anonymous
    November 20, 2008
    This article is part of a series; · WCSF Application Architecture 1: Introduction · WCSF Application