citerus / dddsample-core

This is the new home of the original DDD Sample app (previously hosted at sf.net)..
MIT License
4.97k stars 1.47k forks source link

Why getters from domain classes should not be prefixed with “get” in DDD? #20

Closed Kwadz closed 6 years ago

Kwadz commented 7 years ago

The DDDSample project seems to be a reference about how to design a DDD project.

I noticed all the getters in the domain classes are not prefixed by get. Ex: Cargo#delivery

Richard C. Martin, in his book Clean Code, sates:

Accessors, mutators, and predicates should be named for their value and prefixed with get, set, and is according to the javabean standard.

So, should we avoid to follow his advice in this context? If so, why would it be more important than consistency?

Copied from my question on SO.

rickardsundin commented 6 years ago

VoiceOfUnreason has provided a nicely worded reply to this query on StackOverflow: https://stackoverflow.com/a/46141986/2033818