technology decision

Topics: Prism v2 - Silverlight 2
Apr 27, 2009 at 8:05 PM

Hi, not sure if this is the right place, but here goes...   We are about to rewrite the UI layer of our flagship LOB application. It all ASP.Net, screens of moderate complexity, composed of half a dozen modules which encapsulate some fairly complex business logic.  I ‘believe’ i want to go the Composite UI route. I’ve been looking at the P&P guidance and discovered a reference to the ‘Composite Web Application Block’.  However, there is of course, the newly released ‘Composite App Guidance for Silverlight (PRISM)’.   Now given we don’t need necessarily need all the ‘flash’ of a Silverlight app, is there any reason *not* to go with Silverlight anyway?  From what i can tell, the PRISM stuff is a cleaned up (and easier to use) implementation of the composite patterns that are contained in CWAB.  I guess stated another way, does it make sense in our case to use Silverlight for its P&P value even if we don’t have a very RIA requirement?  

Another question with respect to availability of resources. Given the relative newness of Silverlight, is it reasonable to assume that a proficient C# developer learn Silverlight without too much trouble?

Thanks,

Steph.

Apr 28, 2009 at 1:07 AM
Steph,

I think this is more of a business question rather than a technical one - especially because this is your company's flagship product. Some things you'll want to consider:

  1. What requirements is your company willing to require your clients to adhere to? If you use Silverlight/Prism, then Silverlight is an additional requirement.
  2. What browsers are you currently targeting - check out this page for supported environments: http://www.microsoft.com/silverlight/resources/install.aspx#sysreq
  3. How much time have you set aside for rewriting the UI, business logic, regression testing, etc?

Regarding #1 & #2, companies (and especially marketing departments inside companies) like to keep the requirements to a bare minimum and support as many as environment permutations as possible - so they can sell to as many people as possible. Depending on how you look at it, Silverlight could increase or decrease the reach of your application. For instance, the company I work for only certifies applications for IE; however, if we write an application in Silverlight/Prism, we know it'll work in Safari on OS X - so we can certify the app for that environment. But we also know it won't work on any browser running on a linux machine (because Moonlight is only at v1.0 in linux). Conversely, we know that if we spend enough time working with CSS & JavaScript we can get an ASP.NET web app working equally well across, IE, FF, Safari, Konquerer, etc on any OS - so we could certify it on those environments only if we don't use Silverlight. So like I said, it depends on how you look at it.

Regarding #3, Silverlight's only mechanism for for CRUD operations is via web services. Having said that, you'll probably have to make a pretty significant investment to develop and test web services that handle your application's business logic if it doesn't already use web services.

Now that I've scared you away, I would absolutely recommend using Silverlight/Prism and the MVVM or MVP pattern. There will be probably a 2-4 week ramp up period to get used to Silverlight and Prism if you have no experience with those technologies. However, it's well worth the investment because the code you write is more modular, maintainable, testable, and overall in general higher quality. Silverlight is great too because you're able to work with the actual business objects in a stateful manner as opposed to the traditional stateless, disconnected method of ASP.NET web apps. Ever since I began working with Silverlight/Prism at the end of February, I go out of my way to avoid ASP.NET!

Hopefully this helps you out with some things to discuss with stakeholders/business advocates. If you ask the questions I posed earlier and the answers don't prohibit the use of Silverlight, then don't even think twice about it - just go for it. The developers will be happier, the QA folks will be happier, and the business will be happier in the long run when it realizes how modular the application you built is and how easily you can enhance it with new functionality.

Let me know if you have any other specific questions. Also, the Microsoft guys are really great answering questions here, so don't be afraid to ask if you want guidance on how to do something or run into a roadblock.

Ryan

Apr 29, 2009 at 4:03 PM

Hello,

First of all, thank you very much for this excellent feedback. In our particular case we really have only one internal client (we’re a government crown corp), so I’m happily insulated from most of the strategic revenue model considerations you’ve outlined in the first part. On the technology side, we’re heavily invested in the whole Microsoft line.  Everybody runs XP with IE as the only officially supported browser and we do all our development with .net.  This may change of course, as the business has been indicating they’d like to have some occasionally connected support for mobile devices.

Now, since we don’t make our living selling product, we are accustomed to certain luxuries when it comes to software development, time to do things ‘correctly’ to the best of our ability being one of them. We’ve spent a great deal of time cultivating a very solid object model of our domain, which is where I consider my area of expertise to be.  Lately I’ve been pulled into re-architecting discussions on the UI side, which is a bit of a foreign land to me. My starting point is best practices, which led me to PRISM and Silverlight. I’m really stoked by what you said about the support for modularity, testability etc. as I can directly relate these concepts and their benefits to the success we’ve experienced in our domain model work.

