From the course: Java Design Patterns: Structural
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: The Façade pattern - Java Tutorial
From the course: Java Design Patterns: Structural
Challenge: The Façade pattern
(upbeat music) - [Instructor] Let's have a look at our next challenge exercise. This is an app that simulates driving a car, with a manual gear box. It's quite a simplistic representation, to keep this exercise simple. And you don't need to know anything at all about how a car works in real life, to do this one. There are classes each of the components needed for driving a car. Called accelerator, clutch, gear stick, hand brake, and ignition. They all have methods that simulates there functionality, in a real car. For example, in the accelerator class, there are methods called press and lift. And these just print out messages to the console saying, what's happening. So, for example, the press method says, "Pressing accelerator down." In the car class, there is a main method. In here I've created an object for each of the components. And then, underneath I've called the methods in the order they are needed…
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.