O'Reilly logo

Pro Objective-C Design Patterns for iOS by Carlo Chung

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 4. Factory Method

We have seen factory methods almost in every application written in an object-oriented language. The Factory Method pattern is an integral part of the Abstract Factory pattern in Chapter 5. Different concrete factories create their own products (objects) by using an overridden factory method that was defined in a parent abstract factory class.

An object factory is like real factories that manufacture tangible products; for example, a shoe manufacturer produces shoes and a cell phone manufacturer produces cell phones. Let's say you are asking the manufacturers to produce some products for you, and you send them a "produce product" message. Both the shoe and cell phone manufacturers are following the same protocol of "produce ...

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