Upload
vyacheslav-yakovenko
View
84
Download
0
Tags:
Embed Size (px)
Citation preview
Lighting TalksOctober 2013
Vyacheslav Yakovenko
How to produce clean and neat POJO from XSD?
• JAXB ?!
How to produce clean and neat POJO from XSD?
How to produce clean and neat POJO from XSD?
• xjc –b jaxb-bindings.xml Hotel.xsd
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
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
How to effectively map Value/Entity object to DTO?
• ModelMapper• ModelMapper modelMapper = new ModelMapper();
• OrderDTO dto = modelMapper.map(order, OrderDTO.class);
How to effectively map Value/Entity object to DTO?
How to effectively map Value/Entity object to DTO?