views:

165

answers:

3

I'm in the process of designing a solution for the company I work at (but have just resigned from) which has a very complex application process in it. The process is close to 10 steps (including T&C's and preview) and also has some very tricky UI-level business rules (mostly driven by a legacy tie-in system).

Essentially the validation is driven by what has been selected on previous forms, and not just the one directly prior.

The solution has already been decided as an ASP.NET application but the more I design the solution the more it's looking like it's going to be very difficult to achieve in a stateless environment. It's going to either end up with query string parameters, hidden variables on the page, viewState or session to pass the information around.

Then I had it suggested that I look at Silverlight, to give it a more stateful environment and make it easier to handle the passing of the parameters around.

I've never done anything with Silverlight, other than watch presentations, so I've got no hands-on experience with it, but from everything I've read I think that it does have potential to solve some of the major problems which I can see coming out of trying to do this with standard ASP.NET.

So how do I go about:

  1. Is Silverlight a viable option considering what I mentioned above?
  2. Pitching Silverlight to a company without any Silverlight skills?
  3. How do you deal with the "but it requires a browser plugin" argument?
+4  A: 

From what you're saying your problem is about keeping state between multiple pages/forms. Sessions are good for that (not so much the query params or hidden variables as those can be tampered with, just having to think about that possibility when developing your app will slow you down.) I'd recommend that as simplest all round.

However, you can also put several forms on one page and submit them together, but have it look like different pages using javascript. It wouldn't be too hard to do with any decent javascript library, but I recommend jQuery (Microsoft is adopting, over their own, as the standard for ASP.NET)

Same as the silverlight problem if your company doesn't have many skills in javascript, but at least it doesn't require a plugin.

Don't get me wrong, I love silverlight, I love it so much that when it gets market share similar to flash, I'd drop HTML/css/javascript. It just doesn't seem to fit for you though.

Eloff
I'm concerned about Session due to the potential weight and that devs tend to forget to clear it. And due to the size of the forms (i'm talking a min of 20 fields per stage) trying to compress them onto 1 page is really hard :/
Slace
They don't have to be on one visual page, just one physical (one uri) page. You can use javascript to divide it into tabs or create the impression of a wizard or whatever.As for the size of Session, it doesn't sound like you'll be putting a lot into it (several KB tops?), and while I've never used session in ASP.NET, I'm sure there's a way you can write the store/load from the session so as to remove the data when you fetch it. It really is designed to solve exactly this kind of problem.
Eloff
I agree that sessions are the thing to use. Sessions get a bad wrap sometimes for being overused and abused. But there's nothing wrong with using them for a scenario for which they were specifically designed.
Steve Wortham
By the way, also consider using a SQL Server for improved Session reliability. There's a slight performance hit. But the beauty of this is that sessions will persist after recompiles and even if the server goes down. http://msdn.microsoft.com/en-us/library/ms178586.aspx
Steve Wortham
+2  A: 

I currently work for a company that builds its primary LOB app in Silverlight.

Silverlight may be a good choice for what you are trying to do, but consider:

  • Using Silverlight won't reduce the complexity of the application.
  • If you're already comfortable with ASP.Net, you can deal with complex workflow using existing idioms (Session state, the wizard control, or plain old CLR objects of your own that implement a decision tree/state machine model).
  • If your problem is really an issue of workflow design, you can integrate ASP.Net apps with something like Windows Workflow Foundation. However, "won't reduce the complexity of the application" probably applies to this, as well; in my limited experience, Windows Workflow Foundation hasn't made building workflows simpler, either.
  • What you gain by having state all wrapped up in local client objects will most likely be smaller than the cost of learning Silverlight and its idiosyncrasies.

That being said, there's nothing wrong with the idea of attacking this kind of problem in Silverlight. It's just not a silver bullet or anything; Silverlight has its own data access headaches, quirky UI code idiosyncrasies, and requires wrapping your head around yet another model for developing applications.

JasonTrue
I'm not expecting it to make everything easier, just hoping that it would be able to help better handle state between forms. And WF isn't really practicle as there isn't much in the way of logical branching in the form, just changes to UI rules (some fields on or off, mandatory state toggled, etc)
Slace
A: 

Silverlight has a Page class that enables you to easily support navigation where you can go back to the previous page as you do in your browser. I think Silverlight pages and the navigation framework is very suitable for the kind of application you have described.

Using Silverlight enables you to create a very rich client experience. Doing that is probably also possible in ASP.NET to some extent, but I find all the moving parts in a traditional web application (HTML, CSS, JavaScript etc.) and their interactions much more complex than the Silverlight model. If you don't have experience using Silverlight you could create a simple page navigation prototype without any real logic to get a feel for the experience. If you are satisfied you could then show it to management to demonstrate the power of Silverlight. If they like eye candy you could change the visual theme of your application in an attempt to impress them. This tactic may backfire, though, if management actually prefers battleship grey.

Martin Liversage