Showing posts with label Silverlight. Show all posts
Showing posts with label Silverlight. Show all posts

Tuesday, February 23, 2010

Silverlight Data access

Pro Silverlight 4 in C#Pro Business Applications with Silverlight 4Pro Silverlight 3 in C# (Expert's Voice in Silverlight)Silverlight 4 Lab: Intensive Skills Training

One of the bigger beginner misconceptions about accessing data in Silverlight is people looking for some ADO.NET class library in Silverlight. Stop looking, it isn’t there. Remember, Silverlight is a client technology that is deployed over the Internet. You wouldn’t want a browser plug-in to have direct access to your database…as you’d have to expose your database directly to the web. We all know that is generally a big no-no.


So the next logical step is to expose data via service layers. This is how Silverlight can communicate with data. Here are the primary means:

•Web services: SOAP, ASP.NET web services (ASMX), WCF services, POX, REST endpoints

•Sockets: network socket communication

•File: accessing static content via web requests.

Sockets
Sockets are probably the most advanced data access endpoints. These require a socket host to exist and, at the time of this writing, also require communication over a specific port range. If this is acceptable for you, this can be a very efficient and powerful means of communication for your application. I don’t think, however, that this is going to be the norm if your application is public facing on the web – I see sockets right now being more for business applications. Some resources for Sockets:

SDK documentation

Working with data in sockets (Dan Wahlin, MVP) – this is Silverlight 2 but still relevant to understanding the concepts

Working with Sockets requires you to really understand your deployment scenario first before you jump right in and think this will be the best method.



File Access
Silverlight can communicate with local data or data on the web. For local data access, the application does not have direct access to the file system, but rather can read/write data via user-initiated actions using the OpenFileDialog and SaveFileDialog APIs to request and save streams of data to the local user’s machine.
Additionally, you can use plain text files or XML files on the web and have your Silverlight application use standard HTTP commands to read/write that information. Here’s some helper information on using some of these methods:

OpenFileDialog and File Upload

SaveFileDialog

You may find yourselves using these techniques to save settings-based data or use very simple data access.



Web Services
This is the heart of accessing data in Silverlight – through a service layer. Silverlight supports accessing standard ASP.NET web services (ASMX) or WCF-based services using the familiar Add Service Reference methods in Visual Studio that will generate strongly-typed proxy code for you.
Additionally you can use the standard HTTP verbs to access more POX (Plain old XML) or REST-based endpoints. Understanding how to consume these various service types is probably the best time spent a developer can educate themselves on understanding what will be right for their scenario. Here’s some resources:

Consume WCF and ASP.NET Services

Calling services over HTTPS

•.NET RIA Services

Choosing a data access layer (Shawn Wildermuth, MVP)

The third point there, .NET RIA Services, is a new framework that aims to make accessing data simpler and more familiar. The link to the video will walk you through an introduction of that topic. RIA Services is best when you own the database and are hosting services in the same web application that will be serving up the Silverlight application.

Thursday, September 24, 2009

SharePoint Track in MSDN Ramp Up




Ramp Up is a free, online, community-based learning program, with a number of different tracks that will help you build your portfolio of professional development skills.The SharePoint track will immerse you in many of the developer-centric capabilities of Microsoft Office SharePoint Server.


Introduction to Web Parts


Did you know that in SharePoint you can build pages as easy as in ASP.NET – and allow end users to create dashboards? Web parts allow for creating components of Web user interface that can be reused on multiple Web pages. These are introduced in ASP.NET and built on in SharePoint where they can be added to pages by end users and managed by IT Professionals. In this topic you will learn about building simple Web parts for SharePoint and how to connect them back to SharePoint site data.




Data Lists for Developers

Did you know that SharePoint developers can work with data from lists that users get access to too? Data lists provide data storage for end users in SharePoint. End users can create lists with schema all through the SharePoint user interface and they can create, edit, and view the data. All of this data can be programmatically accessed by developers and this topic is all about that.



Programming Event Handlers

Did you know that SharePoint developers can automatically process data that your users upload via a spreadsheet? Event handlers (or event receivers) are custom code that runs on the SharePoint server in response to something that happens on the server. Event handlers can be useful for running business logic in response to data being added to the site. This topic shows how to create simple event handlers and investigates ways that event handlers can be used in SharePoint.



Workflow in SharePoint

Did you know that you can write WF workflows in SharePoint without having to worry about storage, persistence, or how to interact with the user? Workflow in SharePoint allows for implementation of processes that require interaction such as email approvals or form completion by people in your organization. This topic shows you how to create simple workflows in SharePoint using Visual Studio that involve approvals from people by email and for meeting room resource bookings with an administrator.



Silverlight and SharePoint

Did you know that you can build rich Internet applications with SharePoint? Silverlight is a new Web user interface technology from Microsoft that allows for easy implementation of animations and videos. This topic shows how a SharePoint user interface can be enhanced by using Silverlight in Web parts as part of a SharePoint site.



Visit the Ramp Up site and sign up for free.