端午過(guò)后
1.什么是模式?
模式,即pattern。其實(shí)就是解決某一類(lèi)問(wèn)題的方法論。你把解決某類(lèi)問(wèn)題的方法總結(jié)歸納到理論高度,那就是模式。
Alexander給出的經(jīng)典定義是:每個(gè)模式都描述了一個(gè)在我們的環(huán)境中不斷出現(xiàn)的問(wèn)題,然后描述了該問(wèn)題的解決方案的核心。通過(guò)這種方式,你可以無(wú)數(shù)次地使用那些已有的解決方案,無(wú)需在重復(fù)相同的工作。
模式有不同的領(lǐng)域,建筑領(lǐng)域有建筑模式,軟件設(shè)計(jì)領(lǐng)域也有設(shè)計(jì)模式。當(dāng)一個(gè)領(lǐng)域逐漸成熟的時(shí)候,自然會(huì)出現(xiàn)很多模式。
什么是框架?
框架,即framework。其實(shí)就是某種應(yīng)用的半成品,就是一組組件,供你選用完成你自己的系統(tǒng)。簡(jiǎn)單說(shuō)就是使用別人搭好的舞臺(tái),你來(lái)做表演。而且,框架一般是成熟的,不斷升級(jí)的軟件。
2.為什么要用模式?
因?yàn)槟J绞且环N指導(dǎo),在一個(gè)良好的指導(dǎo)下,有助于你完成任務(wù),有助于你作出一個(gè)優(yōu)良的設(shè)計(jì)方案,達(dá)到事半功倍的效果。而且會(huì)得到解決問(wèn)題的最佳辦法。
為什么要用框架?
因?yàn)檐浖到y(tǒng)發(fā)展到今天已經(jīng)很復(fù)雜了,特別是服務(wù)器端軟件,設(shè)計(jì)到的知識(shí),內(nèi)容,問(wèn)題太多。在某些方面使用別人成熟的框架,就相當(dāng)于讓別人幫你完成一些基礎(chǔ)工作,你只需要集中精力完成系統(tǒng)的業(yè)務(wù)邏輯設(shè)計(jì)。而且框架一般是成熟,穩(wěn)健的,他可以處理系統(tǒng)很多細(xì)節(jié)問(wèn)題,比如,事物處理,安全性,數(shù)據(jù)流控制等問(wèn)題。還有框架一般都經(jīng)過(guò)很多人使用,所以結(jié)構(gòu)很好,所以擴(kuò)展性也很好,而且它是不斷升級(jí)的,你可以直接享受別人升級(jí)代碼帶來(lái)的好處。
框架一般處在低層應(yīng)用平臺(tái)(如J2EE)和高層業(yè)務(wù)邏輯之間的中間層。
軟件為什么要分層?
為了實(shí)現(xiàn)“高內(nèi)聚、低耦合”。把問(wèn)題劃分開(kāi)來(lái)各個(gè)解決,易于控制,易于延展,易于分配資源…總之好處很多啦:)。
3.以下所述主要是JAVA,J2EE方面的模式和框架:
常見(jiàn)的設(shè)計(jì)模式有什么?
首先,你要了解的是GOF的《設(shè)計(jì)模式--可復(fù)用面向?qū)ο筌浖幕A(chǔ)》一書(shū)(這個(gè)可以說(shuō)是程序員必備的了),注意:GOF不是一個(gè)人,而是指四個(gè)人。它的原意是Gangs Of Four,就是“四人幫”,就是指此書(shū)的四個(gè)作者:Erich Gamma,Richard Helm,Ralph Johnson,John Vlissides。這本書(shū)講了23種主要的模式,包括:抽象工廠、適配器、外觀模式等。
還有其他的很多模式,估計(jì)有100多種。
軟件設(shè)計(jì)模式太多,就我的理解簡(jiǎn)單說(shuō)一下最常見(jiàn)的MVC模式。
MVC模式是1996年由Buschmann提出的:
模型(Model):就是封裝數(shù)據(jù)和所有基于對(duì)這些數(shù)據(jù)的操作。
視圖(View):就是封裝的是對(duì)數(shù)據(jù)顯示,即用戶界面。
控制器(Control):就是封裝外界作用于模型的操作和對(duì)數(shù)據(jù)流向的控制等。
另外:
RUP(Rational Unified Process)軟件統(tǒng)一過(guò)程,XP(Extreme Programming)極端編程,這些通常被叫做“過(guò)程方法”,是一種軟件項(xiàng)目實(shí)施過(guò)程的方法論,它是針對(duì)軟件項(xiàng)目的實(shí)施過(guò)程提出的方法策略。也是另一個(gè)角度的模式。
剛吃完飯,也沒(méi)啥事干,來(lái)寫(xiě)寫(xiě)blog吧
也許就像你看到的那樣,我寫(xiě)的東西是比較偏的
先來(lái)舉個(gè)例子吧:
>>> var person=function(){}
>>> person.aa="aa"
"aa"
>>> person.bb="bb"
"bb"
>>> person.cc="cc"
"cc"
上面是定義了一個(gè)person類(lèi)
給這個(gè)類(lèi)添加了幾個(gè)類(lèi)屬性
你單獨(dú)運(yùn)行
>>> person.cc
"cc"
那是沒(méi)問(wèn)題的
但是你在程序中寫(xiě)就有問(wèn)題了,
看看下面的程序:
for(var t in person){
alert(t);
alert(person.t) //為什么這個(gè)就有問(wèn)題呢,結(jié)果為undefined
}
但該為
for(var t in person){
alert(t);
alert(person.[t]) //這樣就可以了
}
為什么呢????
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.
還沒(méi)寫(xiě)完,待我醒來(lái)再細(xì)說(shuō)!
晚上和位不認(rèn)識(shí)的朋友通話了
第一次
還聊的很投機(jī),
第一次
我今天晚上把頭發(fā)剪短了
第一次
兩個(gè)人對(duì)金錢(qián)的看法很相像
第一次
這么多第一次說(shuō)明了什么
--------有緣
祝我有緣的朋友復(fù)試成功!
對(duì)于為什么要使用prototype來(lái)實(shí)現(xiàn)繼承,我就不說(shuō)了,網(wǎng)上很多
下面主要是我對(duì)于prototype的一些見(jiàn)解:
// The constructor function initializes those properties that
// will be different for each instance.
function Rectangle(w, h) {
this.width = w;
this.height = h;
}
// The prototype object holds methods and other properties that
// should be shared by each instance.
Rectangle.prototype.area = function( ) { return this.width * this.height; }
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(){}
1: delve
delve a little into the history of how it came to be like that
delve [delv]
v. 探究, 鉆研; 挖, 掘; 搜索; 挖, 掘; 刨
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. 產(chǎn)生, 導(dǎo)致, 發(fā)生
4:
bespoke [be·spoke || b?'sp??k]
adj. 預(yù)定的; 定制的
bespeak [be·speak || b?'spi?k]
v. 預(yù)定; 證明; 預(yù)約; 表示
5: ado
ado [a·do || ?'du?]
n. 紛擾, 騷擾; 費(fèi)力, 麻煩; 忙亂; 無(wú)謂的紛擾
6:effect
effect [ef·fect || ?'fekt]
n. 結(jié)果, 效果, 影響
v. 造成; 招致; 產(chǎn)生; 實(shí)現(xiàn), 達(dá)到
7: bewildering
Don't worry if this example seemed a bit bewildering
bewilder [be·wil·der || b?'w?ld?]
v. 使迷惑; 使昏亂; 使不知所措
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. 將...減到最少
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. 妥協(xié), 折衷案, 折衷
v. 互讓解決; 放棄; 連累, 危及; 泄露; 妥協(xié), 讓步
11: inefficient
inefficient [,inef'fi·cient || ‚?n?'f??nt]
adj. 無(wú)效率的, 無(wú)能的
12: efficient
efficient [ef'fi·cient || -nt]
adj. 生效的; 能干的; 有效率的
自從從上家公司跳槽之后
戶口和檔案問(wèn)題一直困擾著我,
當(dāng)然,如果我還在天津工作的話
應(yīng)該是沒(méi)什么問(wèn)題
可我現(xiàn)在來(lái)到了北京
一個(gè)戶口很緊張的城市
而且我又不是研究生
所以落戶口是根本沒(méi)希望的
但是如果這些落不了
那有關(guān)的五險(xiǎn)一金怎么辦
煩煩煩煩煩
昨天HR和我說(shuō)
公司對(duì)于你們這樣的
有特批
也就是說(shuō)什么都能上
哈哈哈哈哈哈哈哈哈
開(kāi)心
http://picasaweb.google.com/ye.zhouquan
Function()的特殊之處有三點(diǎn):
1: Function() constructor 它是允許js引擎動(dòng)態(tài)的去編譯和運(yùn)行,所以它很像全局的eval()。
【注】:可別小看這個(gè)eval(),它可是js的一個(gè)解釋器哦,嘿嘿!
2:正因?yàn)?nbsp;Function() constructor 是動(dòng)態(tài)的去創(chuàng)建函數(shù)體,因此它會(huì)比直接function定義函數(shù)要消耗資源,
特別在循環(huán)中不推薦使用
3:這點(diǎn)也是 Function() constructor 最重要的一點(diǎn), Function() constructor 創(chuàng)建的函數(shù)是全局的,而不是相
應(yīng)得scope里面的
eg:
var y = "global";
function constructFunction() {
var y = "local";
return new Function("return y"); // Does not capture the local scope!
}
// This line displays "global" because the function returned by the
// Function() constructor does not use the local scope. Had a function
// literal been used instead, this line would have displayed "local".
alert(constructFunction()()); // Displays "global"
這個(gè)周末生活比較豐富,當(dāng)然也沒(méi)學(xué)什么東西
周六是老鄉(xiāng)過(guò)來(lái),中午請(qǐng)他吃的飯,晚上吃完飯
再送他回去,周天中午請(qǐng)大學(xué)同學(xué)王林霞吃飯,
下午一塊去打球了,然后去她同學(xué)那打了會(huì)麻將。
晚上和她那些高中同學(xué)一塊吃了個(gè)飯。回來(lái)洗了個(gè)
澡,和老陳聊了會(huì)天。OVER.