Skip to content

Instantly share code, notes, and snippets.

Avatar

Huijun Chen chj3737

View GitHub Profile
View 适配器模式.java
interface TargetInterface {
TargetObject operate();
}
class LegacyObject {
Object method();
}
class AdapterForLegacy implements TargetInterface {
LegacyObject legacy;
View 装饰器模式.java
// 应该可以为接口或是抽象类
interface Component {
Object operate();
}
class ComponentImpl {
Object operate() { }
}
// 实现接口或是抽象类
View 门面模式.java
class Car {
Engine engine;
Brake brake;
Window window;
start() {
engine.start();
}
break() {
View 观察者模式.java
class Observable {
void notifyObservers(Object context);
void addObserver(Observer observer);
void removeObserver(Observer observer);
// ... count,
}
interface Observer {
void update(Observable obj, Object context);
}
View 学习之道笔记.md

学习之道

人脑特点

思维模式

两种工作模式类似近光灯与远光灯

专注模式

You can’t perform that action at this time.