This is a migrated thread and some comments may be shown as answers.

OpenAccess & Silverlight with Astoria

2 Answers 118 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lev Rosenblit
Top achievements
Rank 2
Lev Rosenblit asked on 14 Oct 2009, 11:08 PM
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 Answers, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 15 Oct 2009, 01:52 PM
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
 
0
PetarP
Telerik team
answered on 20 Oct 2009, 01:57 PM
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.
Tags
Integration with other products
Asked by
Lev Rosenblit
Top achievements
Rank 2
Answers by
IT-Als
Top achievements
Rank 1
PetarP
Telerik team
Share this question
or