none
How many dbml's to create or how to structure the DAL? RRS feed

  • Question

  • I have three WCF-services and each one works with some parts of the database.

    The database contains a few tables:

    1. RegisteredTickets
    2. Stations
    3. Documents
    4. DataVersion
    5. RegisteredCenters
    6. Transporters
    7. TariffPlans
    8. Passways

    The first service named MainService works with 1,2,3,4 tables.

    The second service named Exchanger works with 1 table.

    The third service named Infrastructure works with 2,3,4,5,6,7,8 tables.

    As you can see there are some intersections (the same tables are used in different services).

    How to structure the DAL? How many dbml files could you recommend to generate?

    Friday, June 22, 2012 6:56 AM

Answers

  • I will have 3 dbml for each project, as this is easy to maintain and troubleshoot when there is a problem in WCF.

    Otherwise create two dbml file. One called shared dbml and dedicated dbml. 

    IT actually depends on your priority. Maintainability or performance or reusability. Think over that and select. 

    Cheers,

    Chandra.

    Monday, June 25, 2012 5:03 AM

All replies

  • With common sense, better create individual files for each table. So when you consume them from logic layer, we will still get the sense of table structures. Also relationships between them will also more clear by that way.

    Anyway, may be, according to your application and structure, you may build virtual data world by combining some tables in one dbml.

    Cheer!


    • Edited by TinMgAye Friday, June 22, 2012 7:08 AM
    Friday, June 22, 2012 7:07 AM
  • I will have 3 dbml for each project, as this is easy to maintain and troubleshoot when there is a problem in WCF.

    Otherwise create two dbml file. One called shared dbml and dedicated dbml. 

    IT actually depends on your priority. Maintainability or performance or reusability. Think over that and select. 

    Cheers,

    Chandra.

    Monday, June 25, 2012 5:03 AM
  • Hi FofanovIS,

    Welcome to MSDN Forum.

    Yes, I agree with @vchandm23. How to struct the DAL need to take many informations in consideration, such as maintainability, performance and reusable, like vchandm23 said. Creating 3 dbml files is easier to maintain.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us


    Monday, June 25, 2012 8:22 AM
    Moderator