[MUSIC]
Let's discuss some of the design tools that software engineers use.
We've already seen that modern web applications involve a significant
amount of complexity, particularly on the server side.
But even what is happening on the client side, in the browser,
is getting a lot more complicated over time.
A typical web application involves numerous protocols,
programming languages and technology spread throughout the web stack.
And this makes developing, maintaining, and
extending complex web applications extremely difficult.
Thus, we need to use a foundation of solid design principles
in order to simplify the development and maintenance of web applications.
Now, software engineers use abstraction to manage complexity.
You can't keep all of the details associated with
a large software system in your head.
There's just too much complexity.
If you try to, you're likely to make mistakes.
The human mind can only handle so much complexity, so we use abstraction.
Abstraction involves representing the essential features of a software design or
component, without including the background details.
In other words by representing only the most important elements of a design
you're said to be abstracting away the complexity.
Design patterns provide useful abstractions for
building software systems.
Some of the most important design abstractions used by software engineers
are design patterns.
What is a design pattern?
It is a reusable solution to a design problem that
involves a set of components that interact in order to solve a general
design problem within a particular context.
Let's take a look at this definition.
So a design pattern is a reusable solution involving interacting software components.
In other words, the design patterns specifies how you should
organize these components In order to solve the design problem.
These are often software components that could be at a fairly high level or they
could be all the way down at the level of an object in an object oriented system.
Now the term context used in this definition describes the specific
circumstances under which you are trying to apply this design pattern,
in other words the individual motivating factors or
problems that need to be resolved in order to build this successful software system.
We'll talk more about this in just a moment.
So design patterns are simply abstract templates that can be applied over and
over again in many different contexts.
It's important to understand that design patterns are not actual code.
They're design ideas that just commonly occur.
In other words, they occur enough that we give them a name.
And there are many different ways to implement a given design pattern in code.
So why should we do this?
Well-known design patterns are often used, alone or
in combination, to simplify complex designs.
And the other thing is, design patterns provide us a way to communicate with
one another about the particular parts of a design.
What this means is that design patterns are the vernacular that
software engineers use to communicate with one another about designs.
Here's an example.
The client server model that we've already discussed,
it's an architectural design pattern.
Let's look at its features.
It's a reusable template that can be applied over and over again.
In our case, we have applied it to the problem of communicating
over the internet while using the World Wide Web, that's our context.
The whole point of the client server architecture is to distribute
the components of an application between the client and the server in some way.
What gets put where determines the particular type
of client server architecture.
For example you might be trying to share a database amongst a bunch of users, or
files, or a printer.
This is a very common scenario or
context in which you would use the client server architecture.
In our case, we're distributing the browser to the client and
the web server to the server.
And what we have here are interacting components, right?
There's the browser interacting with the web server.
And when I've now used the term client-server,
you immediately have an idea of what is meant, what is involved by this design.
So we're already using design patterns to communicate with one another.
Now in order to build complex web applications, we're going to have to make
use of numerous design patterns throughout this course.
That will help us organize how pieces are placed
within a web application architecture.
We'll start by elaborating the client-server design pattern in more
detail in the next video.