Data types in Pattern & Practices Web Service Software Factory

Discussion in 'ASP .Net Web Services' started by Henrik Skak Pedersen, Dec 13, 2006.

  1. Hi,

    I am trying out the Web Service Software Factory to see whether I would like
    to use it, for a new web service which I am creating. The web service is
    responsible for reading data from a database and passing it on to a web
    application. So I have a lot of business entities and generics lists.

    My problem is that I have to create all data types double both in the
    BusinessEntities project and in WebService.ServiceContracts. The data types
    are exactly the same in both layer. Do I really have to do everything double
    or can I just delete the WebService.DataTypes and reference the
    BusinessEntities project instead?

    Thanks
    Henrik.
     
    Henrik Skak Pedersen, Dec 13, 2006
    #1
    1. Advertising

  2. Hello Henrik,

    I've also found your another thread regarding on a custom type with Generic
    List member issue. I haven't noticed that you're using the "Service
    factory", now I get it here. As for the "Service Factory", it by default
    provide a recommend structure of webservice solution architecture and mapp
    each abstract solution layer to certain visual studio projects in a
    template solution. And you're surely able to customize them as your
    specific scenario.

    For your scenario here, if you think duplicate the same custom class in
    both busicness and service contact layer, you can directly modify the
    service contract and implemention layer and use those classes used in
    business layer. However, make sure those classes are well defined for using
    in ASP.NET webservice since they'll need to be serialized in XML soap
    message. The reason why the "service factory" will create two set of such
    classes in both service contact and business layers are that the classes
    used in business layer may contains many fields/methods that are specific
    to busines logic rather than data/properties. And webservice layer only
    need some light weight classes which concentrate on the data it will hold.


    #Web Service Software Factory
    http://msdn.microsoft.com/msdnmag/issues/06/12/ServiceStation/Default.aspx?l
    oc=en#S3


    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Dec 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ashish
    Replies:
    1
    Views:
    445
    Karl Seguin
    Jan 20, 2005
  2. Medi Montaseri
    Replies:
    17
    Views:
    905
    Medi Montaseri
    Sep 3, 2003
  3. Ed Fair
    Replies:
    8
    Views:
    508
    Ed Fair
    Jan 13, 2004
  4. sunny
    Replies:
    1
    Views:
    476
    Salt_Peter
    Dec 7, 2006
  5. C#
    Replies:
    4
    Views:
    427
Loading...

Share This Page