views:

6539

answers:

11

We are starting a new project and I'm trying to decide which of the Wpf-esque develop/deploy strategies we should go with. In our case we are looking at quite a complex business app that will be used by 100s (not 1000s) of people, So I'm leaning towards a click-once app. My boss likes the idea of a Silverlight app as it means easier deployment. So which way should we jump?

The answer is, of course, "it depends". So what are the pros and cons of each?

I'll start the ball rolling (Edit Added in some answers from artur carvalho):


Silverlight

  • Pros

Cross browser
Doesn't require full framework.
Better control of users. If your users login, you dont have to worry with activation keys or similar stuff.
It works on Windows and Mac.
You can update all your users apps easily.

  • Cons

Can't interact with client's file system etc
Has less functionality compared with full Wpf (anyone got a good resource that documents differences?)
Single window
Single version


Wpf Web App (xbap)

  • Pros

Full Wpf.

  • Cons

Single browser
Requires full framework
Can't interact with client's file system etc
Single window
Single version


Wpf Click once

  • Pros

Full Wpf
Can work offline
Multiple windows
Multiple versions (con?)
Better access to low level parts of the computer
No downtime for maintenance

  • Cons

Single browser
Requires full framework
Slightly(?) harder to install.

+3  A: 

First, I would evaluate whether a web client (ideally MVC+jQuery) can't do the job...

Assuming a full client is warranted:

If it is a business app that demands a client, I would tend to go with the full framework and ClickOnce; the main difference here (re deployment) is that the client must have the framework installed - but past that, ClickOnce deployment is very pain free. Actually, building a ClickOnce manifest is much easier than Silverlight etc, since the IDE will do almost all of it for you; you just have to host the files somewhere (could be a web URL; could be a network UNC).

This gives you much more control (and power) at the client, as well as a far greater range of existing resources to use (for example, if you need, you can use some legacy winform code on the WPF surface). The "requires full framework" is also one of the largest benefits: "has full framework".

You should also perhaps consider the 3.5 "client profile" setup; not sure how wide-spread this is in reality... but worth knowing about.

Marc Gravell
A: 

You can add to the pros and cons of the usual stuff of the online vs offline debate. Some items:

Pros

wpf(offline):

  • better access to low level parts of the computer.
  • cpu usage is local, so you rarely have cpu load issues.
  • not dependent of the net.
  • no downtime for maintenance.

silverlight(online):

  • Better control of users. If your users login, you dont have to worry with activation keys or similar stuff.
  • It works on Windows and Mac.
  • You can update all your users apps easily.

I simplified it a bit, there are gray areas in the list. I only tinkered with XBAP, so that one I'll leave out. The Cons are not hard to figure out after looking to the pros.

HTH

Artur Carvalho
Some good points! Thanks.re: "cpu usage is local". That's the same for Silverlight is it not?
Mark
Yes, bad choice of words. What I meant is that when you have a server you have load problems, but I was too lazy to put cons :-)
Artur Carvalho
A: 

I would consider WPF ClickOnce with sync framework support (www.msdn.com/sync). This would allow you to support limited functionality when the user is not connected to the corporate network (which will eliminate any browser-based deployment scenarios, such as Silverlight and XBAP).

Philipp Schmid
+2  A: 

You didn't say if this is a company only application or a public facing one. That alone will decide it for you.

If company only, I would go with full WPF click once. This will give you everything. Full framework should not be an issue. It's a one time install running in the background so it's not something that your decision should depend on. Cons: it runs in Windows only but if your company is Windows only, this should not be an issue.

However WPF apps could be resource hungry so you need to know if all your client machines are capable of running WPF apps smoothly.

If it's an Internet app, go for Silverlight: it runs under different operating systems.

Abdu
A: 

If you don't need all WPF I would try do it in Silvelight first Then you can switch to WPF more easily if you need it later.

Here I think it applies the “less is more” principle: it’s true that with WPF you have much more options and can access to the user computer, but that can finally be more a problem than a help as the times go. Think for example in how many changes you can need to change from Windows XP to Vista in an application that uses a lot of the “user computer” resources!

DaniCE
A: 

