5.2. MusicCart Stateful Session Bean

The MusicCart EJB is a stateful session bean that allows clients to create a shopping cart and add and remove recordings (read from the Music Collection database). Before we show you the code, we'll describe a general, architectural view of the major components of our example enterprise application.

The Big Picture

Figure 5-1 presents an architectural overview of our design using J2EE components. A client becomes the “customer” which we encapsulate in the value object CustomerVO (not shown). The stateful session bean MusicCart (denoted SFSB) manipulates RecordingVO objects (see Listing 4.4 on page 96) which originate from the database store we presented in the previous chapter. To keep database access vendor ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications 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.