WPF or workflow? - wpf

I have a question and hopefully you can steer me in the right direction.
I'm working on an application that needs some form of decision tree/work flow for lack of a better term. I'll describe it below for some clarity.
I have a request form that users will fill out on a web page. At the beginning of the form is a 'Referral Type'. Bases on the referral type selected some of the form questions will change. There could be 2, 3 or 4 groups of questions depending on the Referral type. Entire groups of questions can be pass or fail.
If the first group of questions fail..then the form stops processing, etc.
What would be the best approach to handle this? Would WPF work well in this situation?

WPF is the Windows Presentation Foundation and is more about the User Interface than a work flow management system. For work flow, you could build your own home-grown database driven solution, or you could use tools like Ultimus or Sharepoint.
You may also be thinking of the Windows Work Flow Foundation.
I have used both Ultimus and home-grown implementations for work flow management. Peers have used Sharepoint. There are benefits or pros/cons to each.

I am unsure how well Workflow works with ASP.NET as I've never tried it. I believe some of the samples may actually cover this so it's possible. That is the first technical hurdle.
It sounds like the logic isn't too complicated. There are a finite number of "paths" that a user can take based on the referral type. Each path is fairly linear, with 2-4 "groups" of questions. Can each group sit on a single page? That would simplify things greatly.
A web framework such as Spring.NET Web Framework might be better suited for this task than Workflow. You are trying to express some condition logic--essentially, "go to the next page if X, else end questioniare". Spring.NET handles this exact sort of logic with its Validation Framework and the Results Mapping.
Workflow is certainly well-suited for this kind of logic, but is there anything that happens in reasponse to each group of questions other than validation? If not, it may be overkill.

Related

How can I develop a database for users to access via a browser

Years ago (pre-web) I used to be a Fortran developer (yes it was a very long time ago!) but these days I run a small non-IT business. I would like to develop a database application for my clients to access via a browser (or maybe down the line via a mobile phone). I haven't done any programming for a while apart from some VB macros in Microsoft Excel. I would be grateful if anyone could suggest the best language/technology to learn to get me heading in the right direction.
As Neil said in his comments there are dozens of different, valid answers to this.
Usually I would suggest going with a language you already know, but neither Fortran or VBA are really suited for this task, as far as I know.
Personally I would suggest Django, which is a web framework written in Python. It simplifies many common tasks and it is very well documented.
But there are many more possible solutions.
Before I started with a framework I'd break the problem into pieces. If you've never done anything with a database before you'll find that challenging enough without piling web or mobile on top of it.
Model your problem and get a good object or data model in place. Test that thoroughly without thinking about UI. Once you have that, perhaps you can expose it as services that any UI can call.
You'll quickly become overwhelmed if you try to do it all at once.
Here's another thought: If these are paying customers, why not do yourself and them a favor and hire someone that knows how to do this? It's great that you used to write Fortran, but if you haven't kept up you won't be doing your business any good by putting out a bad first effort for customers to see.
Do it right - get a professional. Do your learning on your own time.
You can use ASP.NET and SQL Server to get something online that will allow users to edit a database table fairly easily. They've simplified it to the point where you can drag and drop the necessary controls (GridView and a SqlDataSource for instance) and define your datasource in a wizard for most simple table CRUD functionality. Basically give users the ability to edit a table without writing any code.
If you need to do something a little more difficult it's easy to write code that will add functionality to the original drag/drop stuff you did.
There are lots of good resources out there for asp.net and C# also, so it will help you get up to speed quickly.
Keep in mind that I work almost entirely with .NET/SQL Server so my opinion will be slanted towards them...

Ways to get past the Inner-platform effect while still building highly customized web apps?

