原创 《設計模式之禪》——備忘錄模式

       定義:Without violating encapsulation, capture and externalize an object's internal state so that the object can be

原创 《設計模式之禪》——命令模式

        定義:Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue

原创 《設計模式之禪》——行爲類模式大PK

1.命令模式VS策略模式        策略模式的意圖是封裝算法,它認爲算法已經是一個完整的、不可拆分的原子業務(注意這裏是原子業務,而不是原子對象),即其意圖是讓這些算法獨立,並且可以相互替換,讓行爲的變化獨立於擁有行爲的客戶;

原创 《設計模式之禪》——觀察者模式

       定義:Define a one-to-many dependency between objects so that when one object changes state, all its dependents are

原创 《設計模式之禪》——迭代器模式

         定義:Provide a way to access the elements of an aggregate object sequentially without exposing its underlying re

原创 使用jsch-spring-boot在本地訪問遠程雲服務

現在很多創業公司都不再自建機房,更多地選擇雲主機,如阿里雲和騰訊雲等。爲了安全考慮,他們提供的關係數據庫、nosql數據庫等服務器都是不能直接訪問的,只能通過雲主機訪問。 因爲在本地不能訪問,這樣在開發和測試過程中就比較麻煩。

原创 Eclipse部署項目到tomcat加載兩次的問題

這個配置是將項目發佈到tomcat的webapps下。在servers試圖啓動Tomcat後,調用的是tomcat所在目錄的執行文件,除了部署eclipse下的項目,tomcat還要加載webapps下的所有項目,所以就重複加載

原创 《設計模式之禪》——責任鏈模式

        定義:Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the

原创 《設計模式之禪》——策略模式

        定義:Define a family of algorithms, encapsulate each one, and make them interchangeable.(定義一組算法,將每個算法都封裝起來,並且使它們之

原创 《設計模式之禪》——組合模式

       定義:Composite objects into tree structures to represent part-whole hierarchies. Composite lets clients treat indi

原创 《設計模式之禪》——訪問者模式

       定義:Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new

原创 《設計模式之禪》——裝飾模式

       定義:Attach additional responsibilities to an object dynamically keeping the same interface. Decorators provide a

原创 《深入淺出 Java Concurrency》 續

       這幾天學習了《深入淺出 Java Concurrency》這個系列,寫得挺好。趁着學習的機會,把這部分內容的思維導圖更新了一下(JDK 7),如下圖所示。添加了如下內容: collections添加了Queue-->Bloc

原创 《設計模式之禪》——適配器模式

        定義:Convert the interface of a class into another interface clients expect. Adapter lets classes work together t

原创 《設計模式之禪》——狀態模式

       定義:Allow an object to alter its behavior when its internal state changes. The object will appear to change its c