更新时间:2023-12-03 15:56:10
If you use stateful session beans, the EJB container manages state on behalf of your client, so there is no need to pass around an ID: It's more comfortable.
In your case it's OK.
Generally speaking, consider these items:
@Remote
: If client and server are not on the same JVM, each method call requires marshalling, and goes over the network.List
s there, and their number and their content will most likely grow over the time. Using a stateless setup, you can design an application where the state is only managed in the browser, for example.For these reasons I always prefer the stateless setup using data transfer objects. But again, in your case it's OK.