窮小子

          MajorYe
          數據加載中……

          2008年4月18日

          端午過后

          posted @ 2008-06-09 21:20 MajorYe 閱讀(173) | 評論 (0)編輯 收藏
          Pattern & FrameWork

          1.什么是模式?

          模式,即pattern。其實就是解決某一類問題的方法論。你把解決某類問題的方法總結歸納到理論高度,那就是模式。

          Alexander給出的經典定義是:每個模式都描述了一個在我們的環境中不斷出現的問題,然后描述了該問題的解決方案的核心。通過這種方式,你可以無數次地使用那些已有的解決方案,無需在重復相同的工作。

          模式有不同的領域,建筑領域有建筑模式,軟件設計領域也有設計模式。當一個領域逐漸成熟的時候,自然會出現很多模式。

          什么是框架?

          框架,即framework。其實就是某種應用的半成品,就是一組組件,供你選用完成你自己的系統。簡單說就是使用別人搭好的舞臺,你來做表演。而且,框架一般是成熟的,不斷升級的軟件。

          2.為什么要用模式?

          因為模式是一種指導,在一個良好的指導下,有助于你完成任務,有助于你作出一個優良的設計方案,達到事半功倍的效果。而且會得到解決問題的最佳辦法。

          為什么要用框架?

          因為軟件系統發展到今天已經很復雜了,特別是服務器端軟件,設計到的知識,內容,問題太多。在某些方面使用別人成熟的框架,就相當于讓別人幫你完成一些基礎工作,你只需要集中精力完成系統的業務邏輯設計。而且框架一般是成熟,穩健的,他可以處理系統很多細節問題,比如,事物處理,安全性,數據流控制等問題。還有框架一般都經過很多人使用,所以結構很好,所以擴展性也很好,而且它是不斷升級的,你可以直接享受別人升級代碼帶來的好處。

          框架一般處在低層應用平臺(如J2EE)和高層業務邏輯之間的中間層。

          軟件為什么要分層?

          為了實現“高內聚、低耦合”。把問題劃分開來各個解決,易于控制,易于延展,易于分配資源…總之好處很多啦:)。

          3.以下所述主要是JAVA,J2EE方面的模式和框架:

          常見的設計模式有什么?

          首先,你要了解的是GOF的《設計模式--可復用面向對象軟件的基礎》一書(這個可以說是程序員必備的了),注意:GOF不是一個人,而是指四個人。它的原意是Gangs Of Four,就是“四人幫”,就是指此書的四個作者:Erich Gamma,Richard Helm,Ralph Johnson,John Vlissides。這本書講了23種主要的模式,包括:抽象工廠、適配器、外觀模式等。

          還有其他的很多模式,估計有100多種。

          軟件設計模式太多,就我的理解簡單說一下最常見的MVC模式。

          MVC模式是1996年由Buschmann提出的:

          模型(Model):就是封裝數據和所有基于對這些數據的操作。

          視圖(View):就是封裝的是對數據顯示,即用戶界面。

          控制器(Control):就是封裝外界作用于模型的操作和對數據流向的控制等。

          另外:

          RUP(Rational Unified Process)軟件統一過程,XP(Extreme Programming)極端編程,這些通常被叫做“過程方法”,是一種軟件項目實施過程的方法論,它是針對軟件項目的實施過程提出的方法策略。也是另一個角度的模式。

          posted @ 2008-05-03 11:58 MajorYe 閱讀(169) | 評論 (0)編輯 收藏
          object.property與object["property"]的區別

          剛吃完飯,也沒啥事干,來寫寫blog吧
          也許就像你看到的那樣,我寫的東西是比較偏的
          先來舉個例子吧:
          >>> var person=function(){}
          >>> person.aa="aa"
          "aa"
          >>> person.bb="bb"
          "bb"
          >>> person.cc="cc"
          "cc"
          上面是定義了一個person類
          給這個類添加了幾個類屬性
          你單獨運行

          >>> person.cc
          "cc"
          那是沒問題的
          但是你在程序中寫就有問題了,
          看看下面的程序:
          for(var t in person){
          alert(t);
          alert(person.t)  //為什么這個就有問題呢,結果為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.
          還沒寫完,待我醒來再細說!

          posted @ 2008-04-21 12:19 MajorYe 閱讀(382) | 評論 (1)編輯 收藏
          祝復試成功

          晚上和位不認識的朋友通話了
          第一次
          還聊的很投機,
          第一次
          我今天晚上把頭發剪短了
          第一次
          兩個人對金錢的看法很相像
          第一次
          這么多第一次說明了什么
                --------有緣
          祝我有緣的朋友復試成功!

          posted @ 2008-04-18 23:30 MajorYe 閱讀(184) | 評論 (0)編輯 收藏
          Prototype的一些新的見解(JS)

          對于為什么要使用prototype來實現繼承,我就不說了,網上很多
          下面主要是我對于prototype的一些見解:
          // 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(){}
          >>> pp.prototype.p="33"
          "33"
          >>> var t=new pp()
          >>> tt.p
          tt is not defined
          [Break on this error] undefined
          javascript: with ... (line 1)
          >>> t.p
          "33"
          >>> t.p="44"
          "44"
          >>> t.p
          "44"
          >>> var tt=new pp()
          >>> tt.p
          "33"
          >>> pp.prototype.constructor
          pp()
          >>> tt.constructor
          pp()
          >>> tt.prototype.constructor
          tt.prototype has no properties
          [Break on this error] undefined
          javascript: with ... (line 1)
          >>> tt.prototype.oo="22"
          tt.prototype has no properties
          [Break on this error] undefined
          javascript: with ... (line 1)
          >>> "p" in tt
          true
          >>> tt.hasOwnProperty
          hasOwnProperty()
          >>> tt.hasOwnProperty("p")
          false
          >>> tt.tt=0
          0
          >>> tt.hasOwnProperty("tt")
          true
          //從我的firebug調試中你能看出來嗎?嘿嘿

          posted @ 2008-04-18 11:25 MajorYe 閱讀(203) | 評論 (0)編輯 收藏
          08-04-18英語學習總結

          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. 產生, 導致, 發生

          4:

          bespoke [be·spoke || b?'sp??k]

          adj. 預定的; 定制的

          bespeak [be·speak || b?'spi?k]

          v.                  預定; 證明; 預約; 表示

          5: ado

          ado [a·do || ?'du?]

          n. 紛擾, 騷擾; 費力, 麻煩; 忙亂; 無謂的紛擾

          6effect

          effect [ef·fect || ?'fekt]

          n. 結果, 效果, 影響

          v. 造成; 招致; 產生; 實現, 達到

          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. 妥協, 折衷案, 折衷

          v. 互讓解決; 放棄; 連累, 危及; 泄露; 妥協, 讓步

          11: inefficient

          inefficient [,inef'fi·cient || ‚?n?'f??nt]

          adj. 無效率的, 無能的

          12: efficient

          efficient [ef'fi·cient || -nt]

          adj. 生效的; 能干的; 有效率的

          posted @ 2008-04-18 09:14 MajorYe 閱讀(466) | 評論 (0)編輯 收藏
          畢業后,有關的檔案和戶口問題

          自從從上家公司跳槽之后
          戶口和檔案問題一直困擾著我,
          當然,如果我還在天津工作的話
          應該是沒什么問題
          可我現在來到了北京
          一個戶口很緊張的城市
          而且我又不是研究生
          所以落戶口是根本沒希望的
          但是如果這些落不了
          那有關的五險一金怎么辦
          煩煩煩煩煩
          昨天HR和我說
          公司對于你們這樣的
          有特批
          也就是說什么都能上
          哈哈哈哈哈哈哈哈哈
          開心

          posted @ 2008-04-18 08:48 MajorYe 閱讀(195) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 永嘉县| 蒙城县| 庆元县| 汉中市| 盐池县| 贵溪市| 通江县| 怀安县| 万安县| 罗田县| 正宁县| 抚顺市| 德格县| 交城县| 高阳县| 黔南| 邯郸市| 昌图县| 绍兴县| 南汇区| 鄂温| 林西县| 达孜县| 长寿区| 扬州市| 静安区| 泾源县| 泸溪县| 乐平市| 民勤县| 五莲县| 运城市| 绥阳县| 沁水县| 东明县| 夏河县| 芷江| 杭州市| 武夷山市| 得荣县| 都匀市|