Exploring Design Patterns

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now


Design patterns are solutions to common software design problems. Since they’re patterns, you can adapt them to various contexts that fit the problem space they’re designed for. These patterns are reliable since they’ve been tested and proven to work over many years. Many design patterns are available, each designed to solve specific problems. For mobile app development, it’s essential to know some of these patterns, as they address common problems.

Exploring Practical Examples

Consider the scenario where you order food at a restaurant. The way you make the request is similar to how everyone else does it. You choose from predefined meals or customize your order with toppings and beverages. The server sends your request to the kitchen and returns with your order. The other person does the same and receives a different dish based on their choices. You can model how the food is created with a factory pattern in software. This pattern creates different types of objects (foods) depending on the order requested. You can apply this pattern anywhere you need to use a single interface to get different kinds of objects.

Advantages of Design Patterns

Having well-known and accepted patterns makes code easy to read and understand. These patterns simplify documentation and communication since they define terminologies and techniques. Anyone who knows about a pattern or looks it up for the first time will be able to understand your code easily.

Disadvantages of Design Patterns

Design patterns focus on solving specific structural, creational, and behavioral problems without much consideration for efficiency. This means these patterns aren’t necessarily the most efficient, even though they may be excellent solutions to their specific problems. There’s a tendency to apply them extensively without considering that some apps may have other conditions and use cases that would make some design patterns unsuitable. They may lead to the creation of more classes and files, affecting the complexity of the code.

Common Design Patterns in Mobile App Development

Some problems are common in mobile app development, and these are some common design patterns frequently used to solve them:

Reviewing Types of Design Patterns

Design patterns can be grouped into three main types:

See forum comments
Download course materials from Github
Previous: Introduction Next: Learning Singleton Pattern