在Java-EE中拥有一堆池的“无状态实例” 而不是一个“无状态单例bean” 有什么好处?
Singleton Java-EE:
@ApplicationScoped
public class MySingletonDAO {
// no global properties are shared
..
}
或其他无状态单例bean:
@Singleton
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
public class MySingletonDAO {
// no global properties are shared
..
}
无状态Java-EE:
@Stateless
public class MyStatelessDAO {
..
}
使用@Stateless
-bean代替“无状态单例” -bean不会带来任何好处。有吗?