原创 結構型-代理proxy

爲其他對象提供一種代理以控制對這個對象的訪問. Program.csusing System; using System.Collections.Generic; using System.Text; namespace 代理模式 {

原创 vs2010 c#添加webservice服務並使用soapui測試

1.環境win7 64位,vs2010 2.新建一個asp.net web應用程序 3.右鍵項目添加一個web服務 4.程序本來就有一個helloworld方法,現在添加一個自定義的方法,,如下CarMoveRequest        

原创 行爲型模式-職責鏈chain of responsibility

使多個對象都有機會處理請求,從而避免請求的發送者和接受者之間的耦合關係。將這個對象連城一條鏈,並沿着這條鏈傳遞該請求,知道有一個對象處理它爲止。 Program.csusing System; using System.Collecti

原创 結構型-外觀facade

爲子系統的一組接口提供一個一致的界面,此模式定義了一個高層接口,這個接口使得這一子系統更加統一使用。 有點像簡單工廠模式using System; using System.Collections.Generic; using Syst

原创 結構型-組成/組合composite

遞歸使用對象 Program.csusing System; using System.Collections.Generic; using System.Text; namespace 組合模式 { class Progra

原创 行爲型模式-命令command

將一個請求封裝爲一個對象,從而使你可用不同的請求對客戶進行參數化,對請求排隊或記錄請求日誌,以及支持可撤銷的操作。using System; using System.Collections.Generic; using System.

原创 行爲型模式-中介者mediator

一般用於一組對象以定義良好但是複雜的方式進行通信的場合using System; using System.Collections.Generic; using System.Text; namespace 中介者模式 {

原创 行爲型模式-迭代器interator

提供一種方法順序訪問一個聚合對象中的各個元素,而又不暴露該對象的內部表示。 迭代器模式太普遍了,所以各種高級語言都對它進行了封裝,所以反而給人感覺此模式本身不太常用了。 迭代器實現: using System; using System

原创 結構型-裝飾decorator

結構型-裝飾decorator 點贊 收藏 分享

原创 行爲型模式-備忘錄memento

在不破壞封裝性的前提下,捕獲一個對象的內部狀態,並在該對象之外保存這個狀態。這樣以後就可以將該對象恢復到原先保存的狀態。  using System; using System.Collections.Generic; using Sy

原创 結構型-享元flyweight

用了享元模式,就有了共享對象實例總數就會大大減少 Program.csusing System; using System.Collections.

原创 行爲型模式-解釋器interpreter

給定一個語言,定義它的文法的一種表示,並定義一個解釋器,這個解釋器使用該表示來解釋語言中的句子。using System; using System.Collections.Generic; using System.Text; na

原创 交換機二層、三層

二層三層 交換機的核心功能是交換,也就是對以太網幀進行轉發,這個過程與報文的IP地址無關,只與Mac地址有關,所以它是二層的 然而在實際應用中我們不但需要交換機,還需要路由器進行路由,需要防火牆進行訪問控制,因此又有了具有路由和acl功能

原创 COM

服務端需要實現DllGetClassObject,並導出 客戶端調用CoGetClassObject時,COM框架就會調用到服務的DllGetClassObject 客戶端調用CoCreateInstance,就相當於調用了CoGetCl

原创 windows api 庫 和 判斷編譯器類型

編譯器特徵 一般情況下,有如下編譯器特徵: This program must be run under Win32是Borland系編譯器標誌(BCB、delphi) This program cannot be run in DOS