In this video Emmanuel Henri explains the mediator pattern with an example.
- [Instructor] 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…as you can see on the screen.…Take a look at the exercise files…and pull the files from this video…to get this example on your editor.…You'll see here an example that is often used…to demonstrate the mediator pattern,…which is a traffic tower and an airplane.…So basically the traffic tower right now…controls the traffic from the airplanes.…
So whenever an airplane wants to get the position…of the traffic tower it could request the position,…but in most cases the traffic tower controls…all the traffic and requests the positions of the airplanes.…If there are multiple airplanes in an array,…then the traffic tower requests their positions,…and therefore this particular class controls…what's happening with the airplanes.…And this is a good example of the mediator pattern…where this particular class here, the traffic tower,…
- What's a pattern?
- What's the role of callbacks?
- Creational patterns, including Singleton and Factory
- Structural patterns, including model-view-controller
- Behavioral patterns, including Memento and Mediator
Skill Level Intermediate
2. Creational Patterns
3. Structural Patterns
4. Behavioral Patterns
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.