• LOGIN
  • No products in the basket.

2 STUDENTS ENROLLED

Course Curriculum

Section 01: What are Design Patterns?
What this course is about 00:06:40
"We - the course instructors - start with introductions. We are a husband-wife team, studied at Stanford, and spent several years working in top tech companies, including Google, Flipkart and Microsoft. Next, we talk about the target audience for this course: Engineers and Product Managers, certainly, but also Tech Executives and Investors, or anyone who has some curiosity about technology. By the end of this class, students will be able to: spot situations where design patterns lead to better designs, and deploy those patterns effectively. Product managers and executives will learn enough of the 'how' to be able intelligently converse with their engineering counterparts, without being constrained by it. That's it for preliminaries - with this we plunge right in! ""Design Patterns are canonical solutions to recurring problems"". We start by understanding what Design Patterns are, and why these patterns are still so popular decades after they were first put together. Design Patterns, Libraries and Frameworks: A martial arts analogy illustrates the difference Broad Categories of Patterns: We also take a quick swing through the major categories of Design Patterns - creational, structural and behavioral."
Creational, Behavioural and Structural Paradigms 00:07:03
Design patterns are often divided into three categories - creational, behavioural and structural. Let's understand what these categories represent.
Design Principle #1: Rely on Interfaces, not Implementations 00:04:14
Program to interfaces, not implementations' said Eric Gamma. Of course he was right.
Design Principle #2: The Open/Closed Principle 00:05:31
Code should be open for extension but closed for modification. How can this be achieved? Well, there are 3 possible ways: inheritance, delegation, and composition.
Design Principle #3: Principle of Least Knowledge 00:04:39
Like children, code should only talk to friends, never to strangers!
Design Principles #4 and #5: Dependency Inversion and the Hollywood Principle 00:05:46
Always rely only on abstractions, never on details. Oh - and don't call us, we'll call you. That's how Hollywood works, and that's how the Hollywood Principle reads.
A taste of things to come 00:12:17
We will cover a fair bit of ground in this class. Here's a quick look at what's coming your way.
Section 02: The Strategy Pattern
The Strategy Design Pattern: Introduction via String SortingFREE 00:14:25
The Strategy Design Pattern helps modify the behavior of classes at run-time - and does so using composition (member variables) rather than inheritance (parent classes). We examine how the Collections.sort method embodies the Strategy Pattern.
The Strategy Pattern and Dependency Injection – IFREE 00:10:23
Dependency Injection is a widely-used design technique that is closely related to the Strategy Design Pattern. This lecture details how dependency injection is used to specify complex user interfaces in Java FX using an XML representation called FXML. This is a common technique used in modern UI frameworks in Java.
The Strategy Pattern and Dependency Injection – II 00:10:44
Dependency Injection is a widely-used design technique that is closely related to the Strategy Design Pattern. This lecture continues detailing the use of dependency injection to specify complex user interfaces in Java FX, and then ties back to the Strategy Design Pattern
Section 03: The Decorator Pattern
The Decorator Design PatternFREE 00:08:43
The Decorator Design Pattern comes in handy when a class hierarchy needs to take into account multiple independent implementation details. One decorator class for each independent variable, each of which can be created from another. All decorator objects implement the same interface of course.
The Decorator Design Pattern In Action: Java File APIs 00:13:26
The Java File APIs are a classic use-case of the Decorator Pattern - it would be difficult to imagine an efficient way to implement these APIs without using the Decorator.
Section 04: The Factory Pattern
The Factory Design Pattern: Introduction 00:14:57
Let's say your organization is moving from one database (say MS SQL-Server) to another (say Oracle). How would you use the Factory Pattern to minimize the effort needed for this enormous move?
The Factory Design Pattern In Action: Database Drivers 00:05:43
We continue with our planning for the move to Oracle from MS-SQL Server - we see how the Decorator Pattern, combined with the use of reflection and config files, can save us many late nights and bug bashes
The Abstract Factory Design Pattern 00:16:03
The Abstract Factory Pattern is closely related to the Factory Design Pattern, but is a better fit when entire different hierarchies of related objects need to be created. We also examine the Open-Closed Principle, which specifies that classes should open for extension but closed for modification.
The Abstract Factory Design Pattern: Families of classes 00:08:48
Let's see an example of how we can use the Abstract Factory pattern to create families of classes. We'll work with the same example of moving from Microsoft to Oracle as our database provider.
The Factory Design Pattern In Action: Reflection – I 00:15:47
These days, the Factory Design Pattern is increasingly implemented via Reflection, so it makes sense for us to understand the pros, cons, and complexities of Reflection
The Factory Design Pattern In Action: Reflection – II 00:10:33
As previously discussed, these days, the Factory Design Pattern is increasingly implemented via Reflection. In this video, we describe a specific use-case when Reflection is exactly the right tool for what we are seeking to accomplish.
Section 05: The Singleton Pattern
The Singleton Design Pattern: Introduction 00:09:05
The Singleton Pattern is beautiful - a unique object, usually implemented via a private constructor and a static getter method.
The Singleton Design Pattern: Double-Checked Locking 00:13:17
The Singleton Pattern is very elegant in its construction, but there are important nuances that we should be aware of, specifically related to multi-threading and to class loaders in Java. In this lecture, we explore how a concurrency-related Design Pattern called Double-Checked Locking can come in handy while implementing the Singleton in a multi-threaded environment.
The Singleton Design Pattern: The Synchronized Keyword 00:12:17
The Singleton Pattern in a multi-threaded environment is surprisingly hard to get exactly right - we dig deeper into the subtleties - this requires us to understand the exact semantics of the Synchronized keyword.
The Singleton Design Pattern: Pulling together a multi-threaded solution 00:13:51
We tie together the different threads (bad pun!) we had going on multi-threading, and present a final thread-safe implementation.
Section 06: The Adapter Pattern
The Adapter Design Pattern: Introduction 00:05:18
The Adapter Pattern is often used in converting data from one representation to another: we understand how an adapter can help with loose coupling of classes. Also, classes need not be rewritten to support additional interfaces, a new adapter is all that is needed.
The Adapter Design Pattern: Introduction – II 00:07:07
We continue with the benefits of adapters, and see a simple example of adapters - wrapping arrays so that all of the powerful functionality available for working with Collections can be easily applied to arrays too.
The Adapter Design Pattern In Action: Tables and Charts 00:12:59
The Adapter Pattern is simple: an adapter takes in an object (usually singular) of one interface, and gives back another object (also singular) of another interface.
Section 07: The Facade Pattern
The Facade Design Pattern 00:15:53
The Facade Design Pattern hides in plain sight: complicated operations (such as networking and url handling) used to be incredibly onerous in C, and are incredibly simple in Java. We have the Facade Pattern to thank for this.
Section 08: The Template Pattern
The Template Design Pattern: Introduction via Text Auto-Summarization 00:16:10
The Template Design Pattern is perfect when we need to specify a complex algorithm, and leave room for a client to plug in a specific implementation for a specific step. We examine this via an example from Natural Language Processing: automatically summarizing a document. We see how classic NLP algorithms can be plugged into the more general summarization algorithm via the Template Pattern.
The Template Design Pattern In Action: Frameworks 00:15:19
The Template Pattern was the precursor to Frameworks - both embody the Dependency Inversion Principle, where high-level objects say to low-level objects "don't call us - we'll call you".
The Template Design Pattern In Action: Frameworks – II 00:05:58
The Template Pattern was the precursor to Frameworks - both embody the Dependency Inversion Principle, where high-level objects say to low-level objects "don't call us - we'll call you". We consider Java FX, a framework where the client plugs in code into a specific method, the framework does the rest (which is a lot!)
Section 09: The Iterator Pattern
The Iterator Design Pattern: Introduction 00:12:25
The Iterator Design Pattern has become part of the daily idiom of programming; iterators offer a standard way to access elements in a collection, independent of the implementation of the collection.
The Iterator Design Pattern: Type Safety via Generics 00:12:02
We look at how generics help enforce type-safety in collections - and how iterators are correspondingly also generic.
The Iterator Design Pattern: Internal and External Iterators 00:07:58
We explore in further detail the differences between Internal and External Iterators, and also how the for-each operator has become a standard part of language support for iterators in Java, Python and other major languages
The Iterator Design Pattern: Language Support for Iterators in Python and Java 00:15:48
We continue look at how Python and Java have explicitly added language support for iterators, and also examine how iterators in Python are inextricably linked to the language (far more than in Java)
Section 10: The MVC Paradigm
The Model View Controller Design Pattern: An Introduction 00:13:59
The Model-View-Controller (MVC) paradigm is ubiquitous in UI programming; along with the Observer and Command patterns, MVC has practically defined modern User-Interface programming.
The Model View Controller Design Pattern In Action: A MediaPlayer ExampleFREE 00:08:11
Models contain data, views define the UI, and controllers respond to user input and update the model and the view. We see how this plays out in a Media Player application.
The Model View Controller Design Pattern In Action: A Chart Example 00:08:42
Models contain data, views define the UI, and controllers respond to user input and update the model and the view. We see how this plays out in a Charting application.
Section 11: The Observer Pattern
The Observer Design Pattern: Introduction 00:10:16
The Observer Pattern, along with the MVC and Command Patterns, has practically defined modern UI programming. Publishers publish updates when their state changes, and Subscribers can listen in on these updates. An event is fired when the state changes, and the listener responds via a Command object called the event listener code.
The Observer Design Pattern In Action: Properties and Bindings – I 00:14:42
Java has recently added substantial language support for the Observer Pattern via two new types of objects - Properties and Bindings. Let's understand when these types of variables can save us a bunch of work.
The Observer Design Pattern In Action: Properties and Bindings – II 00:09:27
More on the newly added language constructs for the Observer Pattern, Properties and Bindings. We dig deep into the mechanics and underlying interfaces.
The Observer Design Pattern In Action: Mouse Handling and TreesFREE 00:07:06
After the relatively new-age Properties and Bindings, we turn to classic use-cases of the Observer Pattern, in User Interface elements such as mouse click handlers and tree views. The Observer Pattern is used in clever ways in Swing and other UI frameworks, allowing the user great flexibility in responding to a variety of different user actions.
The Observer Design Pattern In Action: MVC + Observer = UI Magic 00:10:34
We dig deep into the interplay between the Model-View-Controller and the Observer Pattern, tied together via the Command Pattern. These three patterns have, together, defined modern User-Interface programming
The Observer Design Pattern In Action: A MediaPlayer Example – I 00:15:17
Models contain data, views define the UI, and controllers respond to user input and update the model and the view. We see how the Observer Pattern plays a crucial role in seting up this MVC example for success - for instance, a slider that wires up the volume of the media is just about 1 line to set up correctly.
Section 12: The Command Pattern
The Command Design Pattern: Introduction 00:12:40
The Command Design Pattern is used to separate an action from its execution. A seemingly abstract idea, and an incredibly powerful one. The Command Pattern, along with the Observer and MVC Patterns, has practically defined modern User Interface Programming.
The Command Design Pattern In Action: Lambda Functions – I 00:10:40
The idea of encapsulating an action in an object can be used to retro-fit functional programming support into an object-oriented language like Java. Lambda functions, in particular, are a functional programming concept that has become a cross-over hit in the object-oriented world of Java.
The Command Design Pattern In Action: Lambda Functions – II 00:10:54
We continue with functional-programming support in Java. In addition to lambda functions, there are also powerful aggregate operators - map, foreach and filter - that we can use to chain lambda functions together
The Command Design Pattern In Action: Threading 00:15:18
The Command Design Pattern is used to separate an action from its execution. We see how this idea is used as the starting point of most modern Threading libraries. Java has old-school and new ways of getting Multi-threading done, and both of these start with the Command Pattern.
The Command Design Pattern In Action: Undo and Logging 00:15:29
The Command Design Pattern is used to separate an action from its execution. This idea serves as the basis of two really neat applications: implementing Undo, and logging activity. Let's see how.
Section 13: The Composite Pattern
The Composite Design Pattern: Introduction via DecoratorsFREE 00:09:02
The Composite Pattern works best when a tree-shaped class hierarchy needs to be set up; This is understood best via the Decorator Pattern, which in turn works best when an onion-like class hierarchy (similar objects wrapped inside each other) works best. So we start with a segue into the Decorator Pattern, specifically with the objective of making the Composite clear via juxtaposition.
The Composite Design Pattern: Class Hierarchy 00:17:39
We finally get to the Composite Class Hierachy, and study the tree-shaped class structure it usually results in.
The Composite Design Pattern In Action: Transitions, Swing ContainersFREE 00:15:19
Two canonical examples of the Composite Pattern: Swing UI containers, and Transitions in Java FX. Swing containers (JPanels) contain other containers, leading to a tree-like object structure. Likewise, in Java FX, two special types of transitions - parallel and sequential transitions - contain other transitions, leading to a nested object hierarchy.
Section 14: The Builder Pattern
The Builder Design Pattern: Introduction 00:15:48
The Builder Pattern works best when a complicated object needs to be set up, with inputs in its construction flowing in over time (because this information is not all available when the object is constructed, the Builder pattern usually is marked by constructors that do little, if anything). We start with a simple example, of an HTML Builder.
The Builder Design Pattern In Action: An SQL Query Builder I 00:09:42
A more substantial example of the Builder Pattern, this time put to use to build SQL queries. This is a classic and canonical example of the Builder Pattern.
The Builder Design Pattern In Action: An SQL Query Builder II 00:13:05
We continue with our use of the Builder Pattern to build SQL queries. This is a classic and canonical example of the Builder Pattern. In this lecture, we show the Builder Pattern would work in this case, and how it would solve the issues we encountered with our previous approaches.
Section 15: The Chain of Responsibility Pattern
The Chain of Responsibility Design Pattern 00:12:31
The Chain of Responsibility Design Pattern makes sense when any one of many objects might know how best to deal with a situation, but its not clear in advance which object exactly that will be. The 'event' then gets passed around in order, and the first object that knows what to do handles the event. This is exactly how Exception handling works in most languages, including Java.
Section 16: The Memento Pattern
The Memento Design Pattern 00:10:12
The Memento Design Pattern makes sense when objects need to know how to save their state, and know how to revert to that state.
The Memento Design Pattern : Serialization 00:09:21
The usual way of implementing the Memento pattern is via Serialization - this used to be very onerous, but modern languages provide support that make Serialization quite simple.
Section 17: The Visitor Pattern
The Visitor Design Pattern 00:14:17
The Visitor Design Pattern is inextricably linked to the Composite: Composite Design Patterns usually result in class hierarchies that look like trees, and a Visitor Object knows how to perform operations on each node of the tree.
Section 18: The State Pattern
The State Design Pattern 00:09:38
The State Design Pattern is specifically meant for objects that need to maintain an internal State Machine. This pattern is a super-neat trick that allows the state transitions, as well as the the addition of new states, surprisingly easy.
The State Design Pattern in Action : Mediaplayer 00:09:32
A deeper look at the State Pattern taking the example of implementing states for a mediaplayer
Section 19: The Flyweight Pattern
The Flyweight Design Pattern 00:09:47
The Flyweight Design Pattern is used when we would like only 1 distinct object per distinct value of an underlying variable. This usually results in immutable objects - most famously like Strings in Java.
The Flyweight Design Pattern : Multithreading 00:08:52
This class talks about the complications involved when using flyweights with multi-threading. If you ever implement the Flyweight Pattern, be sure to understand the .equals() method, and to override it.
Section 20: The Bridge Pattern
The Bridge Design Pattern 00:15:06
Class Hierarchy Explosion? If you find your class hierarchy getting too complicated to understand, consider the Bridge Pattern, which splits a complex hierarchy into multiple, far simpler hierarchies, and then uses Composition (member variables) to stitch these hierarchies together.
Section 21: The Mediator Pattern
The Mediator Design Pattern 00:15:13
The Mediator Design Pattern is awesome when a class hierarchy is complicated to implement, but conceptually very simple to use. Similar conceptually to the Facade Pattern, but the Mediator makes sense when there are a number of peer objects - the class hierarchy looks like the hub-and-spoke structure in a wheel.
Section 22: The Prototype Pattern
The Prototype Design Pattern 00:14:34
The Prototype Design Pattern makes sense when an object needs to be able to clone itself. This is related to the idea of copy constructors - but with the twist that in Java, this relates to an interface called Cloneable. Cloneable is a poorly designed interface - this class will also explore why.
Section 23: The Proxy Pattern
The Proxy Design Pattern 00:08:45
The Proxy Design Pattern makes sense when one object must stand in for another. The canonical example is Remote Method Invocation, which is built entirely on the Proxy Pattern, and which for years was the easiest way to write a distributed computing application. RMI has now been rendered obsolete by more modern distributed computing techniques such as Rest APIs, but the Proxy Pattern made this big leap possible.
© 2016. LearnBox Education.

Login

Register

Create an Account
Create an Account Back to login/register