??xml version="1.0" encoding="utf-8" standalone="yes"?> The important difference to note between these two syntaxes is that in the first, the property name is an identifier, and in the second, the property name is a string. You'll see why this is so important shortly. In C, C++, Java, and similar strongly typed languages, an object can have only a fixed number of properties, and the names of these properties must be defined in advance. Since JavaScript is a loosely typed language, this rule does not apply: a program can create any number of properties in any object. When you use the . operator to access a property of an object, however, the name of the property is expressed as an identifier. Identifiers must be typed literally into your JavaScript program; they are not a datatype, so they cannot be manipulated by the program. On the other hand, when you access a property of an object with the [] array notation, the name of the property is expressed as a string. Strings are JavaScript datatypes, so they can be manipulated and created while a program is running.
]]>
模式Q即pattern。其实就是解x一c问题的Ҏ论。你把解xc问题的Ҏȝ归纳到理论高度,那就是模式?
Alexanderl出的经典定义是Q每个模式都描述了一个在我们的环境中不断出现的问题,然后描述了该问题的解x案的核心。通过q种方式Q你可以无数ơ地使用那些已有的解x案,无需在重复相同的工作?
模式有不同的领域Q徏{领域有建筑模式QY件设计领域也有设计模式。当一个领域逐渐成熟的时候,自然会出现很多模式?
什么是框架Q?
框架Q即framework。其实就是某U应用的半成品,是一l组Ӟ供你选用完成你自qpȝ。简单说是使用别h搭好的舞収ͼ你来做表演。而且Q框架一般是成熟的,不断升的Y件?
2Qؓ什么要用模式?
因ؓ模式是一U指|在一个良好的指导下,有助于你完成dQ有助于你作Z个优良的设计ҎQ达C半功倍的效果。而且会得到解决问题的最佛_法?
Z么要用框Ӟ
因ؓ软gpȝ发展C天已l很复杂了,特别是服务器端YӞ设计到的知识Q内容,问题太多。在某些斚w使用别h成熟的框Ӟq当于让别人帮你完成一些基工作Q你只需要集中精力完成系l的业务逻辑设计。而且框架一般是成熟Q稳健的Q他可以处理pȝ很多l节问题Q比如,事物处理Q安全性,数据控制等问题。还有框架一般都l过很多Z用,所以结构很好,所以扩展性也很好Q而且它是不断升的,你可以直接n受别人升U代码带来的好处?
框架一般处在低层应用^収ͼ如J2EEQ和高层业务逻辑之间的中间层?
软gZ么要分层Q?
Z实现“高内聚、低耦合”。把问题划分开来各个解冻I易于控制Q易于g展,易于分配资源…M好处很多啦:Q?
3Q以下所qC要是JAVAQJ2EE斚w的模式和框架Q?
常见的设计模式有什么?
首先Q你要了解的是GOF的《设计模?-可复用面向对象Y件的基础》一书(q个可以说是E序员必备的了)Q注意:GOF不是一个hQ而是指四个h。它的原意是Gangs Of Four,是“四h?#8221;Q就是指此书的四个作者:Erich Gamma,Richard HelmQRalph Johnson,John Vlissides。这本书讲了23U主要的模式Q包括:抽象工厂、适配器、外观模式等?
q有其他的很多模式,估计?00多种?
软g设计模式太多Q就我的理解单说一下最常见的MVC模式?
MVC模式?996q由Buschmann提出的:
模型QModelQ:是装数据和所有基于对q些数据的操作?
视图QViewQ:是装的是Ҏ据显C,即用L面?
控制器(ControlQ:是装外界作用于模型的操作和对数据向的控制等?
另外Q?
RUPQRational Unified ProcessQY件统一q程Q?span style="color: red">XPQExtreme ProgrammingQ极端编E?/span>Q这些通常被叫?#8220;q程Ҏ”Q是一UY仉目实施过E的Ҏ论,它是针对软g目的实施过E提出的Ҏ{略。也是另一个角度的模式?
]]>
>>> var person=function(){}
>>> person.aa="aa"
"aa"
>>> person.bb="bb"
"bb"
>>> person.cc="cc"
"cc"
上面是定义了一个personc?br />
l这个类d了几个类属?br />
你单独运?br />
>>> person.cc
"cc"
那是没问题的
但是你在E序中写有问题了,
看看下面的程序:
for(var t in person){
alert(t);
alert(person.t) //Z么这个就有问题呢Q结果ؓundefined
}
但该?br />
for(var t in person){
alert(t);
alert(person.[t]) //q样可以了
}
Z么呢Q?Q?
q没写完Q待我醒来再l说Q?/p>
W一?br />
q么多第一ơ说明了什?br />
--------有缘
我有缘的朋友复试成功!
var r = new Rectangle(2, 3); r.hasOwnProperty("width"); // true: width is a direct property of r r.hasOwnProperty("area"); // false: area is an inherited property of r "area" in r; // true: "area" is a property of r>>> function pp(){}
delve a little into the history of how it came to be like that
delve [delv]
v. 探究, ȝ; ?/span>, ?/span>; 搜烦; ?/span>, ?/span>; ?/span>
2: sooner or later
3: generated
we first need to remind ourselves why XML has proved such a success and generated so much excitement.
generate [gen·er·ate || 'dʒenəreɪt]
v. 产生, D, 发生
4:
bespoke [be·spoke || bɪ'spəʊk]
adj. 预定?/span>; 定制?/span>
bespeak [be·speak || bɪ'spiːk]
v. 预定; 证明; 预约; 表示
5: ado
ado [a·do || ə'duː]
n. Uh, 骚扰; 费力, ȝ; 忙ؕ; 无谓的纷?/span>
6Q?/span>effect
effect [ef·fect || ɪ'fekt]
n. l果, 效果, 影响
v. 造成; 招致; 产生; 实现, 辑ֈ
7: bewildering
Don't worry if this example seemed a bit bewildering
bewilder [be·wil·der || bɪ'wɪldə]
v. 使迷?/span>; 使昏?/span>; 使不知所?/span>
8: minimizes
This minimizes the work that needs to be done at display time and is ideal when the same displayed page is presented to very many users.
minimize (Amer.) ['min·i·mize || 'mɪnɪmaɪz]
v. ?/span>...减到最?/span>
9:occasionally
It's occasionally useful to have a stylesheet as the input or output of a transformation.
occasionally [oc'ca·sion·al·ly || ə'keɪʒnəlɪ]
adv. 偶尔, 间或
10: compromise
The xhtml output method, as one might expect, is a compromise between the xml and html output methods
compromise [com·pro·mise || 'kɒmprəmaɪz]
n. 妥协, 折衷?/span>, 折衷
v. 互让解决; 攑ּ; q篏, 危及; 泄露; 妥协, 让步
11: inefficient
inefficient [,inef'fi·cient || ‚ɪnɪ'fɪʃnt]
adj. 无效率的, 无能?/span>
12: efficient
efficient [ef'fi·cient || -nt]
adj. 生效?/span>; 能干?/span>; 有效率的