Just a Momento
Back in June I was in interview mode looking for a good opportunity at a company that I could help rock their world. One particular company challenged me with a homework assignment - generate an architectural design document that would represent something I would actually hand off to a senior developer to implement. It would need to contain sufficient detail to make the requirements clear and it could be on any topic I wanted.
I decided to take re-use to a new level and use a recent Exparency implementation component that I had yet to document - the implementation of the Momento Pattern in a SaaS application. In this manner I would be knocking off two birds with one stone - provide the architectural design document per the homework assignment, and document the implementation I had already built - something I try hard to keep up with. That company was supposed to review my design on a Skype session the next day, and after waiting for over an hour on Skype for them to get onto the session I abandoned hope, and despite their apologies and request to reschedule, I decided that there was not a fit. I was glad that I had marked my document as Confidential.
Nevertheless, the implementation is solid and I am prepared to share my design with the outside world - in other words, I no longer find it to be Confidential nor a game changer in my industry (Workflow) and have attached the document to my profile for your reading pleasure.
So exactly what is this all about?
We are all very accustomed to CTRL-Z/CTRL-Y behavior in client tools (Edit Do/Undo/Redo) and yet this type of functionality is hard to find on SaaS applications. When was the last time you created an order in Amazon only to discover that you had accidentally added an item you did not intend to purchase, or decided was too expensive for your pocketbook? Instead of being able to hit CTRL-Z to remove that item, you have to go to the order and physically remove it. If, after thinking about it, you decided "You know what - I really want that item after all" you then have to go and search for the item again and add it to your cart. Wouldn't it be nice if you could just hit CTRL-Y?
The convenience of CTRL-Z/CTRL-Y behavior is enough justification for adding an implementation of the Momento Pattern to your SaaS application. However, there are other benefits:
Maintain a history of user activity. This can be useful when a user reports a problem and the Customer Service Representation needs a record of exactly what it is that user was doing to manifest the problem. Too often you will hear the user state "I can't remember exactly what it is I was doing, but I think I did ..." Adding a menu item to transfer the sequence of activities to some link that the CSR can access is something that can be easily added.
Macro recording. Saving snippets of activity as a sequence of commands and then saving that sequence as a named macro is another convenience that can be provided to the user. Long, repetitive activities are a perfect example of where macros can be beneficial. Again, we are accustomed to having this functionality in many client applications, but rarely find them on SaaS systems.
Offline Application. Some applications need to run in a disconnected environment. For example my current employer is in the oil and gas logistics industry and running applications out in the field oftentimes requires offline operation. One solution to this is to maintain a local database which stores activity data and then synchronizes the database to the application back-end database once in a connected mode. This is a level of complexity (install of a local database, synchronization, etc.) that can be avoided by saving activity instead of data. Instead of synchronizing data in a database, you can simply re-execute the sequence of commands that were saved as an activity history - dramatically reducing the complexity of synchronization.
Testing. Having macro-like sequences of activities are useful for testing applications - SaaS or otherwise. This includes regression, functional, integration, performance and concurrency testing.
As mentioned in the associated document, the Exparency implementation of the Momento Pattern uses the HTML5 local storage to store the sequence of activities and their inverse operations. In the current implementation, two stacks (Javascript arrays) are maintained in that local storage, and because HTML5 local storage can only store name/value pairs as strings (as opposed to objects), then with enough session activity performance in running the application will start to degrade on the client (due to the excessive need to serialize and de-serialize JSON command objects.) In a future implementation I will fix this problem and re-post the update.
The Exparency Workflow system is behind schedule - I was hoping to have a demo-ready version by end of September of this year. With my mother's death due to cancer back in August prior to which I was spending a lot of time up in NJ as a caretaker, starting a new job in September, and my daughter getting married only a few days ago, I was not able to achieve this goal and I am pushing it out to the end of Q1, 2017. This will include resurrecting the Exparency website.
Meanwhile, feel free to use this design in your own applications. The greatest form of flattery is to see your ideas copied :)
you know, I really never thought of this as NOT being a common feature. with the proliferation of SaaS now, I'm seeing it less and less...like it's being overlooked! Even in this happy little LinkedIn mobile app!