We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
必须提供一个反遮阳篷;)尽管喜欢看到大型项目也使用它(如果有的话)。我自己很喜欢 Object.create 并且更喜欢它,尽管我从来没有能够在大型项目中广泛使用它,也不觉得它应该如此。
OO 开发者沉迷于“新”操作符,这是一个很难改掉的习惯,而且一看就很容易理解。以经典方式编写的代码现在更容易移交给下一个开发人员,这已经是反对 Object.create 的有力论据。
ES5(下一个 JS 版本)中的 Object.create 功能更加强大,并且与 ES3(当前 JS 版本)中作为填充程序的 Object.create 截然不同。因此,最好避免将 Object.create(目前可用)作为大型项目中广泛使用的策略,因为当 ES5 成为主流时,它的工作方式将与现在可实现的不同。
大型项目都会使用框架(当你没有流氓 JS“忍者”时,他们坚持从头开始编写所有内容,一遍又一遍地重新发明轮子),并且所有流行的框架都以经典方式促进原型继承。他们可能有一个以 .clone() 或其他形式出现的 Object.create 方法,但它在有关对象继承和子类化的教程和文档中被掩盖了。
ES3 中的 Object.create 无法实现私有属性。我对 Object.create 摆弄得越多,遇到的问题就越多……
我对 Object.create 摆弄了很多,甚至围绕它编写了一个名为“Objection”的小框架(如果如果你有兴趣,你会找到它;)尽管不要链接到 github)和“JSoo”(已停产)。就大型项目的人力资源而言,它太滑稽、未完成和进步,无法成为主流和可维护的。我建议在作为支持者的同时反对它。
Have to offer an anti-awnser ;) though like to see big projects using it as well (if there are any). I love Object.create myself and prefer it, though I've never been able to use it widely in a big project nor feel it should be.
OO Developers are addicted to the 'new' operator, it's a hard habbit to get rid off and easy to understand at a glance. Code written in a classical way is right now easier to hand over to the next dev, which already is a strong arguement against Object.create.
Object.create in ES5 (the next JS version) is immensly more powerful and drastically different from Object.create as a shim in ES3 (current JS version). For this reason it's better to avoid Object.create (as is available right now) as a widely used strategy in big projects as it will work differently when ES5 becomes mainstream than is implementable right now.
Big projects make use of frameworks (when you don't have rogue JS 'ninjas' who insist on writing everything from scratch reinventing the wheel over and over again) and all popular frameworks promote prototypical inheritance the classical way. They might have an Object.create method somehwere in the form of .clone() or something, but it's obscured from the tutorials and documentation in respect to object inheritance and subclassing.
Private properties are impossible with Object.create in ES3. I came across more issues the more I fiddled around with Object.create and boy have I fiddled around with it...
I've played around a lot with Object.create and even written a tiny framework around it called 'Objection' (if yer interrested, you'll find it ;) though refraining from linking to github) and 'JSoo' (discontinued). It's just too zany, unfinished and progressive to become mainstream and maintainable in terms of human resources for big projects. I recommend against it whilst being a supporter.
您可以在这里找到它 适用于 Visual Studio 的诺基亚 WRT 插件 ,诺基亚小部件开发人员的插件。
来自诺基亚论坛:
You can find it here Nokia WRT Plug-in for Visual Studio , a plugin for nokia widget developer.
From nokia forum:
尝试:http://showroom.auction123.com/auction123/index.html
我们根本不使用 new...我们只是设置函数的结果并将其用作类。
例如:
最终的回报只是告诉什么将被公开。
通过执行以下操作来实例化它:
try: http://showroom.auction123.com/auction123/index.html
We don't use new at all... We simply set the result of a function and use that as a class.
For example:
The final return just tells what's going to be public.
Instantiate it by doing: