/android-design-patterns

The most common Design Patterns and App Architectures you can use while developing android apps

Primary LanguageJava

android-design-patterns

This article will introduce the most common Design Patterns and App Architectures you can use while developing apps. Design Patterns are reusable solutions to common software problems. App Architectures provide solutions to an app’s data flow or extensibility issues.

This isn’t an exhaustive list of Design Patterns and App Architectures or an academic paper. Instead, this article serves as a ‘hands-on reference’ and a starting point for further learning.

You should create a project that’s as reusable, readable and recognizable as possible. These goals span from a single object all the way to the entire project and lead to patterns that fall into the following categories:

  • Creational patterns: How you create objects.
  • Structural patterns: How you compose objects.
  • Behavioral patterns: How you coordinate object interactions.

Design patterns usually deal with objects. They present a solution to a reoccurring problem that an object shows and help eradicate design-specific problems. In other words, they represent challenges, other developers already faced and prevent you from reinventing the wheel by showing you proven ways to solve those problems.

You may use one or several of these patterns already without having “A Capitalized Fancy Name” for it. However, Future You will appreciate that you didn’t leave design decisions to intuition alone.

In the sections that follow, you’ll cover these patterns from each category and see how they apply to Android:

Creational Patterns

  • Builder
  • Dependency Injection
  • Singleton
  • Factory

Structural Patterns

  • Adapter
  • Facade
  • Decorator
  • Composite

Behavioral Patterns

  • Command
  • Observer
  • Strategy
  • State

For more infomation: https://www.raywenderlich.com/18409174-common-design-patterns-and-app-architectures-for-android