Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

关于书写习惯&约束的始末 #52

Open
nuysoft opened this issue Mar 18, 2013 · 4 comments
Open

关于书写习惯&约束的始末 #52

nuysoft opened this issue Mar 18, 2013 · 4 comments

Comments

@nuysoft
Copy link
Member

nuysoft commented Mar 18, 2013

ATTRS 配置项、EVENTS 事件绑定机制、METHODS 公共方法、FIRES 自定义事件、RENDERDERS 自定义事件,形成以上书写习惯&约束的初衷是什么,是否源于为了解决某个问题(继承?)还是为了抽象和封装?一直不理解这种写法的始末,求扫盲。

@bandon
Copy link

bandon commented Mar 18, 2013

统一构造方法,快速构建前端组件。前端组件的控制基于html结构,发生开始于事件,事件调用公共方法;起源是事件处理统一,事件处理调用METHODS里可调用的需要的处理方法。

@keyapril
Copy link
Member

简单的几点就可以概括:统一代码风格、利于源码阅读、功能未实现,API先行。

@cyjake
Copy link
Member

cyjake commented Mar 19, 2013

我其实也不太明白这里的 EVENTS、METHODS、FIRES 和 RENDERERS 为啥要约束…… ATTRS 是 KISSY Base 的要求

@haitaojarvis
Copy link
Contributor

这点上, 我只支持波哥的: 在文档不够或要修改源码的时候, 这种约束能提供很大便利和帮助, 虽然写起来略讨厌...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants