The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,502,635
since: 19 Jan 2005

Practical example of "bus-style" back-end services using WCF P2P

posted Mon 11 Dec 06

The example is one that I use all the time. In fact, I am so inspired by this particular example that I have actually coded it up myself a few times, and at one point considered developing it into a commercial product that I could sell. Alas, time constraints prevented me from getting any such effort off the ground.

Picture a large restaurant with multiple services they offer. They might have three or four different themed dining rooms (including one that is an arcade). Each of the dining rooms has waitstaff that service the dining room. There is a host(ess) waiting at the entrance to each individual dining room that gives you an estimate on how long your wait will be, might give you a "pager" if the wait is particularly long. To make things more interesting, there are actually two separate kitchens. One kitchen is often used for catering and in-house buffets and also supplies "bar food" to the arcade area while the other kitchen has more normal operations. The first kitchen can be used for overflow if the regular dining rooms start creating too much demand. They also have a website that shows the menu, services, and even lets people make reservations online. The reservations made online need to be available for the host of any dining room, and the hosts need to be able to know the current average meal time and current status of each dining room to give an accurate estimate to customers. In addition, the owner of the restaurant wants the waitstaff to be able to take orders on PDAs so that orders can be sent back to the kitchen without the waitstaff having to make unnecessary round trips.  All of this stuff must be able to communicate seamlessly with every other part of the system, and it needs to be done in a way that is scalable, easy to maintain, secure and reliable with failover. The system should be expandable so that if the restaurant owner opens five more restaurants in his chain, the software will work just fine, and if he wants to log all the activity so it can be put in a warehouse in the future - he wants the system to be able to handle that expansion quickly and cheaply.

I have actually heard some or all of these requirements from clients in the past (though not specifically for the restaurant industry). Now picture the solution:

  • An online web application written in ASP.NET that has access to the back-end system running directly within the restaurant
    • Communicating with the restaurant's WCF-back-end via a WCF proxy service to forward and route messages from the Internet to the restaurant itself
  • A dining room monitor application that the hosts use to view the dining room in full 3-d graphics (WPF-provided, of course) that shows the status of each table, and the average time for table clearing, giving the host a really good idea of how long it will be until the next x-person table is available.
    • Communicating with the restaurant back-end via secure WCF P2P channels
    • Listening for status change messages from other applications sent to the restaurant back-end so it can update its own data
  • One to (infinite) kitchen monitor applications that manage order fullfillment
    • Listening on the back-end for orders being sent into the mesh
    • As orders are fulfilled, fullfillment messages are  sent into the mesh for whoever is interested
  • One to (infinite) Windows Mobile 5.0 applications
    • Using a proxy they can push messages into the WCF back-end such as customer orders or requests for refills, etc
    • Using the same proxy can listen for messages alerting the waitstaff that they have an order pick-up ready to be delivered to the customer

What I like about this architecture is that if you look at the requirements for the application, you might think that it is a huge daunting task and will take a truckload of time and money and resources to build. The fascinating part about it is that if you design things in a peer "bus" style service-oriented fashion, you can produce small, entirely functional pieces of the overall system in extremely short periods of time. As each new component is made available, it can simply be rolled out into the restaurant for additional functionality without disturbing any of the existing applications/services running.

As new functionality is desired, it can be rolled out independently of any of the other pieces of the system that are currently running. For example, to create an application that keeps track of all restaurant activity and then stores that activity in a database suited for data warehousing and OLAP, ROLAP, etc - all you need to do is create an application that listens to all of the various back-end peer meshes and logs the activity.

I realize that restaurants might not be up your alley as programmers, but I thought I would try and shed a different perspective on the architecture I am using to build the Ulysses Agenda application to see if it might inspire some people to start thinking about using WCF and WPF in some unbelievably cool and creative new ways. 

tags:                

links: digg this    del.icio.us    technorati    reddit




Tag Related Posts

CLINQ v1 Demo - Network Message Filtering

Wed 09 Jan 08 7:47 P GMT-05
tags:        

Orcas' Hidden Gem - The managed PNRP stack

Fri 11 May 07 6:45 P GMT-05
tags:        

On MUDs

Thu 08 Mar 07 5:00 A GMT-05
tags:                    

What I think is a bug in WCF POX messaging

Thu 04 Jan 07 4:58 P GMT-05
tags:      

WPF Bumper Stickers

Tue 12 Dec 06 7:32 P GMT-05

Ulysses Agenda Makes Redmond Developer News

Wed 29 Nov 06 7:10 P GMT-05
tags:                

Ulysses Agenda - Network Engine Test 1

Mon 09 Oct 06 2:26 A GMT-05
tags:              

Ulysses Agenda : First Cut Networking Design

Thu 14 Sep 06 12:46 A GMT-05
tags:                  

First Impressions of Windows Vista RC1

Thu 07 Sep 06 1:30 P GMT-05
tags:                      

Localizing a WPF Application

Tue 22 Aug 06 11:39 A GMT-05
tags:            

WPF Slide Show and Photo Album

Fri 18 Aug 06 6:48 P GMT-05

Is Windows Workflow Foundation Too Complex?

Fri 18 Aug 06 12:15 P GMT-05

ADO.NET Entity Framework Announced Today!

Wed 16 Aug 06 11:08 A GMT-05

Extending your Applications with MAF/VSTA - Part III

Fri 21 Jul 06 12:30 A GMT-05
tags:            

Extending your Application with MAF/VSTA AddIns

Thu 20 Jul 06 1:51 A GMT-05
tags:            

July CTP is out... yay.

Tue 18 Jul 06 6:34 P GMT-05
tags:    

.NET Framework 3.0 June CTP is out!

Fri 23 Jun 06 6:23 P GMT-05
tags:                

Tech-Ed 2006 - Session Reviews

Tue 13 Jun 06 6:22 P GMT-05
tags:                    

SOA Manifesto

Thu 26 Jan 06 10:38 P GMT-05
tags: