Git Product home page Git Product logo

Comments (8)

otakustay avatar otakustay commented on July 22, 2024

私有成员

ER的作风是@Private的以下划线开始,@Protected的和普通的一样

个人比较喜欢仅通过注释标识,用下划线起头的多数是property,原因是可能出现同名的函数

集合类型

支持states这个提案,集合统一复数命名,以屏蔽集合的类型,正确来说,状态应该是个 Set 而非 Map 吧?

当然对于一些映射关系的东西,会叫xxxMapping,不过这里也是 Mapping 而非 Map ,个人觉得用xxxMap和匈牙利命名有点类似。

from esui.

otakustay avatar otakustay commented on July 22, 2024

既然说到这个,我在想 MapSet 要不要实现一下,以便未来接到ES6的2个原生类上面去

from esui.

errorrik avatar errorrik commented on July 22, 2024

集合类型

我也支持states

私有成员

_protected_的为什么和普通的一样?这是给子类用但不给控件使用者用的啊

Map 和 Set

貌似很遥远。ES6来了,我们还会用amd么?

from esui.

errorrik avatar errorrik commented on July 22, 2024

Map 和 Set

关键是,我们没有办法实现,因为有个method是delete,我擦,这东西是个关键字!

from esui.

otakustay avatar otakustay commented on July 22, 2024

protected问题

原因是,私有方法其实全都不在prototype上,都是在闭包里一个函数,然后用.call去调用,不暴露出来了。

唯独私有属性必须在对象上面,所以私有的只有属性,用下划线起头,所有方法都是正常的。

Map和Set

这蛋疼的事我知道,虽然可以['delete'](xxx),不过算了,我现在收回这想法了

from esui.

errorrik avatar errorrik commented on July 22, 2024

protected问题

比如,按规则生成dom id的方法,是createId还是_createId,这东西不能放闭包里不暴露出来的。当然,这个例子可以放lib里,但估计还有其他类似的东西

from esui.

otakustay avatar otakustay commented on July 22, 2024

这个东西就是 @Protected 的了,所以我的想法就是createId,真正的private method是不会暴出来的,暴出来且一定是private的肯定是property(其实也能不暴出来,但实现太蛋疼对吧),因此所有method统一不加下划线(好讨厌下划线)

然后,听更多人的意见吧

from esui.

errorrik avatar errorrik commented on July 22, 2024


这东西属于esui实现,不属于标准,不需要太多意见。你是ria的负责人,你定了就行

关了

from esui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.