Or do I need a Silverlight client?
Yes, RIA services can be used from WPF, or in fact any NET Framework client. However many of the client-side controls typically used with RIA are Silverlight specific, so your mileage may vary.
You may want to look at WCF Data Services too.
I'm still learning the differences so not quite yet ready to compare the two.
Related
So, I've been using WCF Ria services for a few months now and I am wondering why would anyone use WCF basicHttp webservice over using WCF RIA Services?
Someone told me that RIA Services is not good for Enterprise Level Applications and I am wondering why?
W/out RIA it seems you have to write validation logic in 2 areas, client and server. Also, RIA handles roles and membership fairly easily.
How much extra work is involved if you want to use WCF basicHttp webservice? What is the benifit over using RIA? and.. Does anyone have any good examples of an enterprise level silverlight application using wcf basicHttp webservice?
Thanks!
The issues with WCF support in Silverlight relates to the limited subset of the .NET Framework embedded in the Silverlight plug-in as it's essentially a scaled down version of the .NET Framework. As a result of the scaled down .NET runtime in the Silverlight plug-in, it does not have the same full support for WCF that you get from standard .NET projects. This was done to make the initial download of SL quick from a client perspective and increase time-to-market of SL as a product. Keep in mind that the SL plug-in has no dependency on an existing .NET framework being installed which is why Linux, Windows Phone 7, and OS X versions are on the market.
As time has progressed they continue to add in-demand features in. For example, Silverlight 5 will support WS-Trust (see here for a complete list of new features in 5).
I recommend you read this resource to see what you may miss out on by trying to call WCF Services from the client:
http://msdn.microsoft.com/en-us/library/cc896571(v=vs.95).aspx
Keep in mind you could very easily proxy out calls to more complex WCF services through RIA Services endpoints which are in effect calling the service directly from server-side.
As for using standard WCF instead of RIA ... there are advantages when your middle tier has multiple client types, though with RIA you could simply expose your endpoints out as SOAP 1.1 endpoints and require people to connect using that paradigm instead of WCF. You do not have to use RIA or nothing; you could mix and match to meet your requirements as you see fit. Personally I am big on just using RIA if at all possible.
It's fair to say RIA Services has had its growing pains. Some of my biggest bugbears with it (such as not having the ability to return complex objects that aren't entities from Invoke methods, and the lack of decent support for being used in an MVVM way) have mostly been fixed in RIA Services SP1. Some people I know using it in huge enterprise applications have had major headaches with it (at least in the early days). I'm not quite sure where things stand now in that respect, as to whether their particular problems have been resolved yet.
That said, I personally think it's a fantastic technology. It makes tasks that are painful with standard WCF services easy (my favourite is being able to specify queries on the client on methods in your domain service that return IQueryable, that execute on the server - making sorting/filtering/grouping/paging a breeze). Whether it's right for you depends on your scenario. It's designed primarily to make performing CRUD operations on entities easy, so if that's primarily what you need then its perfect. RIA Services is designed to be consumed by Silverlight application only however (at least for the moment). You can access them from other clients, but you don't get all the features that makes them so good. So if you need to support other client platforms, it may not be the right fit.
I think RIA Services is awesome, but ultimately it depends on your scenario as to whether they are right for your project. As a technology, it's geared towards particular scenarios, and isn't intended to solve all the world's software development problems. Some people who might complain about it possibly aren't using it in the way it was intended, and pushing its limits (that said, it isn't perfect either, and has had its issues). If you can possibly provide some more details (such as the scale of the application, the client platforms it needs to support, and the number of developers on the project), I'd probably be able to give you some more helpful advice.
Hope this helps...
Chris
We are planning to move to Silverlight 3 for application development because we want to take advantage of more flexible UIs and easier deployment. We have previously used Winforms with ADO.Net and SQL Server for data driven applications.
I've briefly looked at some of the options for data access with silverlight such as Entity Framework and Linq to SQL etc. But due to the pace of Silverlight development by Microsoft I do not know which method is the 'correct' method, and feel slightly overwhelmed by the options.
Can you suggest the best method for data access that I should pursue further reading on? Which methods should be avoided or are obselete?
If possible point me in the direction of a good comparison which I can't seem to find.
The technology that best suits you would be WCF RIA Services around Entity Framework.
Why Silverlight 3? VS2010 + Silverlight 4 is a much more mature platform for this type of Line-of-Business application.
That said, the biggest leap facing you is going from WinForms to Xaml based Silverlight UI.
I'm trying to understand the best way to create line of business applications in Silverlight. I hear about entity framework and RIA Services and prism and I am completely confused. If I want to create a line of business application that pushes data to the the client application, which framework should I use?
Well, Prism in the context of Silverlight is definitely not the Mozilla project mentioned in the other answer. Prism is a Silverlight/WPF framework from Microsoft. The "Overview" paragraph on the following page explains it pretty well:
http://www.codeplex.com/CompositeWPF
I would recommend that you look into RIA services and the MVVM pattern to start with. Rather than Prism (which is a large framework that can seem daunting at first), I would recommend that you check out one of the smaller MVVM frameworks. I use MVVMLight from Laurent Bugnion (Sorry, I tried linking to it but stackoverflow won't let me. Just google it.) and that work fine for my requirements. Once you are comfortable with that you can decide whether you need the power of Prism or not.
/Henrik
You will likely want to use Silverlight + RIA Services. This is really designed exactly for that scenario.
I recommend reading Brad Abram's blog for info, in particular, What is .NET RIA Services?
He also wrote a very long, detailed series about RIA Services.
RIA Services gets data from the LOB application to your Silverlight client (and vice versa).
Entity Framework is the way to get data from your database to your LOB application (and vice versa).
Prism is a project Mozilla has developed that makes a web application look like a desktop application: http://www.riapedia.com/2007/10/26/prism_gives_web_apps_desktop_space
You can user WCF Ria services (very nice and usable data access) and silverlight. Prism is a very nice pattern for architecting modular applications, but I think that it would be an overhead if you want a simple application. MVVM is what you are looking for. MVVM is the design pattern depicting the presentation interacting with the model, but still you could avoid this also, if you want something pretty simple and quick. The learning curve from my pov includes (in order): Silverlight, WCF Ria Services, MVVM, Prism.
Is Silverlight RIA worth learning or should I stick to normal Silverlight?
Background:
I have done a couple small applications in WPF
I have 12 years expereince with business apps in the VB6/WinForms model
I expect to continue building business applications
My applications will be used internally
While ClickOnce does work for us, we want to get away from locally installed software.
To start with I'm wondering if there might be some confusion going on here.
There's actually no such thing as "Silverlight RIA", so lets clarify some concepts, RIA is commonly defined Rich Internet Applications, Silverlight is one of a number of technologies that can be used to build such applications.
However there's also the Microsoft technology WCF RIA Services, which is what I'm guessing you're referring to. WCF RIA Services were until recently known as .Net RIA Services.
WCF RIA Services (currently in Beta 2) has so far largely been targeted at Silverlight and is even hosted under the silverlight.net domain, which is probably where a lot of the confusion comes from.
However in theory it's not tied to Silverlight at all and is just a technology on top WCF to provide easy data access for RIA type of applications, for a more technical overview have a look at this blogpost by Nikhil Kothari it was written back in March 2009 about .Net RIA Services, so it might be a little out of date but it will give you a good idea on what it's about.
After defining these terms, it's a bit tricky to answer your question "Is Silverlight RIA worth learning or should I stick to normal Silverlight?"
Silverlight is definitely worth learning, by the looks of things Microsoft is going to stick with it. The latest recommendation I heard from someone close to Microsoft, was to go with Silverlight if you can for new LOB (Line Of Business) Apps, if there's something Silverlight can't do, then look to WPF.
Coming from a VB6/Winforms background there will be a bit of a learning curve, but if you've already done a couple WPF apps then you're on good way already.
Silverlight for LOB? Silverlight 3 started bringing in more features related to development of LOB, like for example support for WCF RIA Services. It looks like this is set to continue in Silverlight 4 (due out first half of 2010), with things like support for printing and COM for working with MS Office applications. There's also coming more and more pre-made controls from various 3rd party vendors for many of the standard LOB type of functionality.
So what about WCF RIA Services? It's definitely worth having a look at, it seems to be the preferred way of data access by Microsoft. It provides things like easy access to authentication and data validation. However saying that it's still in beta and there has been some voices raised against it, around the internet so it's probably worth doing some research, before going all in.
Finally, you say that you're applications will be accessed internally but that you don't want the hassle of locally installed software, Silverlight fits that perfectly, just roll out the small Silverlight plugin to your users machines and you're good to go. Any changes needed, just recompile your project and deploy your .xap file to the webserver and it will automatically get pushed out to the users next time they use the app.
Sorry for the somewhat long and rambling answer, I hope it's helped answer your questions :)
Cheers,
Ola
If you are doing business apps then RIA is definitely worth learning. I would recommend you take out an hour and watch this video: .NET RIA Services Intro. In fact you should take 2 hours and work along side this video building the example as you go.
I'm rewriting an LOB application whose architecture is like this:
Silverlight && Windows Mobile -> WCF
-> Entity Framework -> Database.
The mobile app was supposed to be able to do certain things as the silverlight app. What benefits would I get from using RIA Services here? Whats the advantage and disadvantage of RIA Services over WCF?
.NET RIA Services was created for Silverlight that runs in the browser. Silverlight is running a special version of the the .NET framework and in an N-tier application Silverlight is unable to share assemblies with the server side. By employing some clever code generation .NET RIA Services makes this gap almost invisible to the developer. Classes similar to the domain classes are code generated on the client side, and ways to move objects back and forth between client and server are also made available.
You will probably be able to call into a .NET RIA Service from Windows Mobile, but I don't think it will particular easy and currently you may in fact have to reverse engineer what's sent on the wire (JSON is used). WCF on the other has a much more broad scope, but doesn't support Silverlight development in the same way that .NET RIA Services does.
If you are writing a Silverlight only N-tier application .NET RIA Services are very powerful. If however Silverlight is only one of several clients WCF is probably a better choice.
Please note the .NET RIA Services hasn't been released yet, but a preview is available for download.
WCF RIA Services introduces several solutions for challenges you run into when using WCF from Silverlight. For instance, asynchronous loading of queries using the EntityQuery<T> is much easier than the Begin..End solution offered by WCF. Also, RIA provides integrated change tracking from your client that allow to submit or reject multiple changes as one change set. RIA will bundle all these changes into one request, but from your Domain Service it behaves as it were individual calls. As a long time WCF developer I can tell you that that is a breeze.
Ria services are created just to be used with Silverlight. They are substantially a standard "package" ready to be used by Silverlight. The advantage is that you have a lot of services without need to write code i.e.:
Support for data annotations
Support for membership provider and login
Support for transferring to silverlight server side generated exceptions. There is a difficulty in silverlight that make difficultthe normal error transfer of exception through FaultContract. The point is that the browser is not able to handle all error codes. Ria services solve this with a trick
All things done by Ria can be done with WCF and with other available software and in particular with Wcf data services. For instance for data annotations I found this library that do a better job than Ria services, support for membership just require activating the already existing membership endpoint of a WCF service, and finally the exception problem is easily resolved by writing a WCF behaviour. Code is available here:http://www.silverlightshow.net/Storage/10Tips.zip
The point is that with Ria Service you have all this in a mouse click!. On the other side Ria Services are really difficult to customize...so if you don't like the standard solution they offer you simply can't use them
RIA Services is built on top of WCF. With the PDC release, this will be much more evident. RIA Services simplifies the client-side programming model so that it matches very closely with your server-side DomainService and entities.
Regardless to the answer:
RIA Services is built on top of WCF.
With the PDC release, this will be
much more evident. RIA Services
simplifies the client-side programming
model so that it matches very closely
with your server-side DomainService
and entities.
For me (and I guess that for the topic author) it is not clear what RIA services provide also besides access to the DomainService (which is same thing provided by WCF)?
Thanks.
Until there is a formal release of WCF RIA Services, I don't think there is a definitive answer to this question. As of the current Beta (for VS 2008, SL 3), RIA Services does not hide the asynchronous nature of service calls; you still need to provide a callback method. Also, RIA Services does not currently support user-defined classes (or collections of user-defined classes) as either parameters or return values on RIA service calls. I'm also running into trouble providing non-editable entity classes through RIA Services. (The error says the entity collection isn't editable. Yeah, that is actually what I want....)
At this point, I need to fall back and take another look at making plain old WCF work. That's not so simple, given the size of the application we're developing, but it seems to be the workable solution until MS fixes some of the current problems with RIA Services.
.NET RIA Services had been named as WCF RIA Services in PDC which was held in November 2009. Since it is built on top of WCF, hence the name WCF RIA Services.
You'll need to use WCF RIA Services for building N tier application involving database(or any information that needs to be carried along the tiers).