Mark, what do you mean when saying 'single browser' for XBAP? XBAP does work with Firefox for example. It indeed requires .NET Framework and it is unlikely that we will have WPF in Mono anywhere soon (if ever) so you are stuck with Windows, that's right.

IgorK
A: 

The pros 1. The Silverlight plug-in means developers can target a single, consistent runtime for browser-based applications, rather than dealing with the complexity of multiple browsers in different versions. You also get video and multimedia effects that are hard or impossible with pure HTML and JavaScript, though Adobe Systems' Flash has the same advantages. 2. Execute .NET code without deploying the .NET runtime. The Silverlight plug-in does include a cut-down .NET runtime, but instead of dealing with a large download and the complexities of the Windows installer, the user has a small download of about 4MB, all handled within the browser. In my experience so far, installation is smooth and easy. 3. Performance is promising. Silverlight comes out well in this prime number calculator, thanks no doubt to JIT compilation to native code, though it may not compare so well for rendering graphics. 4. Support for Moonlight means there will be an official open source implementation of Silverlight, mitigating the proprietary aspect. 5. Silverlight interprets XAML directly, whereas Adobe’s XML GUI language, MXML, gets converted to SWF at compiling time. In fact, XAML pages are included as resources in the compiled .XAP binary used for deploying Silverlight applications. A .XAP file is just a ZIP with a different extension. This also means that search engines can potentially index text within a Silverlight application, just as they can with Flash. 6. Third-party component vendors are already well on with Silverlight add-ons. For example, Infragistics, ComponentOne and DevExpress. 7. Take your .NET code cross-platform. With Macs popping up everywhere, the ability to migrate Visual Basic or C# code to a cross-platform, browser-based Silverlight client will be increasingly useful. Clearly this only applies to existing .NET developers - I guess this is the main market for Silverlight, but it is a large one. The same applies to the next point: 8. Uses Visual Studio. Microsoft’s IDE is a mature and well-liked development environment, and since it is also the tool for ASP.NET you can use it for server-side code, as well as for the Silverlight client. For those who don’t get on with Visual Studio, the Silverlight SDK also supports command-line compilation. 9. Choose your language. Support for multiple languages has been part of .NET since its beginning, and having the .NET runtime in Silverlight 2.0 means you can code your client-side logic in C#, Visual Basic, or thanks to the Dynamic Language Runtime (DLR) Iron Ruby or Iron Python. 10. Isolated storage gives Silverlight applications local file access, but only in a protected location specific to the application, providing a relatively secure way to get this benefit.

The cons 1. If Apple won’t even allow Flash on the iPhone, what chance is there for Silverlight? 2. Silverlight is late to the game. Flash is mature, well trusted and ubiquitous. Silverlight 2 only comes out of beta in the Autumn (we hope). It is the version we care about - the one that includes the .NET runtime - and will still lack support on mobile devices, even Windows Mobile, though this is promised at some unspecified later date. 3. The design tools are Expression Blend and Expression Design - but who uses them? The design world uses Adobe PhotoShop. 4. While having solution compatibility between Expression Blend and Visual Studio sounds good, it’s actually a hassle having to use two separate tools, especially when there are niggling incompatibilities, as in the current beta. 5. No support for the popular H.264 video codec. Instead hi-def video for Silverlight must be in VC-1, which is less common. 6. It’s another effort to promote proprietary technology rather than open standards. 7. Yes Linux will be supported via Moonlight, but when? It seems likely that the Linux implementation will always lag behind the Windows and Mac releases. 8. Silverlight supports SOAP web services, or REST provided you don’t use PUT or DELETE, but doesn’t have an optimized binary protocol like Adobe’s ActionScript Message Format (AMF), which likely means slower performance in some scenarios. 9. Silverlight is a browser-only solution, whereas Flash can be deployed for the desktop using Adobe Integrated Runtime (AIR). Having said that, yes I have seen this. 10. You have to develop on Windows. This is particularly a problem for the Expression design tools, since designers have a disproportionately high number of Macs.

+1  A: 

