Skip to content

Instantly share code, notes, and snippets.

@kevin-isky
Last active February 16, 2016 11:54
Show Gist options
  • Select an option

  • Save kevin-isky/c21c444968640608d330 to your computer and use it in GitHub Desktop.

Select an option

Save kevin-isky/c21c444968640608d330 to your computer and use it in GitHub Desktop.

Revisions

  1. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@

    + [Google I/O 2015 Android APP 的源码](https://github.com/google/iosched)

    关于这个App源码使用方法,官方是这么说的:
    关于这个APP源码使用方法,官方是这么说的:

    > We hope the source code for this app is useful for you as a reference or starting point for creating your own apps.
  2. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -35,14 +35,14 @@
    + Independent of Database
    + Independent of any external agency

    该应用架构划分为业务逻辑(Bussiness Rules)、接口适配(Interface Adapters)、框架和组件(Frameworks and Drivers)等部分。
    该应用架构划分为业务逻辑(Business Rules)、接口适配(Interface Adapters)、框架和组件(Frameworks and Drivers)等部分。

    > The concentric circles represent different areas of software. In general, the further in you go, the higher level the software becomes. The outer circles are mechanisms. The inner circles are policies.
    **业务逻辑**Bussiness Rules)分为了两层:
    **业务逻辑**Business Rules)分为了两层:

    + [领域](https://en.wikipedia.org/wiki/Domain-driven_design)业务逻辑层(Enterprise Bussiness Rules),封装了业务实体对象(Entities)。
    + 应用业务逻辑层(Application Bussiness Rules),封装并实现了系统用例(Use Cases)。
    + [领域](https://en.wikipedia.org/wiki/Domain-driven_design)业务逻辑层(Enterprise Business Rules),封装了业务实体对象(Entities)。
    + 应用业务逻辑层(Application Business Rules),封装并实现了系统用例(Use Cases)。

    *Entities*
    > Entities encapsulate Enterprise wide business rules.
    @@ -61,4 +61,4 @@
    ---

    对Android应用开发中涉及的代码架构感兴趣的同学,可以把知乎的这个问题作为一个知识挖掘的起点,根据自己的实际情况进行更深入的研究学习和实践。
    对Android应用架构感兴趣的同学,可以把知乎的这个问题作为一个知识挖掘的Starting Point,根据自己的实际情况进行更深入的研究学习和实践。
  3. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@

    > By separating the software into layers, and conforming to The Dependency Rule, you will create a system that is intrinsically testable, with all the benefits that implies.
    这篇文章介绍了Uncle Bob的The Clean Architecture,核心思想是利用分层(separating the software into layers)和依赖规则(The Dependency Rule)实现应用架构不依赖于具体的开发框架/UI组件/数据库等各种外部的具体技术实现。
    这篇文章介绍了[Uncle Bob](https://en.wikipedia.org/wiki/Robert_Cecil_Martin)的The Clean Architecture,核心思想是利用分层(separating the software into layers)和依赖规则(The Dependency Rule)实现应用架构不依赖于具体的开发框架/UI组件/数据库等各种外部的具体技术实现。

    + Independent of Frameworks
    + Independent of UI
  4. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@

    > We hope the source code for this app is useful for you as a reference or starting point for creating your own apps.
    原汁原味的源码可以拿来学习研究,也可以作为自己开发APP时的一个Starting Point。
    原汁原味的谷歌官方源码可以拿来学习研究,也可以作为自己开发APP时的一个Starting Point。

    其二,

  5. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@
    + Independent of Database
    + Independent of any external agency

    该架构把应用系统划分为业务逻辑(Bussiness Rules)、接口适配(Interface Adapters)、框架和组件(Frameworks and Drivers)等部分。
    该应用架构划分为业务逻辑(Bussiness Rules)、接口适配(Interface Adapters)、框架和组件(Frameworks and Drivers)等部分。

    > The concentric circles represent different areas of software. In general, the further in you go, the higher level the software becomes. The outer circles are mechanisms. The inner circles are policies.
  6. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@

    [豆沙包](https://www.zhihu.com/people/dou-sha-bao-31)同学的回答里有两个好东西:

    其一
    其一

    + [Google I/O 2015 Android APP 的源码](https://github.com/google/iosched)

    @@ -22,7 +22,7 @@
    原汁原味的源码可以拿来学习研究,也可以作为自己开发APP时的一个Starting Point。

    其二
    其二

    + [The Clean Architecture](https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html)

  7. kevin-isky revised this gist Feb 16, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@

    下面是正文。

    ---

    在知乎上找到了这个问题:

    + [Android 开发有什么好的架构么](https://www.zhihu.com/question/21406685)
  8. kevin-isky created this gist Feb 16, 2016.
    62 changes: 62 additions & 0 deletions android-app-architecture.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    ## Android应用架构

    写了一段时间的Android应用,功能都实现了,但总觉得代码写得乱到一起,没有层次感,所以自己到网上看看有没有啥好的架构可以拿来用。

    下面是正文。

    在知乎上找到了这个问题:

    + [Android 开发有什么好的架构么](https://www.zhihu.com/question/21406685)

    [豆沙包](https://www.zhihu.com/people/dou-sha-bao-31)同学的回答里有两个好东西:

    其一:

    + [Google I/O 2015 Android APP 的源码](https://github.com/google/iosched)

    关于这个App源码使用方法,官方是这么说的:

    > We hope the source code for this app is useful for you as a reference or starting point for creating your own apps.
    原汁原味的源码可以拿来学习研究,也可以作为自己开发APP时的一个Starting Point。

    其二:

    + [The Clean Architecture](https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html)

    > By separating the software into layers, and conforming to The Dependency Rule, you will create a system that is intrinsically testable, with all the benefits that implies.
    这篇文章介绍了Uncle Bob的The Clean Architecture,核心思想是利用分层(separating the software into layers)和依赖规则(The Dependency Rule)实现应用架构不依赖于具体的开发框架/UI组件/数据库等各种外部的具体技术实现。

    + Independent of Frameworks
    + Independent of UI
    + Independent of Database
    + Independent of any external agency

    该架构把应用系统划分为业务逻辑(Bussiness Rules)、接口适配(Interface Adapters)、框架和组件(Frameworks and Drivers)等部分。

    > The concentric circles represent different areas of software. In general, the further in you go, the higher level the software becomes. The outer circles are mechanisms. The inner circles are policies.
    **业务逻辑**(Bussiness Rules)分为了两层:

    + [领域](https://en.wikipedia.org/wiki/Domain-driven_design)业务逻辑层(Enterprise Bussiness Rules),封装了业务实体对象(Entities)。
    + 应用业务逻辑层(Application Bussiness Rules),封装并实现了系统用例(Use Cases)。

    *Entities*
    > Entities encapsulate Enterprise wide business rules.
    *Use Cases*
    > The software in this layer contains application specific business rules.
    **接口适配**(Interface Adapters)可以理解为中间层,负责业务逻辑与外部框架及组件(如数据库,UI组件等)之间的数据转换和交换工作。

    > The software in this layer is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the Database or the Web.
    **框架和组件**(Frameworks and Drivers)主要是应用程序开发过程中所涉及到的各类框架和工具,包括数据库、Web开发框架
    及UI组件等。

    > This layer is where all the details go.
    ---

    对Android应用开发中涉及的代码架构感兴趣的同学,可以把知乎的这个问题作为一个知识挖掘的起点,根据自己的实际情况进行更深入的研究学习和实践。