Print Page | Close Window

Silverlight N-Tier Deploy Questions

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1921
Printed Date: 21-Apr-2026 at 12:19pm


Topic: Silverlight N-Tier Deploy Questions
Posted By: Twister
Subject: Silverlight N-Tier Deploy Questions
Date Posted: 27-Jun-2010 at 7:42pm

Hi All, Our deployment scenario will see us serving/hosting the Silverlight solution but the client will be serving/hosting the sql database.

 

My questions are:

1.      How do we dynamically set the silverlight application to point to a certain database at runtime? Im hoping that the user will dial into the website, provide there database connection details, click ok. The silverlight application will than be connected to this database. Is this achievable? We will have many different clients, so for eg. client A might load up the silverlight app and provide their connection details than Client B will come in and provide their details and conenct to their database.

2.      If the database is local to the client (but the silverlight app will always be external since we will be hosting it) does the client need to be connected to the internet after the client pulls down the silverlight xap and files on the first initial hit? So if the client and database are located at Location A and the silverlight deployment is located at Location B. Does the silverlight app (in the clients browser) need to talk with location B to pull data from the local database?

 

Im a little confused at the deployment for this scenario and how devForce will play. So any advice would be great.

Thanks



Replies:
Posted By: Twister
Date Posted: 27-Jun-2010 at 8:08pm

We will also have customers where we serve/host the sql database for them. So that is our other deployment scenario.



Posted By: Twister
Date Posted: 28-Jun-2010 at 3:44pm
No love??


Posted By: ting
Date Posted: 28-Jun-2010 at 8:44pm

A Silverlight application cannot connect to the database directly.  There is no ADO.NET library in the Silverlight CLR that can do this.  It is also bad practice to expose the database directly on the internet - bad performance, security, etc.

You can dynamically configure the URL of the DevForce Business Object Server (BOS), however.  You do this by modifying the IdeaBlade.Config.Instance.ObjectServer node in the application prior to any EntityManager operations.
 
If the XAP file and the BOS are hosted on different URLs you will also need to deploy a clientaccesspolicy.xml file to the root of the IIS Server that hosts the BOS.  This is a sample file:
 

<?xml version="1.0" encoding="utf-8" ?>

<access-policy>

  <cross-domain-access>

    <policy>

      <allow-from  http-request-headers="*" >

        <domain uri="*"/>

      </allow-from>

      <grant-to>

        <resource path="/" include-subpaths="true"/>       

      </grant-to>

    </policy>

  </cross-domain-access>

</access-policy>

 
Once you get this file working, you will want to change the domain uri and resource path nodes to be more restrictive for security purposes.  You can google/bing clientaccesspolicy.xml for examples.
 
For disconnected scenarios, you can run the Silverlight application disconnected from the source of the XAP, and it should still be able to communicate with the BOS to get its data.
 
Is your requirement for this because your clients want to maintain control of their data, but want you to maintain the application?
 


Posted By: *Calsy
Date Posted: 28-Jun-2010 at 8:59pm

Hi, Thanks for the reply.

The requirement is because our clients want to control the database (and because we are rolling up from a previous version where the data was always hosted by the client) and we want to control the app so that we can perform the application updates without having to have the client update their web server.
 
Im thinking it is going to be simpler that we just supply the client with a website installer that will deploy the silverlight and BOS solution to their server. And just handle the upgrades manually. This way we get around security concerns and also if the client has the website served locally they dont have to travel out to the internet to retrieve anything.
 


Posted By: ting
Date Posted: 28-Jun-2010 at 9:05pm

Yes, I would recommend your last proposal.  It will minimize the likelihood of any deployment issues.




Print Page | Close Window