Author Archive | Debasish Ghosh

Domain models, Algebraic laws and Unit tests

In a domain model, when you have a domain element that forms an algebraic abstraction honoring certain laws, you can get rid of many of your explicitly written unit tests just by checking the laws. Of course you have to squint hard and discover the lawful abstraction that hides behind your concrete domain element. Consider […]

Continue Reading

Baking a π can teach you a bit of Parametricity

Even though I got my copy of Prof. Eugenia Cheng’s awesome How to Bake π a couple of weeks back, I started reading it only over this weekend. I am only on page 19 enjoying all the stuff regarding cookies that Prof. Cheng is using to explain abstraction. This is a beautiful piece of explanation […]

Continue Reading

A Sketch as the Query Model of an EventSourced System

In my last post I discussed the count-min sketch data structure that can be used to process data streams using sub-linear space. In this post I will continue with some of my thoughts on how count-min sketches can be used in a typical event sourced application architecture. An event sourcing system typically has a query […]

Continue Reading

Endo is the new fluent API

I tweeted this over the weekend .. a good title for a possible blog post .. endo is the new fluent API .. — Debasish Ghosh (@debasishg) June 1, 2013 My last two blog posts have been about endomorphisms and how it combines with the other functional structures to help you write expressive and composable […]

Continue Reading

A DSL with an Endo – monoids for free

When we design a domain model, one of the issues that we care about is abstraction of implementation from the user level API. Besides making the published contract simple, this also decouples the implementation and allows post facto optimization to be done without any impact on the user level API. Consider a class like the […]

Continue Reading