Modeling Interface Behavior

One of the challenges in component-based development is understanding how to properly use the component. Although the interfaces of components, such as EJBs, do define services provided by the component by exposing the relevant methods, not every combination or ordering of the methods is valid.

For example, consider the Remote interface defined for a ShoppingCart session bean as shown in Figure 12-8.

Figure 12-8. ShoppingCart session bean Remote interface

Now consider the sequence diagram shown in Figure 12-9.

Figure 12-9. Sequence diagram showing usage of session bean

The sequence diagram shows how the session bean ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.