From the course: Java Design Patterns: Behavioral Part 1
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: The Command pattern - Java Tutorial
From the course: Java Design Patterns: Behavioral Part 1
Challenge: The Command pattern
(techno beats) - [Instructor] Let's have a look at our next exercise. In this one, we've got a sales order app, and the exercise is going to be to complete the remaining functionality using the command pattern, so, let's take a look at the app. This has a class called sales order clients, so this class has a main method and in here there are two order handler objects. One for placing orders, and the other for returning orders. If I look inside, the order handler class, I can see it has a single method called in book, which doesn't do anything at the moment. There is also a third class called jackets, this has two methods, place order and the return order. The functionality for ordering and returning a jacket is in here. If get back to the sales order clients, I can see that there is a field of typed jackets in here. This exercise is to implement command pattern, so that when the involved method is called on the order…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.