A few days ago I went to my DMVS (department of motor vehicle) center to get my drivers license. I went to the closest exam center, which is in Norcross, to take a written and hopefully a road test. For those whove never been there, the visitors area is a big hall with 20 counters, 3 big screens with numbers running on them, many seats and hundreds of visitors. I was told it serves between 400 and 700 people a day. Staying in the line hearing almost incessant announcments and looking at visitors and inspectors dashing about I had a firm sensation that all this very much reminded me something. Guess what?! right, ESA! I was looking at every element of the interaction and more and more was becoming sure that this is quite a strong implementation of ESA, not in software but our real life. Let me explain.
As you get to the center a big guide sign meets you: ALL visitors to the info desk!. This is a Dispatcher-Controller pattern. The Dispatcher lady accepts all visitors and after giving basic instructions (we accept only cash!) and checking your docs (where is your address proving bill?) redirects you to a queue and assigns you a unique (ordinal) number. By the way, there are two-three ladies at the desk so there is scalability and availability in place! After you get your number youre put in one of about a dozen virtual queues (or workflows) for your needs: passing tests, changing address, getting license back after revoking and so on. Every such purpose has its own workflow with special rules residing to it.
So each visitor becomes an object routing between different services according to a specific workflow and notified by proper messages. Such coordination is hidden from visitors but happens "behind the scenes" in a workflow managing system. This is the Dynamic Router pattern the heart of the system. This Dynamic Router knows where to send you on the next step of your workflow depending on your results of the previous one. Youre advancing from service to service (from counter to counter) when your number is announced and it appears on those big screens I mentioned before. What about services? Theyre supplied by brave DMVS employees standing at the 20 counters. Theyre grouped by the functionality they supply and serve the next object in a service queue. For instance some fill out your form and verify the docs you brought. Others take your signature, fingerprints, and your photo. A third performs vision checks and so forth. Every service knows how to carry out its own operation. It neither cares where you came from nor does it know where you will go after. All it knows is to double check your input parameters perform its operation then return some result and finally log it to the system.
What is cool is you dont worry about where to go next, either! The Dynamic Router service takes care about you. In practice you wait for your number to appear on the screens showing you the next counter to attend and announced by an electronic voice (number A485 at counter 17). Youre sitting and waiting. Now what about collision resolving? What if you lost your number? What if you missed your queue? In such a case you come to the Dispatcher lady which enqueues you again to the workflow hopefully to the point right after the last stage you successfully have passed. Big hint: messages can expire. A friend of mine, after successful passing her driving test, couldnt wait to get the license and took all the documents home. When she came back a day after, the Dispatcher lady didnt allow her to enter the queue on the last stage. Sorry, Sarit:-( So she had to start her workflow from scratch and thankfully she passed it again (now to the end of the workflow:-)
What about scalability availability and performance, youll ask? As I said every service is scalable over several counters. And hence available. Performance at Norcross was quite impressive (I came there at 10.30am successfully passed my both tests and at 1.30pm went out with my license in hands). Everything was functioning fine and fast. I like our projects implemented in a similar way:-) Not that I wish you to attend a DMVS center. But if you have to, pay attention to this brilliant ESA implementation and good luck with your tests!