原创 Defensive copying

A mutable object is simply an object which can change its state after const

原创 Java Immutable Class

Java Immutable Class[ From ]immutable object提供了極具價值的服務。由於他們保證自己的狀態從構建之後就一定

原创 Immutable objects

Immutable objects are simply objects whose state (the object's data) cannot

原创 Copy constructors

Copy constructors :[list][*] provide an attractive alternative to the ra

原创 Value Object vs. Data Transfer Object (VO vs. DTO)

The pattern which is known today as Data Transfer Object was mistakenly (se

原创 web.xml 中的listener、 filter、servlet 加載順序

[b]一、 [/b]1、啓動一個WEB項目的時候,WEB容器會去讀取它的配置文件web.xml,讀取<listener>和<context-param>兩個結點。 2、緊急着,容創建一個ServletCon

原创 面向對象設計原則

正如牛頓三大定律在經典力學中的位置一樣,“開-閉”原則(Open-Closed Principle)是面向對象的可複用設計(Object Oriented Design或OOD)的基石。其他設計原則(里氏代

原创 vim圖

隨便看看:[img]http://dl.iteye.com/upload/attachment/214810/112ca5b3-84c4-3eec-b811-007019e8083a.jpg[/img]

原创 UML中關聯(association)和依賴(dependency)的區別

這個問題不僅我們這些小嘍羅會迷惑,很多大拿們也沒有統一的認識,爭論常有。在UML2.0 規範中,有些以前歸爲一方的現在被歸爲另一方。下面是從網上搜集的一些看法:---------1.--------- De

原创 當一個線程進入一個對象的一個synchronized方法後,其它線程是否可進入此對象的其它方法?...

當一個線程進入一個對象的一個synchronized方法後,其它線程是否可進入此對象的其它方法?日前在網上見到一道Java筆試試題,如題所述。給出的答案如下:答:不能,一個對象的一個synchronized

原创 Aggregation v.s. Composition

[b]Aggregation[/b]Aggregation is a kind of association that specifies a whole/part relationship between

原创 Set是如何實現"沒有重複元素" - hashCode compareTo equals

Set和數學中的集合是同一個概念,就是沒有重複元素的集合。這篇文章主要論述了Set是如何實現"沒有重複元素"(no duplicate elements)的,以及闡述了什麼是“重複”(duplicate),

原创 Facade vs Proxy

[b]Question:[/b]i feel there is not much difference between a facade and proxy pattern, and they can be

原创 Build模式的理解

Builder模式是爲了將構建複雜對象的組裝過程和它的創建部件與產品對象分離.注意: [b]是解耦組裝過程和創建具體部件[/b].[b]過程實現使用Director,它僅關心組裝部件的過程,不關心每個具體部

原创 Java class loader

[list][*]1. Explain Java class loader?[/list]Class loader are hierarchical and use a delegation model