Domain decomposition

May 22, 2017 22:49



Sometimes system's domain decomposition is not an obvious process. For example you may have a complex legacy system and a few improvement plans for it. You may not know your domain completely. There may be just too many moving targets and it's hard to wrap your head around a simple task to draw it all in one place.

At initial step you need to draw a circle representing the whole system and surrounding stuff that you want to leave aside, like environment, external components, technology specifics, cross-cutting concerns, etc. It depends of course on what you want to focus on, what you see as your domain and what you see as outcasts. It may be still important to put surrounding pieces into "big picture" to highlight that they are such and there is some kind of relationship.

Then you need to draw first 'component' circle and name it using ubiquitous language (see DDD). Fx. 'green'. Green component is just a box with 'green' ideas. It may contain green watermelon, cyan books and big chunk of rainforest. It actually contains what you want it to contain. And if you don't want to put rainforest there - draw another circle for it.

But! Each time you want to add one - question yourself: is it already there? No? Is any part of the circle already there? Can you split it then? What will be left if you remove all the parts contained elsewhere? Then you just put all the pieces into appropriate boxes and you're done with circle's decomposition. In our case we have identified that green is not only green, but also yellow and blue.

Next step is re-scoping. You may need to rethink now what is external and what is not, relative to the circles that you've got. Maybe the green is not needed, since we can get it from yellow-blue combination. So it becomes an utility.

And now you need to do the opposite of step 2 and try answering these questions: can we merge what's left with any of the existing circles? Can we group any combination and name it in a different way that makes sense on this level of abstraction? Fx. we can call blue and yellow as 'color model' or even RYB by adding red there.

When you do such thing - you need to incapsulate the details, so you make that circle clickable and by clicking it you will dive one level of abstraction down and reason about your blue and yellow again. The interesting part here is that shifting focus to the component's internals will also shift the focus for externals. The new externals will be those top-level components now. Of course you'll need to distill them leaving only what's necessary. In this example we may leave on the periphery only colors that are created from yellow-blue combinations plus those which are affected by them (yeah, that makes all of them :().

And now we are back to where we started. You can focus on another top-level circle or dive deeper and try to decompose yellow or blue. Or you can stop if the result is good enough.
Previous post Next post
Up