Why use stateful session beans?

前端 未结 2 1086
轮回少年
轮回少年 2021-01-11 11:17

I\'m learning EJB3 and I\'m just curious when it\'s convenient to use SFSB? I can\'t find any nice example when SFSB realy solve easily some complex problem.

Actuall

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-11 12:14

    it is just a matter of design to choose between a stateful and a stateless architecture.

    most of the times stateless design is preferred since it is easier.

    although simpler to understand at the beginning, building stateless applications leads to a set of problems (plenty of stateless web services, spring singleton, etc...), making the application less manageable in the long run.

    i prefer to design stateful applications when possible.

    stateful session bean is a way to do it. spring prototype or web-scoped bean another.

    check also out jboss seam framework.

提交回复
热议问题