Tags: Blog |
Categories: Blog
Posted by
admin on
5/25/2009 4:59 AM |
Comments (9)
Microsoft is getting big in Patterns and practices, something that architects really like to see. I personally like to follow a pattern instead of designing my own, laziness? Probably not, whatever I came out with, won’t be as good as a team or people with more time and more intelligence.
Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. The RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. It also provides end-to-end support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier.
http://silverlight.net/forums/t/95364.aspx
Typical ASP.NET pattern

New Silverlight or RIA pattern

The .NET RIA Services framework makes it easy to create application logic that can be shared across tier boundaries. One of the built-in mechanisms for this is a convention-based approach to naming source files that allows files on the dedicated server to be replicated in the client project. Because the framework also generates client proxy types that match those on the server, these files can cross-compile between the two projects.
Download the .NET RIA Services here You’ll need Silverlight 3 in order to make it work.
What about Security? The User Service provided in the RIA Services framework encapsulates authentication, authorization, and user profile. It makes verifying and tracking user identity a simple part of application development
One feature the framework offers is passing the initial client state with the HTML page. For Windows authentication and persistent Forms authentication, this provides an initial state to the client without the need for an additional load call. Currently this feature is available as part of the SilverlightApplication control. To enable serializing the initial client state, replace the default Silverlight control with the SilverlightApplication control.
I’m very exited about where Microsoft is taking Silverlight and how they are working on Patterns already for the enterprise with a mix of ASP.NET.
If you are developing applications in Silverlight that are going to production, this pattern is for you to stay into the models defined.
Message based authentication managed by Silverlight not the browser.
Silverlight can use the browsers cookies and send them to the hosts. When you authenticate with ASP.NET the authentication cookie stored to your computer will be used by Silverlight if you create a Silverlight Authentication Service
Create a service.svc make sure to select the Silverlight Service.
<%@ ServiceHost Language="C#" Service="System.Web.ApplicationServices.AuthenticationService %>
On your web.config add the service to be enable it.
<!-- this enables the WCF AuthenticationService endpoint --> <service name="System.Web.ApplicationServices.AuthenticationService" behaviorConfiguration="AuthenticationServiceTypeBehaviors"> <endpoint contract="System.Web.ApplicationServices.AuthenticationService" binding="basicHttpBinding" bindingConfiguration="userHttp" bindingNamespace="http://asp.net/ApplicationServices/v200"/> </service>
Then just connect to the service as a service web reference and use the methods for the authentication.
Composite Application Guidance for WPF
Cheers
Al
27ce732e-2a05-4991-b60f-d6cc62ae809b|0|.0