Creating an application in N-Tier in Silverlight - silverlight

I want an demo example for an N-Tier application in Silverlight so that using this example as a reference i can develop my application which is also to be developed in same manner.
I have designed an application in Silverlight using N-tier but there are a lot of issues and i think m not using the right method to do it
Can anyone please provide me with such demo example or a link.It would be great if i can get a video tutorial.
Thankss

Start here: The MVVM Pattern make sure you make it through to the WCF RIA Services chapter.

Related

WPF, Clickonce and WCF

Is it possible to deploy with ClickOnce a WPF app that calls one or more WCF services?
It is a "normal" WPF app, not an XBAP WPF.
Does anyone has an example?
Not sure on the question.
I have a working WPF app that acts as a client to several WCF services. It is deployed via ClickOnce.
However, the deployment medium (clickonce) and the design pattern (WCF) really aren't related when you are talking about the client.
What are you trying to do, and what problems are you having?
Sure you can. A normal WPF app is just like WinForms. Consuming WCF services is behaviour that is allowed.
I don't have any samples by hand but simply googeling for standard ClickOnce Deployment should bring give you plenty of tutorials

Silverlight 4 Business Application Architecture

With the arrival of VS 2010 and Silverlight 4, I decided it's time to look into Silverlight and understand how to build a 3-Tier business application.
After several hours of searching for and reading documentation and tutorials, I'm thoroughly confused (and that doesn't happen easily).
Here are some specific points I don't understand. I welcome guidance on any of them, and also would appreciate any references to a really good tutorial.
Brad Abrahm's What is a .NET RIA services (written for Silverlight 3) seemed very promising, until I realized I don't have System.Web.Ria.dll on my system. Am I missing an optional download? Was this rolled into another DLL for Silverlight 4? Did this go away in favor of something else in Silverlight 4?
This recent blog says to start from a Silverlight Business Application, remove unwanted stuff, create a WCF RIA services Class Library project, and copy files and references from the Business Application to the WCF RIA services project, while manually updating resource references (perhaps bug in B2 compiler). Is this really the right road to go down? It seems... clumsy.
My requirements are to perform very simple CRUD on straightforward business objects.
I'm looking forward to suggestions on how to do that the Silverlight 4 way.
I would say that since the silverlight application will be built on top of ASP.NET, the back-end would be the same for the application whether it was Silverlight or Html (WebForms/MVC)
You could have a look at the CSLA Business Object Framework that includes support for silverlight: http://www.lhotka.net/cslanet/
Not sure 100% if its support Silverlight 4.0 yet, but if its doesnt I am sure it will soon.
To answer your first question, the System.Web.Ria assembly has been replaced by these two assemblies:
System.ServiceModel.DomainServices.Server
System.ServiceModel.DomainServices.Hosting
You can find a list of the breaking changes with the v1.0 release of WCF RIA Services right here.

Silverlight and Line of Business Applications

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.

Silverlight - Good for Internet Business Application?

I've heard the comment several times, once in one of Shawn Wildermuth's podcasts, that Silverlight is great, but might not be so good for 'entire' internet applications. This comment never get's amplified, but the implication seems to be that you would use Silverlight in conjunction with standard aspx web pages.
So far, the only downside I can see to an all Silverlight application is that the XAP file could get very large, meaning that when a web app is opened, there would be a very noticeable delay.
Most of the apps I do in .NET would be considered small. They are business / CRUD apps of maybe 25 aspx screens along with the supporting cast.
Does anyone have an expanation of the downside of a mostly Silverlight app?
Thanks
Mike Thomas
I'm aware of Shawn's comment, but I think it's a bit dated. If I remember correctly that comment was made before Silverlight could easily handle browser navigation, deep linking and SEO. Those issues are addressed now (largely thanks to RIA services) and Silverlight is a first class web citizen imo. I've done 2 Silverlight only business apps (i.e. the Silverlight content is full screened; there are no ASPX parts to the apps) and have been quite successful with them. A big plus about creating a Silverlight only site is that it's very easy to debug homogeneous content. Take a look at .NET RIA Services if you're seeing holes that need to be plugged when creating a SL business app.
EDIT: RIA Services is Silverlight framework that facilitates development of data oriented Silverlight applications - it's currently in a preview (i.e. not finished) release state but my experience has been that it's stable. WCF is a communications framework used by Silverlight to enable client to server connectivity; it's very similar to traditional web services. RIA Services uses WCF to perform client/server communication. Check out Brad Abram's post "What is RIA Services" for a quick overview here http://blogs.msdn.com/brada/archive/2009/03/19/what-is-net-ria-services.aspx then read his full 25 post series for all the details on RIA Services here http://blogs.msdn.com/brada/archive/2009/08/02/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-summary.aspx
If you want to see a complete Silverlight application in action, check out http://www.mediacourtyard.com. They have implemented a complete CMS front-end in Silverlight. Check out the demo, it appears to be fairly stable and functional.
(I have nothing to do with them btw. I trawl the web for Silverlight apps a lot and that CMS is the coolest "full" app I've found so far.)

Silverlight 2 UI pattern

I have to build small (for now) admin app in Silverlight2, and would like to use some pattern for binding UI with my BL/DAL.
I found view-model-viewmodel and mvp/mvc patterns, where first one (V/M/VM) is specially suited for WPF apps, because it uses rich capabilities of WPF data-binding options. What do you suggest? Can you write simple example of V/M/VM for SL2?
Nikhil Kothari has a great set of examples (with code) on M-V-VM in Silverlight as well as a framework built with some very nice extra features. You should definitely check them out.
M-V-VM in Silverlight
The Patterns & Practices group at Microsoft has put together some guidance around doing WPF and Silverlight applications.
You might want to look at CSLA.NET for Silverlight. I've heard good things about it but haven't gotten around to try it yet myself.
CSLA .NET for Silverlight is a subset
of CSLA .NET targeted at the
Silverlight platform. CSLA .NET for
Silverlight offers nearly all the
benefits of CSLA .NET on Silverlight,
including data binding, validation,
business rules, authorization, n-level
undo and persistence.
The result is that CSLA .NET for
Silverlight enables the creation of a
rich object-oriented business layer
running on the Silverlight client,
that can transparently communicate
with CSLA .NET objects running on the
web and application servers.
Silverlight has also very powerful data-binding, so there is no problem with that.
The missing piece in Silverlight that affects more to the Model-View-ViewModel pattern is that it doesn’t implements commands like WPF. Here is an article by Josh Smith that reproduces the command pattern of WPF in Silverlight.
Shawn Wildermuth of Wildermuth.com wrote an article about the MV-VM Pattern, check it out, here is the link of the article "Model-View-ViewModel In Silverlight 2 Apps"
Norwegian developer Gjøran had a very nice presentation/demo at MSDN Live about writing business apps in WPF. Really it was about using Presentation Model with Silverlight/WPF. Have a look at the source code from this article on his blog (sorry, the slides are in Norwegian only). Presentation Model + silverlight 2 rocks!!!

Resources