面向对象设计模式 - android开发中常用的设计模式有哪些?
PHPz
PHPz 2017-04-17 13:53:05
0
5
927

设计模式一共有3种类型,共23种。


创新型模式:单例模式、抽象工厂模式、建造者模式、工厂模式、原型模式。
结构型模式:适配器模式、桥接模式、装饰模式、组合模式、外观模式、享元模式、代理模式。
行为型模式:模块方法模式、命令模式、迭代器模式、观察者模式、中介者模式、备忘录模式、解释器模式、状态模式、策略模式、职责链模式、访问者模式。


那么问题来了,这么多的设计模式中android开发中一般都用到哪些?我想针对性的先学。

PHPz
PHPz

学习是最好的投资!

reply all(5)
PHPzhong

Innovative patterns: singleton pattern, abstract factory pattern, builder pattern, factory pattern.
Structural patterns: adapter pattern, composition pattern, agent pattern.
Behavioral patterns: observer pattern, mediator pattern.

It is recommended that you read the android developer training page once.
http://developer.android.com/training/index.html

Ty80

Many design patterns are used in Android source code. Here you can refer to:
Android source code design pattern analysis open source project

黄舟

Take a look at the Head First design pattern. It has a good explanation of the design pattern. At the same time, it gives a lot of space to the commonly used design patterns (basically those commonly used in Android). The less commonly used ones are just passed by. Some examples of design patterns are given, which is more interesting to learn. The commonly used design patterns in Android are also explained in great lengths in the book. After learning it and then looking at Android, you don’t need to look at it in particular. When you see a certain class, its usage, and what kind of design pattern it uses, Immediately came to mind.

After reading design patterns, you will feel more and more accomplished when writing.

左手右手慢动作

Recommend a book to you: Software Cheats: Design Patterns
It’s very easy to understand

刘奇

Factory mode, adaptation mode, singleton mode are commonly used in android.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template