Print Page | Close Window

Silverlight Guidance for DevForce EF developers?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1390
Printed Date: 06-May-2024 at 11:29pm


Topic: Silverlight Guidance for DevForce EF developers?
Posted By: AdamC
Subject: Silverlight Guidance for DevForce EF developers?
Date Posted: 23-Jul-2009 at 1:08pm
My company is currently using DevForce EF (WinClient) to develop a WPF application.  We would like to eventually deploy certain pieces of the application using Silverlight and will most likely upgrade to DevForce Universal to obtain the DevForce Silverlight product.

To my question: Is there anything we can be doing now in our DevForce EF-related code that will help us minimize re-writes when we start working on our Silverlight application?  In other words, we are looking for some guidance on writing business logic/ DevForce EF queries so that we will be able to share our code between the WPF and Silverlight applications.

Thanks in advance for any information you can provide!



Replies:
Posted By: ting
Date Posted: 23-Jul-2009 at 4:51pm

Our goal was to make the WinClient and Silverlight business objects and APIs as close to each other as possible.  With that said, there are necessarily a few differences between the environments.

One of the biggest differences is that all network access is asynchronous in Silverlight.  This means that you will need to use asynchronous queries and saves when working with the persistent data store.  There are a few things in DevForce that can make this easier.
 
First, you can use the cache-then-compute pattern to bring all of the necessary objects into cache first, and then execute a fully synchronous block of logic against the cache using the CacheOnly QueryStrategy.
 
Second, to avoid the headache of managing event handlers for all the asynchronous tasks, DevForce provides the AsyncSerialTask and AsyncParallelTask classes that will take multiple tasks and automatically execute them in serial or parallel for you.
 
When designed correctly, you can share all of your business objects and business logic code between your Silverlight and your desktop/smart client application.  On the UI side, you can share a bulk of the code if you limit yourself to the Silverlight subset of the WPF API.
 
The ModelExplorer and PrismExplorer also have example patterns and practices for building a Silverlight application.
 


Posted By: AdamC
Date Posted: 24-Jul-2009 at 6:37am
Thanks for the information!  I will definitely take a look at the ModelExplorer and PrismExplorer examples.



Print Page | Close Window