When you have an entity such as UserEntity, who has a property idderived from his primary key in db - should you provide a setter method, for example setId()?
id
setId()
Some arguments against:
Some arguments for:
Provide a setter (and not force it idin the constructor) or force install idin the constructor and remove the installer?
- persistence . , ( ) . , , , . , , , , persistence UUID , .
@johnnietheblack, getter . ( ), . , .
, (Andrew Driven Design), , . , , .