Feel free to answer the question in the title as generally as I posed it, I offer some more details and specifics below.
Currently I develop and maintain a somewhat legacy business app (ASP/SQL) that is highly customizable allowing for moderate to full customization on: custom fields, forms, views, reports, actions, events, workflows, etc. This customization is necessary in the domain we develop for and has allowed us to build a niche.
I have been reading up on the inner-platform effect and ways of implementing high level user defined customization and have concluded that we do suffer from many of the inner-platform effect problems because essentially we have created a high level abstraction on top of the SQL. The organization of custom fields is implemented in a similar way to the approach found here
http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/
We use something similar to the meta database method described in that article. All customization is built around this approach and in many ways we suffer from database on top of a database.
The end result is something that looks fantastic on paper yet the more features are added and custom coding is done for clients the more of a mess everything becomes. It seems that the more I read the more I realize this is somewhat of an anti-pattern. It also seems that the more I try to read the more I find so little has been written on the topic. Anyways, I am trying to learn modern approaches to this problem and trying to find more discussion/articles on the topic. Are Database systems such as CouchDB relevant to this type of application?
My question is clearly pretty general. It seems like there is a lot against this kind of application in favor of just "knowing and defining your domain better". Are there any good/better ways to implement this kind of application? I'm not looking for black and white answers, and any further readings on the subject would be fantastic. Thanks for any help.
My answer is be conscious and clear about what is for a plugin to do and what is a user setting. In that case, your platform and your settings are different. Your application provides basic services and is unabashedly a platform. It may also provide an application built on that platform.
So in that case you focus on programmer interfaces instead of implementation possibilities.
The standard advice in CS is to create another level of abstraction, not sure if that's not the problem here.
The only advice I could give is to push as much functionality onto the database, given it's the platform. SQL Server supports custom functions, fields and stored (SQL) procedures.
Either that or try to pull repeated functionality into separate functions in ASP.

WebForms / MVC to a Windows Forms programmer

