Should I use EJB3 or Spring for my business layer?

后端 未结 9 2170
Happy的楠姐
Happy的楠姐 2020-12-07 09:05

My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 09:36

    I would definitely recommend EJB3 over spring. We find that it's more streamlined, nicer to code in, and better supported. I have in the past used Spring and found it to be very confusing, and not as well documented as EJB3 (or JPA I guess at the end of the day)

    1. As of EJB3 you no longer have to deal with external config files, and there's only one POJO that you annotate per database table. This POJO can be passed to your web tier without any problems. IDEs like Netbeans can even auto-generate these POJOs for you. We've used EJB3 now as the back end for quite a few large scale applications, and haven't noticed any performance problems. Your Session Beans can be easily exposed as web services which you could expose to your Flex frontend. Session beans are easy to lock down at either a method or class level to assign roles and things like that if you need to.

    I can't speak that much about spring, as I only tried it out for a few weeks. But my overall impression of it was very poor. That doesn't mean it's bad framework, but our team here has found EJB3 to be the best for the persistence/business layer.

提交回复
热议问题