I’m inspired by what you had to say about the satisfaction you’ve been deriving since starting to use Silverlight. That said, I’m still concerned about one thing. Our users enjoy relatively unfettered control over their experience. That is to say, when interacting with the app they can save to locally to disk, print what they need to etc. My understanding of Silverlight is that it’s pretty much restricted to a sandbox where doing these things is not easily achieved. Am I correct? I suppose if I thought about it long enough I could architect a way around this limitation but I’m wondering if this constitutes an abuse of this particular technology. I understand silverlight can be used on LOB apps, but from a practitioners perspective could you tell me if I’m still on the right track here?

Thanks again,

Steph.

From: rgraham [mailto:notifications@codeplex.com]
Sent: Monday, April 27, 2009 9:08 PM
To: Steph Swierenga
Subject: Re: technology decision [CompositeWPF:54636]

From: rgraham

Steph,

I think this is more of a business question rather than a technical one - especially because this is your company's flagship product. Some things you'll want to consider:

1. What requirements is your company willing to require your clients to adhere to? If you use Silverlight/Prism, then Silverlight is an additional requirement.

2. What browsers are you currently targeting - check out this page for supported environments: http://www.microsoft.com/silverlight/resources/install.aspx#sysreq

3. How much time have you set aside for rewriting the UI, business logic, regression testing, etc?

Regarding #1 & #2, companies (and especially marketing departments inside companies) like to keep the requirements to a bare minimum and support as many as environment permutations as possible - so they can sell to as many people as possible. Depending on how you look at it, Silverlight could increase or decrease the reach of your application. For instance, the company I work for only certifies applications for IE; however, if we write an application in Silverlight/Prism, we know it'll work in Safari on OS X - so we can certify the app for that environment. But we also know it won't work on any browser running on a linux machine (because Moonlight is only at v1.0 in linux). Conversely, we know that if we spend enough time working with CSS & JavaScript we can get an ASP.NET web app working equally well across, IE, FF, Safari, Konquerer, etc on any OS - so we could certify it on those environments only if we don't use Silverlight. So like I said, it depends on how you look at it.

Regarding #3, Silverlight's only mechanism for for CRUD operations is via web services. Having said that, you'll probably have to make a pretty significant investment to develop and test web services that handle your application's business logic if it doesn't already use web services.

Now that I've scared you away, I would absolutely recommend using Silverlight/Prism and the MVVM or MVP pattern. There will be probably a 2-4 week ramp up period to get used to Silverlight and Prism if you have no experience with those technologies. However, it's well worth the investment because the code you write is more modular, maintainable, testable, and overall in general higher quality. Silverlight is great too because you're able to work with the actual business objects in a stateful manner as opposed to the traditional stateless, disconnected method of ASP.NET web apps. Ever since I began working with Silverlight/Prism at the end of February, I go out of my way to avoid ASP.NET!

Hopefully this helps you out with some things to discuss with stakeholders/business advocates. If you ask the questions I posed earlier and the answers don't prohibit the use of Silverlight, then don't even think twice about it - just go for it. The developers will be happier, the QA folks will be happier, and the business will be happier in the long run when it realizes how modular the application you built is and how easily you can enhance it with new functionality.

Let me know if you have any other specific questions. Also, the Microsoft guys are really great answering questions here, so don't be afraid to ask if you want guidance on how to do something or run into a roadblock.

Ryan

Read the full discussion online.

To add a post to this discussion, reply to this email (CompositeWPF@discussions.codeplex.com)

To start a new discussion for this project, email CompositeWPF@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Apr 30, 2009 at 12:20 AM
Steph,

You're absolutely correct about Silverlight running in a sandboxed environment. Essentially it can't access anything above and beyond what a normal IE or FF browser can (i.e. files on disk, background processes, etc). Having said that, Silverlight does have something called Isolated Storage which is essentially a sandboxed file system for your Silverlight application to read/write to and from. This would enable your users to start a session of your LOB app, do some work, save progress (you'd have to serialize their state somehow), shut down their laptop and go home, fire the laptop back up, VPN into the network, log back into your LOB app, and pick up where they left off. If you want to enable users to work on data outside of your LOB app in a program such as Excel or Word, you can absolutely serve up an xls, csv, doc file to them and then allow them to upload the modified file.

Printing support in Silverlight 2 isn't that great, you'd probably be best off serving up an HTML or ASP.NET page for anything you want your users to print which can be easily accomplished by adding a hyperlink inside your LOB application. Supposedly printing support will be better in SL3 and beyond. We shall see.

Depending on how rich you want to make your application, you might want to consider Silverlight 3 since it allows for disconnected and out of browser capabilities - something Silverlight 2 can't do. Another option to consider since you have absolutely control over the environrment is a full fledged WPF application. I haven't worked with WPF or SL3 at all, but I know Prism will work very well with WPF and from what I can tell works fine with SL3 except for the page navigation framework.

Let me know if this addresses your concerns. I'd also be interested in other's feedback as well.

Ryan