java - Is it okay to create a DTO counterpart of a table in a database assuming its persistent ignorant domain model and the DTO is in the repository? -


what prompted me ask question class example invoice has private fields , dont want use setters because calculations of sort. instead options are: fields in constructor or reflection reconstitute object database (which occurs in repository layer(repository pattern))

don't create separate dto, use orm framework. modern orm frameworks (such hibernate) can map private fields without needing getter/setter. yes, use reflection internally, don't have write of yourself.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -