search

Home  >  Q&A  >  body text

面向对象设计模式 - android开发中常用的设计模式有哪些?

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


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


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

PHPzPHPz2772 days ago924

reply all(5)I'll reply

  • PHPz

    PHPz2017-04-17 13:55:05

    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

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:55:05

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

    reply
    0
  • 黄舟

    黄舟2017-04-17 13:55:05

    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.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:55:05

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

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:55:05

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

    reply
    0
  • Cancelreply