forked from joelhooks/robotlegs-documentation
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more traditional chinese translation. fixed small text error
- Loading branch information
Showing
15 changed files
with
799 additions
and
799 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
<div align="center">!=http://joelhooks.com/wp-content/uploads/2009/07/robotlegssketchsmall.gif!<p><strong>Documentation for Robotlegs v1.0RC1</strong></p></div> | ||
h2. 目录 | ||
# *"Robotlegs 是什么":#whatisrobotlegs* | ||
# "依赖注入":#dependencyinjection | ||
# "使用 Injectors":#usingtheinjectors | ||
** "SwiftSuspenders 适配器注入语法":#injectionsyntax | ||
** "Injector 类的映射注入":#mappingwithinjector | ||
** "MediatorMap 类的依赖注入":#mappingwithmediatormap | ||
** "CommandMap 类的依赖注入":#mappingwithcommandmap | ||
# "The Context":#thecontext | ||
# *"MVCS 参考实现":#mvcs* | ||
## "Context":#context | ||
## "Controller & Commands":#controllersandcommands | ||
## "View & Mediators":#viewandmediators | ||
## "Model, Service and the Actor":#modelandservice | ||
## "Model":#modelandmodels | ||
## "Service":#serviceandservices | ||
## "框架事件":#frameworkevents | ||
## *"Commands":#commands* | ||
### "Command 职责":#commandresponsibilities | ||
### "触发 Command":#triggeringcommands | ||
### "链接 Command":#chainingcommands | ||
### "应用程序层的解耦":#decouplingtiers | ||
## *"Mediators":#mediators* | ||
### "Mediator 职责":#mediatorresponsibilities | ||
### "映射一个 Mediator":#mappingamediator | ||
### "View Component 的自动中介":#automaticmediation | ||
### "View Component 的手动中介":#manualmediation | ||
### "映射主程序 (_contextView_) Mediator":#mappingthecontextview | ||
### "访问一个 Mediator 的 View Component":#accessingmediatorviewcomponent | ||
### "给一个 Mediator 添加事件监听":#addingeventlistenerstomediators | ||
### "监听框架事件":#mediatorslisteningfroframeworkevents | ||
### "广播框架事件":#Mediatorsdispatchingframeworkevents | ||
### "监听 View Component 事件":#mediatorslisteningforcomponentevents | ||
### "通过 Mediator 访问 Model 和 Service":#accessingmodelsandservicesfrommediators | ||
### "访问其它 Mediator":#accessingothermediatorsfromamediator | ||
## *"Models":#models* | ||
### "Model 职责":#modelresponsibilities | ||
### "映射一个 Model":#mappingamodel | ||
### "从一个Model里广播事件":#dispatchingeventsfrommodel | ||
### "在一个 Model 里监听框架事件":#listeningforeventsinmodel | ||
## *"Services":#services* | ||
### "Service 职责":#serviceresponsibilities | ||
### "映射一个 Service":#mappingservice | ||
### "在一个 Service 里监听框架事件":#servicelisteningforframeworkevents | ||
### "广播框架事件":#servicedispatchingframeworkevents | ||
### "Service 示例":#serviceexample | ||
**** "Services 应该实现一个接口":#serviceimplementsinterface | ||
**** "在一个 Service 里解析数据":#parsingresultsinservice | ||
**** "Service 事件":#serviceevents | ||
<div align="center">!=http://joelhooks.com/wp-content/uploads/2009/07/robotlegssketchsmall.gif!<p><strong>Documentation for Robotlegs v1.0RC1</strong></p></div> | ||
h2. 目录 | ||
|
||
# *"Robotlegs 是什么":#whatisrobotlegs* | ||
# "依赖注入":#dependencyinjection | ||
# "使用 Injectors":#usingtheinjectors | ||
** "SwiftSuspenders 适配器注入语法":#injectionsyntax | ||
** "Injector 类的映射注入":#mappingwithinjector | ||
** "MediatorMap 类的依赖注入":#mappingwithmediatormap | ||
** "CommandMap 类的依赖注入":#mappingwithcommandmap | ||
# "The Context":#thecontext | ||
# *"MVCS 参考实现":#mvcs* | ||
## "Context":#context | ||
## "Controller & Commands":#controllersandcommands | ||
## "View & Mediators":#viewandmediators | ||
## "Model, Service and the Actor":#modelandservice | ||
## "Model":#modelandmodels | ||
## "Service":#serviceandservices | ||
## "框架事件":#frameworkevents | ||
## *"Commands":#commands* | ||
### "Command 职责":#commandresponsibilities | ||
### "触发 Command":#triggeringcommands | ||
### "链接 Command":#chainingcommands | ||
### "应用程序层的解耦":#decouplingtiers | ||
## *"Mediators":#mediators* | ||
### "Mediator 职责":#mediatorresponsibilities | ||
### "映射一个 Mediator":#mappingamediator | ||
### "View Component 的自动中介":#automaticmediation | ||
### "View Component 的手动中介":#manualmediation | ||
### "映射主程序 (_contextView_) Mediator":#mappingthecontextview | ||
### "访问一个 Mediator 的 View Component":#accessingmediatorviewcomponent | ||
### "给一个 Mediator 添加事件监听":#addingeventlistenerstomediators | ||
### "监听框架事件":#mediatorslisteningfroframeworkevents | ||
### "广播框架事件":#Mediatorsdispatchingframeworkevents | ||
### "监听 View Component 事件":#mediatorslisteningforcomponentevents | ||
### "通过 Mediator 访问 Model 和 Service":#accessingmodelsandservicesfrommediators | ||
### "访问其它 Mediator":#accessingothermediatorsfromamediator | ||
## *"Models":#models* | ||
### "Model 职责":#modelresponsibilities | ||
### "映射一个 Model":#mappingamodel | ||
### "从一个Model里广播事件":#dispatchingeventsfrommodel | ||
### "在一个 Model 里监听框架事件":#listeningforeventsinmodel | ||
## *"Services":#services* | ||
### "Service 职责":#serviceresponsibilities | ||
### "映射一个 Service":#mappingservice | ||
### "在一个 Service 里监听框架事件":#servicelisteningforframeworkevents | ||
### "广播框架事件":#servicedispatchingframeworkevents | ||
### "Service 示例":#serviceexample | ||
**** "Services 应该实现一个接口":#serviceimplementsinterface | ||
**** "在一个 Service 里解析数据":#parsingresultsinservice | ||
**** "Service 事件":#serviceevents | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
h2(#whatisrobotlegs). Robotlegs 是什么 | ||
Robotlegs 是一个用来开发Flash, Flex, 和 AIR 应用的纯 AS3 微架构(框架). Robotlegs 专注于将应用程序各层排布在一起并提供它们相互通讯的机制. Robotlegs 试图通过提供一种解决常见开发问题的经过时间检验的架构解决方案来加速开发. Robotlegs 无意锁定你到框架, 你的类就是你的类的样子, 而且应该很容易地切换到其他框架. | ||
框架提供一个基于 "Model-View-Controller":http://en.wikipedia.org/wiki/Model–view–controller 元设计模式的默认实现. 这个实现提供一个针对应用程序结构和设计的强烈建议. 虽然它确实轻微减低了你的应用程序的便携性, 不过它依然以最低限度影响你的具体类为目标. 通过扩展 "MVCS":#mvcs 实现类, 你可以获得很多有用的方法和属性. | ||
你不必使用Robotlegs的标准 "MVCS":#mvcs 实现.你可以使用它的任意部分, 或者完全不使用它, 或者使用自己的实现来适应你的需求. 它是为了提供合适的参考实现和快速开始使用 Robotlegs 而被包含进来。 | ||
h2(#whatisrobotlegs). Robotlegs 是什么 | ||
|
||
Robotlegs 是一个用来开发Flash, Flex, 和 AIR 应用的纯 AS3 微架构(框架). Robotlegs 专注于将应用程序各层排布在一起并提供它们相互通讯的机制. Robotlegs 试图通过提供一种解决常见开发问题的经过时间检验的架构解决方案来加速开发. Robotlegs 无意锁定你到框架, 你的类就是你的类的样子, 而且应该很容易地切换到其他框架. | ||
|
||
框架提供一个基于 "Model-View-Controller":http://en.wikipedia.org/wiki/Model–view–controller 元设计模式的默认实现. 这个实现提供一个针对应用程序结构和设计的强烈建议. 虽然它确实轻微减低了你的应用程序的便携性, 不过它依然以最低限度影响你的具体类为目标. 通过扩展 "MVCS":#mvcs 实现类, 你可以获得很多有用的方法和属性. | ||
|
||
你不必使用Robotlegs的标准 "MVCS":#mvcs 实现.你可以使用它的任意部分, 或者完全不使用它, 或者使用自己的实现来适应你的需求. 它是为了提供合适的参考实现和快速开始使用 Robotlegs 而被包含进来。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
h2(#dependencyinjection). 依赖注入 | ||
Robotlegs 围绕 "依赖注入":http://www.insideria.com/2009/09/as3-dependency-injection-demys.html 设计模式展开. | ||
bq. 最简单地, 依赖注入是为对象提供实例变量或属性的行为. 当你传递一个变量到一个类的构造函数, 你在使用依赖注入. 当你设置一个类的属性, 你在使用依赖注入. 如果你不是使用严格的过程或线性方式编写AS3, 很可能你现在就在使用依赖注入。 | ||
Robotlegs 使用基于元数据的自动依赖注入. 这是为了方便开发而提供, 而且在排布应用程序并提供类和它所需要的依赖时,可以减少很多代码量. 虽然完全可以手动提供这些依赖, 但是允许框架来履行这些职责可以减少出错的机会,并且通常可以加快编码进程。. | ||
h2(#dependencyinjection). 依赖注入 | ||
|
||
Robotlegs 围绕 "依赖注入":http://www.insideria.com/2009/09/as3-dependency-injection-demys.html 设计模式展开. | ||
|
||
bq. 最简单地, 依赖注入是为对象提供实例变量或属性的行为. 当你传递一个变量到一个类的构造函数, 你在使用依赖注入. 当你设置一个类的属性, 你在使用依赖注入. 如果你不是使用严格的过程或线性方式编写AS3, 很可能你现在就在使用依赖注入。 | ||
|
||
Robotlegs 使用基于元数据的自动依赖注入. 这是为了方便开发而提供, 而且在排布应用程序并提供类和它所需要的依赖时,可以减少很多代码量. 虽然完全可以手动提供这些依赖, 但是允许框架来履行这些职责可以减少出错的机会,并且通常可以加快编码进程。. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
h2(#usingtheinjectors). 使用 Injectors | ||
Robotlegs 采用一种适配器(adapter)机制来为框架提供依赖注入机制. 默认地, 框架配备了 "SwiftSuspenders":http://github.com/tschneidereit/SwiftSuspenders 注入/反射库来适合这个要求. 另有 SmartyPants-IoC 和 Spring Actionscript 的适配器可以使用. 可能有潜在的特定需求来使用其它的依赖注入适配器, 但是如果没有特别的理由, 建议使用默认的 "SwiftSuspenders":http://github.com/tschneidereit/SwiftSuspenders, 因为它为 Robotlegs 做了一些特别调整. | ||
h3(#injectionsyntax). SwiftSuspenders 适配器注入语法 | ||
SwiftSuspenders 支持三种类型的依赖注入 | ||
* 属性(域)注入 | ||
* 参数(方法/设值) 注入 | ||
* 构造注入 | ||
鉴于此文档的目的, 我们将特别介绍属性注入, 以及在 Robotlegs 里如何使用. 将属性注入类有两种选择. 你可以使用未命名,或命名的注入: | ||
<pre>[Inject] | ||
public var myDependency:Depedency; //未命名注入</pre> | ||
<pre>[Inject(name="myNamedDependency")] | ||
public var myNamedDependency:NamedDepedency; //命名注入</pre> | ||
Robotlegs 里三处提供了注入映射. MediatorMap, CommandMap, 和直接通过 Injector . MediatorMap 和 CommandMap 也都是使用 Injector, 但它们同时做了一些各自层(tier)所需要的额外工作. 顾名思义, MediatorMap 用来映射 Mediator, CommandMap 用来映射 Command, 其它所有需要被注入的内容 (包括但不限于 Model) 都要直接使用 Injector 映射. | ||
h2(#usingtheinjectors). 使用 Injectors | ||
|
||
Robotlegs 采用一种适配器(adapter)机制来为框架提供依赖注入机制. 默认地, 框架配备了 "SwiftSuspenders":http://github.com/tschneidereit/SwiftSuspenders 注入/反射库来适合这个要求. 另有 SmartyPants-IoC 和 Spring Actionscript 的适配器可以使用. 可能有潜在的特定需求来使用其它的依赖注入适配器, 但是如果没有特别的理由, 建议使用默认的 "SwiftSuspenders":http://github.com/tschneidereit/SwiftSuspenders, 因为它为 Robotlegs 做了一些特别调整. | ||
|
||
h3(#injectionsyntax). SwiftSuspenders 适配器注入语法 | ||
|
||
SwiftSuspenders 支持三种类型的依赖注入 | ||
|
||
* 属性(域)注入 | ||
* 参数(方法/设值) 注入 | ||
* 构造注入 | ||
|
||
鉴于此文档的目的, 我们将特别介绍属性注入, 以及在 Robotlegs 里如何使用. 将属性注入类有两种选择. 你可以使用未命名,或命名的注入: | ||
|
||
<pre>[Inject] | ||
public var myDependency:Depedency; //未命名注入</pre> | ||
|
||
<pre>[Inject(name="myNamedDependency")] | ||
public var myNamedDependency:NamedDepedency; //命名注入</pre> | ||
|
||
Robotlegs 里三处提供了注入映射. MediatorMap, CommandMap, 和直接通过 Injector . MediatorMap 和 CommandMap 也都是使用 Injector, 但它们同时做了一些各自层(tier)所需要的额外工作. 顾名思义, MediatorMap 用来映射 Mediator, CommandMap 用来映射 Command, 其它所有需要被注入的内容 (包括但不限于 Model) 都要直接使用 Injector 映射. | ||
|
Oops, something went wrong.