6.2. What is ‘state’ ?

The issue of ‘state’ in stateful and stateless EJBs needs some explanation, as do the related terms ‘session’ and ‘session state.’

In object-oriented design, the state of an object is generally taken to mean a snapshot of the data encapsulated within an object at an instant in time. As objects can contain other objects as part of their state, which can in turn contain others, the overall state of an object can be considered as a tree, or hierarchy, of data values. When using Java, state is usually taken to mean the set of values of the instance variables of an object, including the instance variables of instance variables that are themselves objects. Changing an instance variable constitutes changing the state. In session ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.