locked
Layering Question RRS feed

  • Question

  • I have the application (Visual Studio Solution) I'm developing divided in different layers (projects) (more or less applying DDD):
    Infrastructure (Entity Framework Data Model, ...), Domain (POCO's), UserInterface. I have two different user interface audiences: 1) the end-user (using smartphones) and 2) the administrators (using desktop browser). My idea is using WCF Data Services for the smartphone part and webforms for the administrator part.

    My questions:

    - 1) Where should I architecture-wise create/host my WCF Data Service: in the UserInterface layer or in a different layer (eg in a separate Application layer, or ...)? However when creating the WCF Data Service in a different layer as the UserInterface layer/project , I suppose, will give cross-domain problems?
    - 2) Since I have a user interface for 2 different audiences, I suppose, the best way is to create two separate user interface projects within my solution?
    - 3) I suppose the general architecture of using WCF Data Services for the mobile (Smartphone) part and WebForms for the Administrator part are good options?

    Thanks.

     

    Tuesday, June 8, 2010 9:18 PM

All replies

  • Greetings

    For smart phones and webforms the database have to be different. I think for smart phones you can sql ce database.

    Generic Overview layout for the software architecture.

    In any of the case , layer is different for smart phone and  webforms

    WCF Layer <==> Bussiness Domain <==> Data access Layer <==> Database.

    In the case of web forms  you can use mvp design pattern .

    WCF Layer <==> Bussiness Domain <==> Data access Layer <==> Database.

    Some links are given for databases for pda.

    Welcome to UltraLite
    This chapter introduces you to UltraLite features, platforms, architecture, and functionality.
    http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0901/en/html/ulfoen9/00000008.htm

    SQL Server Compact 3.5
    http://www.microsoft.com/sqlserver/2005/en/us/compact.aspx

    You also need to think which method is suitable for hosting wcf service , you can use sql server 2008.

    Kindly ensure for pda and webforms their separate folder strucutres and database have to different.

    Hope this helps.

    Take Care

    PL

     

     

     


    Helping People To Solve Technical Problems
    Wednesday, June 9, 2010 2:52 PM
  • Thanks.

    Maybe it was not clear in my question, but the Smartphone part is also a webapp (no native app).

    thanks.

    Wednesday, June 9, 2010 5:40 PM
  • WCF is not a presentation layer thing.  It's a data model / business layer kind of a thing.

    I've only done winforms development on a smartphone so I'm not entirely sure on the options for presentation.  I think though that you can use css to present a totally different format on a smartphone.  In that way you could have one webform application with user interfaces that look different depending on the device used.

    You can certainly use forms level security to limit certain users to admin areas of a webforms app. So some of your screens could be teeny sized and smartphone users are expected to use them.  Some of your screens are big and go in an admin folder.  My assumption here is that admin users do different things to regular users.

     You can then supply data via wcf services and stick them on separate machines if you really want to.  These can cache data and spread load so there's also some advantage in doing this.

    You could put everything in one webforms solution and have separate logical layers for business and data. 

     

    Thursday, June 10, 2010 9:35 AM
  • Thanks.

    WCF is not a presentation layer thing.  It's a data model / business layer kind of a thing.

    Indeed WCF and/or WCF Data Services normally shouldn't belong in a Presentaion Layer. Following the DDD approach wouldn't WCF be a candidate to host in a separate Application Layer? Of course we couild also host it in the Infrastructure Layer (where I also host my entity model, repositories). BUT, the problem with not hosting WCF Data Services in a different layer than the Presentation layer obviously give problems due to accessing the WCF Data Service cross-domain. How can I solve this problem?

    Some of your screens are big and go in an admin folder.  My assumption here is that admin users do different things to regular users.

    Indeed 'normal' and admin users do different things. I even consider hosting the mobile web app in a separate domain style m.mycompany.com, I suppose when I want to do this I need to create 2 separate (Presentation Layer) Visual Studio projects: one for the admin stuff and one for the mobile webapp for "normal" users? These 2 presentation layer projects would then use the other common project layers (infrastructure, domain, ...)?

    Thanks.

     

    Thursday, June 10, 2010 7:36 PM
  • Hi,

    1. I dont think you really need to have another user interface for smarphone just for WCF data transfer..As soon as the data come from the device, let the service catch the request and process.

    (i assume you have a separate smartphone application)

    2.I think ,it is good to keep the WCF service plumbings in the infrastructure layer and let it be called from the Application Layer.

    I suggest using WCF for smartphone in a way that the desktop service should transfer the data in the form of encrypted XML and use it on the device.

    WCF for web app is not a big deal.

    I suggest it should be the application layer that decides the request ,if it has come from smartphone or web client and pass the data accordingly.

    Hope this helps....

     

    Raghu

     


    Ace
    Monday, June 14, 2010 1:53 PM
  • Thanks.

    2.I think ,it is good to keep the WCF service plumbings in the infrastructure layer and let it be called from the Application Layer.

    It's not clear to me as what I should go in the Application Layer?

    Thanks.
    Guy

    Sunday, June 20, 2010 2:24 PM
  • Guyd,

              If any WCF services need to be invoked, you can call the respective WCF service from application layer.. 

    This is a good starting point probably you want to look at..  http://msdn.microsoft.com/en-us/library/ff648105.aspx

            Hope this helps...

     

    Reagrds

    Raghuj

     


    Ace
    Monday, June 21, 2010 4:46 AM