First I'd like to make it clear, I'm not looking for a "my tech is better than yours" type of post; this is a real case scenario and I have been faced with this decision. With this in mind, let me explain:
We have a WinForms application. It started in the early .NET 1.0 but the first shipping version was using .NET 1.1. There are layers (like BusinessLayer.dll, Datalayer.dll, Framework.DLL, etc.) but at some point during the "long" development cycle of this application, the "presentation" layer (Win Forms) got infected with some code, thus the "separation between the code and the presentation with code behind" is some sort of myth.
Bad practices or whatever, the truth is that the application is there and it works.
Years passed and we had .NET 2.0, we slowly migrated and it mostly worked, had to change a few calls here and there. Last version did the same thing, but for .NET 3.5sp1. We needed some sort of Webservices thing, and decided to use WCF instead. It works fine.
But despite all these .NET upgrades, most of the application's codebase is still the same old rock and roll from 5 years ago. We use Gentle.NET (old and unmaintained now) for our dataobjects (it was a blessing 5 years ago!).
Our presentation layer, the winforms, are "nice looking" since we employ 90% of completely gdi+ custom controls. (whenever possible without having to hack the WinAPi). The application is touch based (i.e.: it makes use of the Ink but it doesn't rely on that), but the buttons, labels, etc, everything is "designed" to be used with a tactile device. (TabletPC or Touchscreen). Of course some users use keyboard/mouse.
With all that in mind, and with all this web2.0 and Internet fuzz (plus Jeff's posts ;) ), we are considering the possibility of rewriting the application but using a web technology.
The idea is obviously bringing more availability for our customers (they can use the system whenever/wherever they want), and less maintenance (we can upgrade and it is an instant upgrade for 'em all), etc. You know, the usual Internet vs WinApp thingy.
The problem is that given that this is the healthcare industry, not all of our customers might be willing to "move" their databases to our server/s, which is acceptable, and would force us to install a webserver/database server in their own servers so they have their own copy. Not a big problem (except we would have to update those manually but that's not an issue, given that we've been updating win32 apps for 5 years now!).
Now, back to the main "question".
The team has little Asp.NET experience, we did program a lot in ASP 2.0 (in 1999/2000) but that was a spaghetti of HTML+VBScript+CSS, so I don't think it counts. After all that experience (the Internet bubble!) we went back to VB6 then C#.NET 1x and you know the rest of the story. We're a small team of C# developers for WinForms. We've acquired some Linq To SQL Experience in our last .NET 3.5 ride, and we liked it. We felt it very natural and very "if we would have had this five years ago…" like.
Given all this, rewriting the application is not a "simple task" (not even if we wanted to do it in the already known C#.NET), it would take time and planning, but we could correct dozens of mistakes and with 5 years of experience working with the application, we now can say that we have a better idea of how the customers would like to use the software and what limitations we created (by ourselves) when we designed the current app.
All that "knowledge" of the application and the way the business works, could be applied to produce a much better application in terms of design and code and usability. Remember in .NET 1.1 we didn't even have generics! ;) (you'll see lots of ArrayList's hanging around here).
As an additional note, we use Crystal Reports (and, as usual, we hate it). We don't think the ink control is a "must" either. The HTML/CSS could be shaped to look the way we want it, although we're aware that HTML is not WinForms (and hence some things cannot be reproduced).
Do you think that planning this in MVC (or WebForms) would be too crazy?
I like the MVC (ruby on rails like) idea (I've never programmed in ruby beyond the basics of the book), so no one in our team is an expert, but we can always learn and read. It mustn't be "rocket science", must it?
I know that this whole question might be a little bit subjective, but would you replace an aging Winforms application with a new ASP/MVC/XXX web application? Do you have experience or have tried (and had success or failed) ?
Any insight in helping use better decide what to do will be appreciated.
Thanks in advance!
UPDATE: Thanks to all who responded, we'll evaluate whether this is a good move or not, it sure is a hell of work, but I am afraid the the desktop app is getting older (using old net 1.1 hacks) and tho it has been more or less working without problems in Vista and W7, I'm afraid a future update may break it.
Also, lots of "more or less core" parts of the application are exposing some badly designed ideas and we had to hack here and there to accomplish certain tasks. Part inexperience, part lack of 100% knowledge of how the business worked (and Customers not sure what they wanted).
A new application (in any form) would allow us to create a better foundation while retaining all the user knowledge.
But, it's a L O T of work :) So we'll consider all these options here.
As some of you have mentioned, maybe a thinner client and some (ab)use of WCF here and there might be more appropriate.
Once again, thanks to all!
It would be best to ditch all your efforts of reusing the desktop application code when you recreate the web app. Following are the reasons:
Web apps especially asp.net use a different model. For starters note http is stateless. Each time the browser talks to server you have to explicitly send the current content of all the controls on the current page. You would not have used such a model in your Windows application.
To decrease load on the network you want to optimize the size of viewstate and how frequent you make http requests. Again your existing window app does not have any such provisions.
Updating view. You might have different event handlers, threads and what not in your windows application to update the GUI in different scenarios. All of that will need to be replaced. Javascript is a totally different animal.
Security. When using a browser your access to the local disk is highly limited whereas you will take the same for granted in windows application. If there is any code in the windows app that requires local resources, then that is going to be a trouble spot for you.
I would recommend the following:
Verify if your current application has any local disk access requirements (e.g. read/write to local file etc).
As you write the different http modules or handlers, you can try leveraging some of the backend/ business logic part of the existing windows application.
Give some thought to what part of your application can become a web service.
It sounds like the application needs a lot of refactoring to clean it up. If you want to move to a web model, and have maximum reuse you will really need to do that. Before you move to a web model I think you need to understand if it will be possible to replicate your user interface in that model. Is it your unique selling point from a customer perspective? You want decisions like this to be user driven rather than purely technical decisions.
It sounds like your application is the perfect candidate for a thick client application, rather than the lowest common denominator web model.
Some things to consider:
How will the web interface impact the Tablet interaction?
What new customers will having a web version bring you?
Will existing customers abandon your product?
Do you have access to consultants or outside resource with the right skills to mentor you in web technology? If you don't you can rely on StackOverflow or other web resources to help. You need some good mentoring and guidance on the ground with you.
What happens if you start this effort and it takes much longer than you expect? You know the app but don't sound like you know the web. Past experience shows that massive rewrites like this can end in disaster (it never sounds so difficult at the start)
Can you possibly write new features in a web-based version?
Could you move to ClickOnce deployment to make the application easier to deploy to customers. One of the benefits of the web is easier (zero) deployment. Can you get closer to that?
Would it be easier to migrate to WPF and create a browser application with that?
Silverlight or Flex might be better options for creating a rich experience, and may be more approachable for WinForms developers. Is this a possibility?
It seems like your app. is one of those that works best as a desktop app. Though you want your users to be able to access your app. using a browser.
I would suggest refactoring as much as possible so that the GUI gets cleaner and don't have "code".
When you've done this, start developing a asp.net mvc app but keep your desktop app. You should be able to use all layers except the UI layer, making it easier/faster/... Now that mvc exists, I'd say webforms is more about letting non-web devs do web. But you know web, sort of, and you want control so mvc is the way to go.

Should I buy or build a web services forms module for DotNetNuke?

I'm fairly new to DNN. I need to spin up dozens of similarly skinned sites, all of which have to eventually call a web service that will allow users to submit information.
I want to find a module that will let me point it at said web service, then let me define the workflow (e.g. fill it out over multiple pages?) and select the controls (textbox, checkbox) to fill out a message to post to that web service.
I've seen things like Dynamic Forms and Enterprise Forms, but I cannot find any information as to whether this is possible.
Anyone know of a module or optional idea that will allow me to do this? Am I making something like this up? An absence of answers makes me think "I'll just build it..."
My experience with DNN modules is that they're rarely an exact fit for a particular technical issue. So I'd try the following
1) Email the people behind the tools you mention
2) Buy them anyway, with source, and learn the architecture of a well structured DNN addin - the time saved with more than repay the cost
3) Make your decision based on that knowledge.
Joshua,
I am not aware of any forms modules out there at this time that integrate to a web service.
However, you might want to look at potentially extending an existing module, and simply changing the persistance mechanism for it, rather than a whole custom solution.

Silverlight Form Design for the Enterprise

I’m currently involved in the design of a prototype Silverlight 3 application used by call centre operators in an enterprise who take queries via phone and email. The intention of the prototype is to demonstrate how Silverlight can be used to improve the UX and overcome some of the hurdles of using ASP.NET webforms in a high latency environment. I won’t go into the details of the environment or the rationale of Silverlight 3 vs 2 or WPF, this question is about usability;
I’m looking for examples of good user interface design suitable for the above requirement that highlight some of the benefits of Silverlight. It’s a prototype so it can be a bit sexier than your usual enterprise app and have a few more bells and whistles than you’d usually get from user requirements. The goal is to both provide something functional and introduce the “wow” factor. Appreciate any resources or examples you can think of.
You've got a stateful client - one of the interesting things to do is leverage that state.
For example:
Task centric UI with multiple active tasks.
Each task represents a process/workflow that has begun, but not yet completed. Especially useful in scenarios where ther are interrupts.
Auto-save drafts to local isolated storage in case the app restarts, browser closes etc. Any partially filled forms can be restored when the app is re-launched.
The other thing is context... or preserving context of the task at hand. For example, if you want to do a lookup, you can popup a dialog, rather than navigate away from the current page.
Just some quick ideas...
Have you seen http://quince.infragistics.com? Although not specific to Silverlight it's full of proven UI methods - not Infragistics specific!
I find it very useful when designing forms and controls, maybe you will find some good suggestions there.
I like the way it encourages (forces) all your service calls to be asynchronous. From the UX point of view it means that your form is not locked up while performing a potentially laggy operation.
Animations are nice too. While they're often considered useless fluff, they can reduce the amount of surprise the user experiences when something suddenly changes. They can also be used to draw attention in a more subtle way that a messagebox in the face.

Resources