O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refactoring the ShoppingCartBean

The ShoppingCartBean class is used by the action classes and servlets to interact with the user's shopping cart. The main purpose of this component is to provide a mechanism to add one or more movies to the shopping cart or to delete one or more movies from the shopping cart. The movies are selected for addition or deletion to the cart on the two HTML forms generated by the MoviesChooser servlet. These forms post to an action class, which compiles the user's selections in a collection that is used by the action servlet (SubmitCartAction) to call either the addMovies method or the deleteMovies method on the ShoppingCartBean.

We would like to refactor the ShoppingCartBean in a way that has a limited impact on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required