https://zhuanlan.zhihu.com/p/65931795
问题:不再是单个对象业务逻辑复杂,是对象之间的交互复杂。对象之间相互引用,相互调用。而且交互的逻辑很简单。 解决:引入中介,对象通知中介,中介通知其他相关对象。
注意:使用场景只是:对象之间的交互方法很简单,但是对象之间的引用关系很复杂。
| /** | |
| *@author ${USER} | |
| *@create ${DATE} ${TIME} | |
| */ |
| ssh-keygen -t rsa -C "[email protected]" | |
| git config --global user.name xxx | |
| git config --global user.email [email protected] |
| chrome | |
| dash | |
| 休息一下 | |
| iShot | |
| cheatsheet | |
| sublime | |
| uTools | |
| iHosts | |
| 滴答清单 | |
| 搜狗输入法 |
| show create table table_name; | |
| defaults write com.apple.dock springboard-columns -int 8 | |
| defaults write com.apple.dock springboard-rows -int 6 | |
| defaults write com.apple.dock ResetLaunchPad -bool TRUE | |
| killall Dock | |
| ==== |
| "font_face": "Courier New", | |
| "font_size": 10 | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| create table `tt` ( | |
| `id` int(11) not null, | |
| `first_name` varchar(20), | |
| `last_name` varchar(20), | |
| `full_name` varchar(40) as ( concat(first_name, ' ', last_name) ) | |
| primary key (`id`) | |
| ) engine=InnoDb DEFAULT charset=utf8mb4; | |
| 插入:1、不带full_name;2、只能带 DEFAULT |
| with t1 as (select * from t_table where id = 1), t2 as (select * from t1 where id = 1) | |
| select * from t1, t2 | |
| 递归CTE | |
| with recursive cte(n) as ( | |
| select 1 | |
| union all | |
| select n+1 from cte where n < 5 | |
| ) |
https://zhuanlan.zhihu.com/p/65931795
问题:不再是单个对象业务逻辑复杂,是对象之间的交互复杂。对象之间相互引用,相互调用。而且交互的逻辑很简单。 解决:引入中介,对象通知中介,中介通知其他相关对象。
注意:使用场景只是:对象之间的交互方法很简单,但是对象之间的引用关系很复杂。