Identifies seven object-oriented design patterns (including the singleton, observer, decorator, and factory patterns) that make your development process faster and easier.
- [Voiceover] Hi, I'm Eric Freeman and welcome to Foundations of Programming Design Patterns. - [Voiceover] And I'm Elizabeth Robson. Together, Eric and I will be your tour guides for this course. - [Voiceover] So what are design patterns? They're solutions to common software design problems that occur over and over in software development. - [Voiceover] We'll start by showing you how to dynamically change the behavior of your classes with the strategy, decorator, and state patterns. Then we'll show you how to manage communication between objects with the observer pattern. Next, we'll show you how to manage object creation with the singleton pattern and we'll show you how to encapsulate those aspects of your code that are likely to change with the iterator and factory patterns.
- [Voiceover] I'll start off by giving a broad overview of each design pattern to introduce the concepts and to describe how the pattern works. - [Voiceover] And then I'll dive a little deeper into the pattern and show you how to implement a design in code. This is where you get to see the design patterns in action. - [Voiceover] We've got a lot to cover so let's get started.
- What are design patterns?
- Encapsulating code that varies with the strategy pattern
- Setting behavior dynamically
- Implementing the observer pattern
- Creating chaos with inheritance
- Extending behavior with composition
- Dealing with multithreading and the singleton pattern
- Revising the design for a state machine
- Encapsulating iteration with the collection pattern
- Encapsulating object creation with the factory method pattern
Skill Level Intermediate
Q: How do I import the exercise files in Eclipse?
<div>A: Here are instructions for importing the files: </div> <div> </div> <div>1) Save the download folder as any name you choose, such as DesignPatternsLynda. Place this folder in the default Eclipse project folder (the folder you choose when you start Eclipse). </div> <div>2) Start Eclipse. </div> <div>3) In Eclipse, choose File > New > New Java Project. </div> <div>4) In the first New Project dialog box, use the folder name from step 1 as the project name. Check that the location path matches the default Eclipse project path and the name of the folder. (See NewProject.jpg.)</div> <div><img src="http://files.lynda.com/files/prodfaqs/NewProject.jpg" border="0" alt="" /><br /> </div> <div>5) Click Next. </div> <div>6) In this dialog box, leave all settings as is (see Step2.jpg):</div> <div><img src="http://files.lynda.com/files/prodfaqs/Step2.jpg" border="0" alt="" /><br /> </div> <div>7) Click Finish. </div> <div>8) You should now have a project in Eclipse with the following structure (see EclipseProjectStructure.jpg):</div> <div><img src="http://files.lynda.com/files/prodfaqs/EclipseProjectStructure.jpg" border="0" alt="" /><br /> </div> <div>9) To compile the code, open the folder you want to work with and choose the main class. </div> <div>10) Choose Run > Run As > Java Application.</div>