| |

EDM – The UI

In this post, I’d like to talk about what I feel is a very interesting idea, I’d like to take the time to talk about engineering some user interface that interacts with an event driven microservice for a back end, whether this back end is utilising some message broker or something else is irrelevant. For argument sake, let’s just say that the back end behaves in some asynchronous manner due to the complex business logic and/or complex/time consuming processes that are involved.

For this example, I’ll use a delivery service as an example, to initiate an order it’s reasonable to assume that a customer has successfully purchased a product. In such a scenario, an event occurs, the purchase has succeeded, then this triggers a series of events to occur, an order is created. In the creation of this order, a few key pieces of information, such as the expected time of delivery & the date the purchase went through.

Let’s say that the order is now in a pending state, the purchase has been successful, the money has left the customers account, but the order hasn’t yet been processed by the warehouse. In such a scenario, you could quite easily have some backend system that communicates with some front-end application via SSE (Server Sent Events), WS (Web Sockets) or potentially some other HTTP mechanism that may implement some form of polling.

So, on the front end, the user would see something along the lines of “Your order is being processed, we expect that you should receive your product on xx/xx/xxxx @ xx:xx”, this is quite a common design for such a business process. Examples include Dominoes when you place a pizza order on their website, Amazon, etc, the idea is that it’s simple & the user will likely check the state of the order later. We could make this system more sophisticated & use notifications or send a text, email, etc, the idea is to ensure that the user is informed that the state of the order has changed for some reason or another. Whether the user decides to cancel the order, or the order has progressed to another stage in the order process, such as “Your order is being shipped”. In all these scenarios, some event has occurred, in such a scenario, the UI should be updated, as previously mentioned, whether you decide to use email, SSMS, notifications, etc is down to specification.

When it comes to implementing a UI to cater for asynchronous backends, depending on context of course, you don’t need to worry about informing the user instantly, if the interface reflects the current state of the process, that’s all that matters. You can even implement an interface that will update in real time, as the state updates, which in my opinion is the best that you can achieve. If the system is non-blocking, responsive, reactive, fault tolerant, quick/fast, etc, I’d say that you’ve done a pretty good job.

The best part about implementing such an interface is that users are natively familiar with it, regardless of how enterprise & complex the back-end architecture is, the UX is generally quite satisfying. You could go ahead & include some fun animations which is what has been achieved with the likes of Dominoes, in my opinion at least, this is a nice to have to say the very least, increasing the UX just that little more.

Similar Posts

  • | |

    Why I Like Spring

    To start off, let’s agree that Spring is a lovely ecosystem, between the large community support, it’s incredibly popular & it’s just all round tried & tested. I could go on, one thing that’s made me fall in love with the Spring framework is the ease that’s included when scaling horizontally, and hell, here’s a…

  • My November Rant

    I was chatting with one of my colleagues just the other day & we started talking about database migration scripts, anyway we started generally discussing how there are some pretty neat tools available these days, like Knex.js. This lead us to talk about ORM’s & how we both completely disagree with the idea that application…

  • Politics

    This is a bit of a different post from myself, recently I’ve been thinking about the likes of parliament & senior management in large organisations. Organisations that includes a lot of politics in the work environment, etc. I’ve come to the conclusion that we’re in a position where we need more technically hands on people…

  • |

    React Rocks

    As some of you may or may not know, I freaking love React, in contrast to the likes of Angular or Vue, I just personally find that it’s a lot less opinionated. An example being how you get the argument that React isn’t a framework, sure it isn’t, but that’s one thing that makes it…

Leave a Reply

Your email address will not be published. Required fields are marked *