简体   繁体   English

Java bean映射库-选择哪个(将一个对象转换为另一个对象)?

[英]Java bean mapping library - which to choose (transforming one object to another)?

I have multi tier project with Model, DTO, Managers/Services using DTOs and also some CXF webservices clients with a layer that transforms responses to my models. 我有一个多层项目,其中包含使用DTO的Model,DTO,Managers / Services,以及一些CXF Webservices客户端,其中的一层将响应转换为我的模型。 We are using different approaches, the project is big, we use for example Spring Beautils an many by-hand mappings which can produce errors, are hard to maintain but are fastest. 我们使用的是不同的方法,项目规模很大,例如我们使用Spring Beautils的许多手工映射,这些映射可能会产生错误,难以维护,但速度最快。

I've found Orika an interesting library, that doesnt use reflection int the way the Dozer does, it generates code (like the by-hand code) in some point but I don't know when - when you build your application with maven or when the application is being deployed on for example Weblogic server? 我发现Orika是一个有趣的库,它不像Dozer那样使用反射int,它在某些时候会生成代码(例如手工代码),但是我不知道何时-当您使用maven或在例如Weblogic服务器上部署应用程序时? What would you chhose??? 你会选择什么???

BTW: Do you know any other libraries that are worth using (I use Java 1.7, log4j, junit, spring, hibernate, cxf, jersey, guava, lamba4j)? 顺便说一句:您是否知道其他值得使用的库(我使用Java 1.7,log4j,junit,spring,hibernate,cxf,jersey,guava和lamba4j)?

Here is thesis comparing various solutions to do mapping. 这是比较各种解决方案进行映射的论文 Orika is a good choice. Orika是一个不错的选择。

You could be interested to see JMapper Framework . 您可能会对JMapper Framework感兴趣。 Especially as it permits to manage the multi-level mapping ( wiki page here) 特别是因为它允许管理多级映射(此处为Wiki页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM