groovy - Grails Project DTOs in Java -
in grails there plug-in compile ":dto:0.2.4" transfer domain objects dtos. when using plug-in dtos created java classes.
for example if there domain class person.groovy dto created persondto.java
what intention of kind of behavior ? comment appreciated.
peter ledbrook answer question in this blog post.
despite that, dtos still persist (pardon pun). when want serialise data on rpc, they’re 1 of few options available you. gwt-rpc case in point, , reason grails dto plugin. gilead allows transparently serialise hibernate domain instances, works if domain class can loaded client. since gorm domain classes typically groovy, that’s not option gwt. typical grails domain class includes bunch of stuff client hardly going interested in, custom mappings.
so, can lightweight version of domain class, data client needs.
not case of grails, have static methods database query's, if have dao class, dto pattern can used ensure client not allowed perform methods touch database. can ensure inappropriate use of objects in presentation layer.
Comments
Post a Comment