今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Mediator pattern
- [Emmanuel] The mediator pattern provides a set of objects which interact with each other, mostly by having a central authority dictating the terms in between objects. It is best demonstrated with example code. Take a look at the exercise files, and pull the files from this video. You'll see here an example that is often used to demonstrate the mediator pattern. So basically what we have here is first a class called TrafficTower, so we're creating a tower, and inside of that tower we have a list of all the airplanes. And then we can actually request all the positions of the airplanes from that TrafficTower. And then we have a class called Airplane, and we're basically building a constructor with the position and trafficTower, and so on and so forth. And then we have a function that requests positions from the traffic tower. So basically the airplane can actually track itself from the traffic tower and then the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
What are behavioral patterns?1 分钟 4 秒
-
(已锁定)
Observer pattern2 分钟 36 秒
-
(已锁定)
State pattern3 分钟 6 秒
-
(已锁定)
Chain of responsibility1 分钟 30 秒
-
(已锁定)
Iterator pattern3 分钟 44 秒
-
(已锁定)
Strategy pattern1 分钟 36 秒
-
(已锁定)
Memento pattern53 秒
-
(已锁定)
Mediator pattern1 分钟 32 秒
-
(已锁定)
Command pattern2 分钟 24 秒
-
(已锁定)
-