OpenAccess & Silverlight with Astoria

3 posts, 0 answers
  1. Lev Rosenblit
    Lev Rosenblit avatar
    16 posts
    Member since:
    May 2008

    Posted 14 Oct 2009 Link to this post

    Hi,
    I have an application im working on. it consist of:
    - Entity Model + Data Access powered by Open Access
    - Web Application
    - Silverlight Application

    Usually, I build a mid tier for the Business Logic, and reference it in the web app. but this is not possible with silverlight so i use Astoria.
    I have two questions:
    1)
    When using Astoria - for example with the sample code for use with open access from the forum - I have an Order class, in that class there is a field of type Shipper. The context has a property of Orders (that extends all the orders into IQueriable) but doesnt have a Shippers property. When i run it this way - i get a shipper object inside the order object i get. If i declare a Shippers property in the context, the shipper field in order object - is always null. Its this way for every similar scenario. why is that?
    2)
    What is the best design method? Usually i have all of my business logic in the mid tier - in this case im forced to have all the logic done in the silverlight app. what about if i have some logic that i want to use in the web app and in the silverlight app - and its not just
    loading of data, but something ,more complex that requires parameters and logic?

    The currently available methods are declaring static WebGet operation (in the service file in the web app) or declaring interceptors (BTW - really studpid name for it) which are not good business tier solutions.

    I would really appreciate your thoughts...


  2. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 15 Oct 2009 Link to this post

    Hi Lev,

    Have you had a look at Stephen Fortes series on Open Access WCF Wizard? It has support for Astoria.

    As for number 2)
    So you could build your server side layering like this:


    WCF service layer (exposing you business service as a WCF endpoint for Astoria use)

    Business services (using data services to get and perform logic)

    Data services (repository of methods that work on the persistent model, your OA class library)

    Eventually you can make your web application go directly for the business services layer and let your silverlight application go for the WCF exposing your business service. Meaning there will be a one-to-one relationship between methods in WCF service layer and Business services layer.
    Of course you can also let both apps go for he WCF service layer.

    As for number 1)
    I have no idea why it behaves like this.

    Regards

    HG
     
  3. DevCraft banner
  4. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 20 Oct 2009 Link to this post

    Hello Lev Rosenblit,

    1) The problem here is that since the Shipper is exposed through the service, Telerik OpenAccess ORM won't load it by default. To have it loaded, you should not expose the Shipper class through your service. This is the only possible workaround for now.

    2) I believe what Henrik provided should be enough.

    Please feel free to contact us if any difficulties arise.


    All the best,
    Petar
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top