Posts

Showing posts from October, 2019

EWF Service Decomposition Pattern

Image
EWF is another microservice decomposition pattern that I like to use when building services. It stands for Entity, Workflow & Functional services. In simplest terms, it’s an extension of Single Responsibility principle and allows for building independent testable services. To understand this pattern better, let’s start with an example. Imagine I want to write a signup service that allows user to signup to a website using their Google account. The service would perform the following:  Let user login into google account and fetch user’s basic information from Google upon successful sign-in. Apply more default settings associated to creating new user.  Persist the user in the database.  After successful registration, redirect the user to the homepage.  At a high level, this works just fine and gets the job done. But if you think about testability first and wants to test this service in isolation we have a problem! The entire testing paradigm relies on the fact that the O