I try to convince coworkers to stop writing code like this (example in java):
class Person {
Long id;
String name;
String surname;
}
and write code like this:
class Person {
PersonId id;
PersonName name;
PersonSurname surname;
}
Basically, I want to avoid overusing Strings', Longs' and use dedicated types that correspond to a domain. This is not a new concept, methodology or practise (however you call it), so it probably already have a name. There probably are many people who have already written pros and cons of such approach, but I cannot find any, because I do not know what to look for.
Aucun commentaire:
Enregistrer un commentaire