Why Stateless session beans?

前端 未结 6 1451
谎友^
谎友^ 2020-12-03 06:09

I was reading about stateless session bean and couldn\'t understand it\'s use.

Excerpt from sun tutorial below

\"..Because stateless session beans can suppor

6条回答
  •  再見小時候
    2020-12-03 06:43

    From a non-EJB technology specific standpoint, Stateless Session Beans are infrastructure code that obviously does not hold any state but passes objects that have state. State can beheld by your Stateful Session Beans or Domain POJOs in other implementations outside an EJB. As the comment above states, it is an entry point or facade to your business layer.

    In a java web application, you can design by layer such as Controller, Service class (SLSB or just a plain Java interace) then DAO or whatever to call a database/backend.

    EJB however does some automatic lifting of boiler plate such as transactions, security and such.

提交回复
热议问题