What is an Enterprise Java Bean really?

前端 未结 7 1867
小鲜肉
小鲜肉 2021-02-05 18:59

On the Tomcat FAQ it says: \"Tomcat is not an EJB server. Tomcat is not a full J2EE server.\"

But if I:

  • use Spring to supply an application context
  • <
7条回答
  •  再見小時候
    2021-02-05 19:03

    then don't I effectively have a Java EE application server? And then aren't my beans EJB's? Or is there some other defining characteristic?

    Quick answer EJBs actually have to follow a Java EE specification. Tomcat is a Java EE container not an app server.

    What is it that a Java EE compliant app server gives you that you can't easily/readily get from Tomcat with some 3rd party subsystems?

    Quick answer to your second question. In your case most likely nothing.

    EJBs tend to be really heavy objects and people ended up using them to solve problems when they were essentially overkill. Frameworks like Spring were created to solve those problems without using EJBs. I think the first book where Spring was introduced was even called "J2EE development without EJB."

提交回复
热议问题