Create Advanced Web Applications With Object-Oriented Techniques--JavaScript

JAVASCRIPT
Create Advanced Web Applications With Object-Oriented Techniques

-----------中文翻译(我翻的,翻译的不好不要见笑了)

  最近我接见了一位已经有5年从事网络程序开发的开发者。她已经使用javascript脚本4年半的样子,她认为她的javascript脚本

技能已经非常好了,但过了一会我就发现,她实质知道确实很少--我没有责备她的意思。JavaScript 的方式确实有趣,它让我们自

我觉得这个语言是非常简单,像之前的C/C++/C# 语言一样容易掌握(包括我自己,直到最近还这么认为)。

  从另一方面,这种觉得并不是完全没有理由的。使用它做一些简单的事确实不费力气。入门的门槛也很低--当你开始写这种代码的

时候,它不要求你懂得很多相关的东西。就算不是程序员也可以使用它写出一些能在主页上使用的脚本。
 
  真的,直到最近,我获得Javascript技能的途径止限于MSDN、DHTML参考书、C++/C# 的经验资料。当我开始使用Ajax进行真实的
开发的时候,才认识到我的Javascript技能是很缺乏的。复杂和多样性的新Web应用程序需要一种完全不同的方法来写Javascript代
码。这些是真正的Javascript应用程序!我未曾这样在我的小程序里面写,真不知道从哪里开始cut它那好脚本。
 
  OOP--面向对象编程是一种流行的方法,Javascript使用这个方法可以使Javascript类库更加易于管理和维护。Javascript支持
OOP,但它的使用方法跟流行的MicroSoft.NET 框架包含的C++、C# 、Visual Basic不同,以至一些开发人员第一次广泛的使用它
的时候觉得很怪异和诧异。我写这个文章的目的就是探讨如何让你们真正认识到javascript的OOP设计和如何有效的使用OO进行
Javascript的开发。Let 's Go. 一起讨论它。

----------原文在这里

Recently I interviewed a software developer with five years experience in developing Web applications. She’d been doing
JavaScript for four and a half years, she rated her JavaScript skill as very good, and—as I found out soon after—she
actually knew very little about JavaScript. I didn’t really blame her for that, though. JavaScript is funny that way. It’s the
language a lot of people (including myself, until recently!) assume they’re good at, just because they know C/C++/C# or
they have some prior programming experience.
In a way, that assumption is not entirely groundless. It is easy to do simple things with JavaScript. The barrier to entry is
very low; the language is forgiving and doesn’t require you to know a lot of things before you can start coding in it. Even a
non-programmer can probably pick it up and write some useful scripts for a homepage in a matter of hours.
Indeed, until recently, I’d always been able to get by with whatever little JavaScript I knew, armed only with the MSDN®
DHTML reference and my C++/C# experience. It was only when I started working on real-world AJAX applications that I
realized how inadequate my JavaScript actually was. The complexity and interactivity of this new generation of Web
applications requires a totally different approach to writing JavaScript code. These are serious JavaScript applications! The way
we’ve been writing our throwaway scripts simply doesn’t cut it anymore.
Object-oriented programming (OOP) is one popular approach that’s used in many JavaScript libraries to make a codebase
more manageable and maintainable. JavaScript supports OOP, but it does so in a very different manner from the way popular
Microsoft® .NET Framework compliant languages like C++, C#, or Visual Basic® do it, so developers who have been working
extensively with those languages may find doing OOP in JavaScript strange and counter-intuitive at first. I wrote this article to
discuss in depth how the JavaScript language really supports object-oriented programming and how you can use this support
to do object-oriented development effectively in JavaScript. Let’s start by talking about (what else?) objects.

Published Wednesday, November 28, 2007 5:33 PM by jawance
Filed under:

Comments

# re: Create Advanced Web Applications With Object-Oriented Techniques--JavaScript

Monday, December 03, 2007 12:12 AM by Coolboy

很强啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!