Does singleton/session scopes of Spring beans require that access to all its fields must be synchronized? Say through \"synchronized\" keyword or using some classes from package
Basically for every user that initiates a session a new ShoppingCart
will be created and scoped to that session per that user.
Your class is thread-safe. The initialization
private List items = new ArrayList();
is a thread-safe initialization and
addItem(Product item)
is an atomic operation and is also therefore thread-safe.