原文: http://qooxdoo.org/documentation/0.8/oo_introduction
Introduction to Object Orientation
面向对象介绍
qooxdoo allows you to easily leverage many key concepts of object-oriented programming without bothering about limited native support in JavaScript.
qooxdoo让你很容易的利用许多面向对象编程的关键概念而不用为js有限的原生支持而烦恼
The main actors of qooxdoo OO are:
*
Classes
*
Interfaces
*
Mixins
When trying to get a grip of the framework code, you should probably understand all those three concepts. As a regular application developer you often get by just knowing how to use classes.
当尝试了解框架代码时,你可能会不理解这三个概念,但作为一个常规应用程序的开发者你通常仅需要知道如何使用这些类。
Classes
A “class” is a central concept in most object-oriented languages, and as a programmer you are certainly familiar with it. qooxdoo supports a “closed form” of class declaration, i.e. the entire declaration is provided within a qx.Class.define(name, config) statement, where name is the fully-qualified class name, and config is a configuration map with various keys (or “sections”).
"类"在面向对象的语言里是一个核心概念,作为一个程序员你当然非常熟悉,qooxdoo支持一种"关闭形式"的类声明
,即所有声明都由 qx.Class.define(name,config)来提供,其中参数name是完全限定类名(类名包含其完整命名空间),config是一个具有多个可选key的配置表(或者称为配置节点)
There are several types of classes available, which are specified by the type key within the config map:
*
regular class:常规类
May contain class variables/methods (in a statics section) and instance variables/methods (in a members section). An instance of the class can be created using the new keyword, so a constructor needs to be given in construct.
*
static class:静态类
Only contains class variables and class methods. Often a helper or utility class. Use type : “static”.
*
abstract class:抽象类
Does not allow an instance to be created. Typically classes derive from it and provide concrete implementations. type is abstract.
*
singleton:单例类
Not more than a single instance of the class may exists at any time. A static method getInstance() returns the instance. Use type : “singleton”.
Interfaces
qooxdoo’s interfaces are similar to the ones in Java. Similar to the declaration of class they are created by qx.Interface.define(name, config). They specify an “interface” (typically a set of empty methods), that classes must implement.
qooxdoo的接口和java中的相似, 相似之处在于声明(qooxdoo中由qx.Interfaces.define(name, config)来声明class的interface)。它们指定一个接口(由空方法组成的集合),该类就必须实现
Mixins
Mixins are a very practical concept that not all programming languages provide. Unlike interfaces, which require a class to provide concrete implementations to fulfill the interface contract, mixins do include code. This code needs to be generic, if it is “mixed into” different existing classes. Mixins usually cover only a single aspect of functionality and therefore tend to be small. They are declared by qx.Mixin.define(name, config).
Mixins是一个非常有用的概念,但不是所有语言都支持。不同于接口需要类为接口的契约提供具体的实现,Mixins包含代码,如果这些代码被"mixed into"到不同的已存在的类,它们需要一般化(并入Mixin的类)。
Mixins通常仅能覆盖某一方面功能,因此趋于小巧,它们由qx.Mixin.define(name, config)定义。
Inheritance
Like most programming languages qooxdoo only supports single-inheritance for classes, not multiple-inheritance, i.e. a class can only derive directly from a single super class. This is easily modeled by the extend key in the class declaration map.
和大多数语言一样,qooxdoo仅支持类的单继承,而非多继承,即
Since a class may implement/include one or many interfaces/mixins, which themselves can extend others, some advanced forms of multiple-inheritance could be realized.
具有可继承性的类可以 实现或包含 一个或更多 接口或mixins 来达到多继承的效果 。
分享到:
相关推荐
前端开源库-qooxdoo-sdkQooxdoo SDK,面向编码人员的JS框架
qooxdoo 2.0.1 开发包,就算不会HTML也可以轻松开发完美流畅的动态页面应用,就如同开发PC软件,完全面向对象,会JavaScript 就OK
将不建议使用npm模块qx-cli ,从现在开始,您要做的所有事情是: $ npm install -g qooxdoo-compiler$ qx create myapp$ cd myapp$ qx compile不要忘记,如果您以前安装过qx-cli ,则必须发出以下命令: $ npm ...
Qooxdoo-Compiler是Qooxdoo( )应用程序的新编译器和命令行界面,使用100%Node.JS Javascript编写,它在标准python生成器上进行了以下关键改进: 包括Babel,用于将ES6添加到所有Qooxdoo应用程序中 快速(最快24...
qooxdoo-contrib是qooxdoo项目(http://qooxdoo.org)的组成部分。 用户可以在简洁的结构中灵活地开发,维护和促进贡献。 贡献可以轻松地集成到自定义qooxdoo应用程序中。 注意:SourceForge上的此存储库是旧版! 它...
通过其面向对象的编程模型,您可以构建丰富的交互式应用程序(RIA),用于移动设备的类似于本机的应用程序,轻量级的传统Web应用程序,甚至可以在浏览器外部运行的应用程序。 您可以利用其集成的工具链来开发和部署...
qooxdoo框架的快速应用程序开发。 您可以拖放组件,定义属性并生成源代码。
前端项目-qooxdoo,Universal JavaScript Framework
qooxdoo的官方文档,详细介绍了如何入门qx.英文版的.建议多读英文原版,因为有些不错的技术不一定会及时的出汉化的。
qooxdoo sdk 1.0开源AJAX框架之qooxdoo之SDK
利用面向对象的JavaScript允许开发令人印象深刻的跨浏览器的应用。没有HTML,CSS知识,也不是必要的。它包括一个独立于平台的开发工具链,一个最先进的图形用户界面工具和先进的客户端与服务器之间的通讯层。
语言:English (United ...扩展开发人员工具,添加显示与所选DOM元素关联的QooxDoo数据的侧栏。 扩展开发人员工具,添加一个侧栏,显示与所选相关联的Qooxdoo数据。 DOM元素。 在控制台中使用$ q使用所选窗口小部件。
一个面像对象的富客户端的js开发框架。这里做一个备份,供大家加快下载速度
qooxdoo是一个通用JavaScript框架,用于为各种平台创建应用程序。 它具有全面的功能集,包括面向对象的编程模型,集成的工具链和最新的GUI工具包。
扩展开发工具,添加一个侧栏,显示与所选DOM元素相关联的Qooxdoo数据。 扩展开发人员工具,添加侧边栏,以显示与所选DOM元素关联的Qooxdoo数据。 在控制台中使用$ q与选定的小部件一起使用。 支持语言:English ...
Spring MVC和Qooxdoo
利用面向对象的JavaScript允许开发令人印象深刻的跨浏览器的应用。没有HTML,CSS知识,也不是必要的。它包括一个独立于平台的开发工具链,一个最先进的图形用户界面工具和先进的客户端与服务器之间的通讯层。
qooxdoo开发框架的界面可视化设计器
为了加快qooxdoo窗口的设计,我使用delphi做一个简单的转换程序,使用它可以将delphi窗体转换为qooxdoo窗口布局文件。
这个是Qooxdoo1.3版本的SDK压缩包