PROs vs. ASP.NET Web Forms

  1. No ViewState or "surprise crap" o This applies to Silverlight as well. Silverlight brings the "desktop" experience to the end user and there is no ViewState that is used in Silverlight.
  2. Faster server-side & client-side o Silverlight is faster on the client/server side depending on how you look at it. Silverlight is compiled in a .NET subsystem of Silverlight. You have access to multithreading, LINQ, complex data structures, etc. The performance vs. an ASP.NET or AJAX/JavaScript application is it magnitudes times better because of the client execution and some of the items that normally are handled in a server BLL can be brought down to the client
  3. Simplified model for multiple related views o Silverlight supports the complete seperation of the data and the UI. Taking this further by just creating seperate views for say another consumer of Silverlight is pretty powerful. You can apply the same MVC/MVP pattern inside Silverlight and attain this level of abstraction. Jason mentions an example of being able to create a seperate view for an iPhone and only the View component has to change. This applies to Silverlight as well for different things. For example, I have large sized Silverlight app I want to port to SharePoint. I can create a "Smaller View" for SharePoint so it fits nicer into the UI. Furthermore, Silverlight Mobile is being private tested now. I would assume that same very powerful level of abstraction applies as well to create a "Mobile view" for your Silverlight application.
  4. Unit Testable o Silverlight includes a Unit Test framework as well. It can be downloaded here: http://code.msdn.microsoft.com/silverlightut/
  5. Challenges if you are not running IIS 7 o Silverlight does NOT care if you are not running on IIS 6 or IIS 7 or Apache for that matter. This is one feature where Silverlight has an advantage over ASP.NET MVC.
  6. Client Caching o In ASP.NET Web Forms or MVC, you are caching on the server. Silverlight allows you to cache on the client via Isolated Storage (which can be increased to hundreds of megs if necessary). This allows applications to perform ultra fast without bogging down the hosting server.

CONs vs. ASP.NET Web Forms

  1. Difficult to convert existing code o Silverlight is a completely different programming platform than either ASP.NET WebForms or MVC. Not only will a lot of the code not convert, you also have to think about the client layer and in most cases a complete re-architecture is needed if you are replacing large modules inside your existing ASP.NET site.
  2. NOT the best SEO out of the box o Google several months ago started spidering SWF files and adding them to the search engine. I think Silverlight is probably still a ways away here. What you can do for Silverlight SEO is the basic tricks to describe the meta data tags really well around the plug in.
  3. Data access o Data access in Silverlight is limited to Web Services/WCF/ADO.NET Data Services. You cannot make direct calls via ADO.NET or stored procedures to a database.
  4. Security o Silverlight runs on the client. A lot of your bits are then roaming in the wild on the internet. Furthermore, some of the data access techniques do not support full WS* standard security. Therefore, beyond certificate based transport security, you are either writing a lot of your own plumbing code or waiting for the next rev. The XAML code is pretty much insecure; not many applications have their Intellectual Property in their UI. In Silverlight, that can be very easily reverse engineered using Silverlight Spy for example. Silverlight, just by nature, is a little less secure than an ASP.NET MVC application. Obviously, you would want to encrypt/obfuscate your Silverlight assemblies before letting them off in the wild.
A: 

Isn't click once available on firefox these days, via this addon: https://addons.mozilla.org/en-US/firefox/addon/1608

John Rusk
A: 

1. Silverlight can access the DOM from the hosting page and
2. the hosting page can access the Silverlight part.
That's a big + for Silverlight

But all other limitations cry for WPF/Windows-Forms with Clickonce
file access, right mouse click, ease of db access

Peter Gfader
A: 

XBAP application is able to interact with file system if you run it as full trust application and if you sign it (create and install certificate).

Here is the link where you can find how to create and install certificate: How to run WPF - XBAP as Full Trust Application

And here is the link which will help you to make your certificates install without interaction with user (sorry, I have no rights to post more than 1 link): www.managescope.com/2009/03/automate-certificate-install-for-xbap-applications/

My XBAP application is able to create folders and execute applications (in my case it runs Server.exe on client's machine in order to create p2p connection between several clients).

One thing I'm not able to do is to download Server.exe from my web-server, save it and run automatically. My users should download and save it by hand. XBAP application is not able to ask administrator rights (because it is ClickOnce app) and because of this it's not able to obtain writing permission (or maybe it's only my problem and somebody have already done such thing).

Sorry for my English.

Armen Markossyan