Re: Re: Nested immutable value objects
Tom Eugelink <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
I'm quite new to DDD as a development technique; the concept of modelling the domain totally separate of any context, seems like like 'the way to go' in software engineering and I have been developing software like that for many years, by just following my own gut feeling principles. And they worked quite well for me so far, but I still use setters.
I can understand that setters are questionable, and that in this example "gasUp(new Liter(50))" (hey, Java ;-) or "drive(new Miles(10))" are the better way of modifying the entity. But I also know that setters are required a lot of properties because the have to be set from some form, like a car's registration. Or is that whole do-not-use-setters thing just syntax, like a "register('12345')" actually is a "setRegistration('12345')"?
The example you've giving with using all lamba's feel to me like overkill and losing the 'natural' way of handling entities. Is there any documentation / argumentation why that would be the way to do things?
Tom
------------------------------------