4. How to produce clean and neat POJO from XSD?
• xjc –b jaxb-bindings.xml Hotel.xsd
5. How to produce clean and neat POJO from XSD?
• JiBX: Binding XML to Java Code (
http://jibx.sourceforge.net/ )
• java -cp .:/home/epam/bin/jibx/lib/jibx-
tools.jar org.jibx.schema.codegen.CodeGen
-p com.epam.lightingtalks.dto Hotel.xsd
6. How to effectively map Value/Entity object to DTO?
• Hardcode ()
• (pros) Simple
• (cons) Prone to error and time consuming strategy
• Dozer ( http://dozer.sourceforge.net/ )
• (pros) Simple
• (cons) Xml config, slow
• ModelMapper ( http://modelmapper.org/ )
• (pros) Fast, Open for Extension, There is some strategies out of box
• (cons) Extensions can take a time
7. How to effectively map Value/Entity object to DTO?
• ModelMapper
• ModelMapper modelMapper = new ModelMapper();
• OrderDTO dto = modelMapper.map(order, OrderDTO.class);