O'Reilly logo

Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition by Alan Shalloway, James R. Trott

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

Chapter 20. Lessons from Design Patterns: Factories

Overview

This chapter discusses the use of factories—objects that make other objects. Although factories are presented in the Gang of Four book, their use in design is not discussed fully.

This chapter

•   Discusses why the use of factories can greatly simplify your design and code.

•   Explains the proper steps of seeing first what your objects are and then deciding how to create and/or manage them.

Factories

Usually, when I am designing objects, I am concerned with their behavior: what the objects do and how other objects tell them to do it. But I also need to be concerned about figuring out when a ...

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