A Better Way to do Silverlight Databinding

The guys at Intersoft Solutions are ahead of the curve again with their Intersoft Data Source control for Silverlight. The CTP includes the AstoriaDataSource that connects cleanly to an ADO.NET Data service.

Rather than jumping through hoop after hoop to do asychronous calls and returned results, the control lets you do CRUD operations in only a few lines of code:

  AstoriaDataSource1.Delete("Customers", CustomerGrid.SelectedItem);

I haven't figured out how to do cascading deletes yet with this control, such as deleting a customer from the Northwind database. (I cover the old manual way in Episode 5: 'D' is for Delete of my Silverlight 2 Data Form series.)

With the Intersoft control, you use declarative binding by configuring the control in the markup, much the way you do with ASP.NET data controls:

        <ISNet_Silverlight_DataSource:AstoriaDataSource
            x:Name="AstoriaDataSource1" Grid.Row="2"
   ServiceHost="http://localhost:53948" ServiceTarget="NorthwindDataService.svc"
            ReferenceNamespace="NorthwindDataReference" ServiceTypeName="NorthwindEntities"            
            Selected="AstoriaDataSource1_Selected"
            Inserted="AstoriaDataSource1_Inserted"
            Updated="AstoriaDataSource1_Updated"
            Deleted="AstoriaDataSource1_Deleted">
            <ISNet_Silverlight_DataSource:AstoriaDataSource.Services>
                <ISNet_Silverlight_DataSource:AstoriaDataService
                    DataObjectTypeName="Customers" ServiceName="Customers"/>
                <ISNet_Silverlight_DataSource:AstoriaDataService
                    DataObjectTypeName="Products" ServiceName="Products"/>
                <ISNet_Silverlight_DataSource:AstoriaDataService
                    DataObjectTypeName="Employees" ServiceName="Employees"/>
            </ISNet_Silverlight_DataSource:AstoriaDataSource.Services>
        </ISNet_Silverlight_DataSource:AstoriaDataSource>    

2 Comments

  • Certainly looks interesting, thanks Ken.

    I have mixed emotions about declarative DataSource controls. While they certainly increase the speed you can throw together a data driven page I feel it inhibits other areas of good Line of Business application development.

    By having your data source in your view it can make using good UI seperation patterns such has MVP and MVVM a lot more difficult and also inhibits good unit testing of any pattern you do decide to use.

    Cheers

  • This is exactly what Rocky has done with his Csla.Net for Silverlight at least 8 months ago. So I would not say that the folks at Intesoft Solutions are "ahead of the curve" on this one.

Comments have been disabled for this content.