Re:
Dennis Traub <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAJw46f5FPZ1ArsGwjbsTeb-eSg3P5LV6dtSN9c2vWQkVoHSFYw@mail.gmail.com> |
Hi Fabricio, I think that's better than using too many primitives in your domain model, which sometimes is also refered to as "primitive obsession". Using custom types even for simple values makes them much more explicit. It helps enforce invariants: e.g. an email type could validate itself, using a string instead would need something external. It also makes code much more redable. Best Dennis -- Dennis Traub Software Development Consultancy Am Bogen 7 33178 Borchen Phone: 05293/73942-73 Fax: 05293/73942-74 Mobile: 0170/2842385 Mail: [email protected] <[email protected]> On Fri, Apr 12, 2013 at 4:35 PM, Fabrício Cabral <[email protected]>wrote: > ** > > > Hi everybody! > > What do you think about usage of tiny types as part of your > domain model? Do you agree or disagree? What kind of benefits it > put into your system's model? > > Some links about this subject: > > http://darrenhobbs.com/2007/04/11/tiny-types/ > http://martinfowler.com/ieeeSoftware/whenType.pdf > > Thanks for your attention! > > -- > --fx > > >