When we describe Dublin we talk about WAS-hosted WCF services. Our team thinks of WCF services along two pivots:
Stateless versus durable services.A stateless service is a transient one. When the service is processing a request it keeps that service instance in memory until it's finished, and there's no state kept between requests. Think of a service that sends text messages. This service receives a request, sends the text message, and finishes. Each request is independent; the service does not need to maintain any state.
Durable services, on the other hand, maintain state between requests and are often long-running. Service instance state is persisted, to a database, for example. This allows the instance to be removed from memory when it's not active and allows the state to be reconstructed if the host process should die. Think of a loan processing service. There are many steps, and the process takes weeks.
Imperative versus declarative services.Imperative programs use a series of commands to change the program's state. The programmer says explicitly what should happen. Imperative WCF services are those written in a .Net Framework language, like C#.
In declarative programs the programmer defines what the program should do; he declares the intent of the program. This abstracts him from the program's runtime, which translates the program declaration into actions. As far as Dublin is concerned, declarative WCF services are those that are implemented using WF. These are "workflow services" that were enabled in .Net 3.5 and will be enhanced in the 4.0 release.
We are building Dublin to provide value for all WCF services that are hosted in WAS. Our "sweet spot," though, will be for durable workflow services. Here is a very informal representation of the value for each type of service. Don't spend too much time trying to interpret the number of stars; I just made this up.
For all WCF services Dublin will enhance configuration, deployment, and monitoring.For workflow services Dublin adds workflow activity-level monitoring.For durable WCF services Dublin adds support for viewing and controlling persisted instances, scale out, and other reliability features.
PingBack from http://mstechnews.info/2008/11/what-kinds-of-services-is-dublin-targeting/
I still don't get it. So a "long running process" such as loan approval can be modeled as a service, so what? do we need yet another technology to pull it off?
Why not just create a database table for the loans (loan_id, applicant_name, status,...)
then write a bunch of web service methods such as create(id, ...), update_status(id, ...) , cancel(id, ...), approve(id,...),...
the id parameter should be enough to make sure different methods touch the same loan record in the database.
isn't that what "persisted" is all about? what additional value does "durable services" in .NET 4.0 bring?
Yes, i know you'd tell me these webmethod calls can be called in any order, not necessarily the correct one, and WF will fix that; but what else??
Let’s say that you don’t want to use a workflow for your loan application. You create a database and web service methods to handle the individual actions of your loan process. You have a database and 25 web methods, for example. Now you need a piece of software to coordinate all those web methods.
• At which point of the process should I call method 10? Is this always step #4?
• How do I pass data returned by method 7 to method 12?
• How do I execute 5 methods simultaneously? For performance’s sake I don’t want to serialize these. I want them to execute at the same time.
• Not all the methods are request-response. I call one method that requests an appraisal of the property. It may take a week before I get the answer. What do I do with my process while I’m waiting? What if the system crashes while I’m waiting?
• How do I give visibility into the process? How do I know which step loan 123 is in?
You could absolutely code all the logic to handle those requirements. The advantage of using something like workflow is that you don’t have to write the coordination code.
Kenny Wolf gave a neat talk at the PDC this year entitled “WF 4.0: A First Look”. The abstract starts with:
Programs coordinate work. The code for coordination and state management often obscures a program's purpose. Learn how programming with Windows Workflow Foundation (WF) 4.0 provides clarity of intent while preserving the functional richness of the .NET framework.
The recorded session is posted at http://channel9.msdn.com/pdc2008/TL17/ .
Now let’s say that you’ve decided to use a workflow. You still need the database and the web methods that you wrote the first time. Those are the core of your business. You can get rid of all the coordination code that you wrote, though. You will design a workflow to manage your loan process instead.
One clarification about persistence. You’re right—when you build a database and a set of methods that write to it you are persisting your application data. When I was describing persistence I was talking about persisting the state of the service instance—the value of the instance’s variables, what the instance was doing, etc. Even with workflow you need to manage the application data, but the workflow’s persistence model will take care of the service state. Again, you get to focus on your core business.