TDD: primitive obsession ( part 3 )

, Software Pundits
This post was originally published on this site

Apium Hub

Last month we talked about TDD example in software development ( part 1 ) and TDD first cycle ( part 2) . In this new TDD and primitive obsession article, we will focus on removing duplication and reinforcing the constructors of our entities, something key to have a robust system.

TDD: primitive obsession

Here comes an interesting DDD concept – the use of ValueObjects and the removal of Primitive Obsession from the head. A String is not a name, a name is a subset of String (Refined Types). In our ubiquitous language created with client, there is no string, there is a Name or Last Name.

Within the String set exists “”, “4”, “<script src =” malicious.js “/>” and everything you can imagine, a Name is the same? We can not ignore this logic and with the Surname happens, the same, and we do not want to duplicate code …

To read the full article click on the 'post' link at the top.