background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Паттерны проектирования для начинающих с примерами на PHP"

input logo icon
Video tags
|

Video tags

CyberBionic
ITVDN
программирование
курсы программирования
Microsoft
Framework
.net
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:02
binary on the topic of pattern in design
00:00:04
for beginners with examples on the stove topic
00:00:08
very broad topic very large and
00:00:10
By the way, I also want to say right away that any
00:00:14
Anyone can ask me questions
00:00:16
I'm open here if anything happens at once
00:00:18
I see, I see the super prize is already coming super
00:00:21
great the first question I want
00:00:24
ask before I start exactly
00:00:28
talking about the topic itself is how much
00:00:30
Is anyone even familiar with patterns?
00:00:34
is there if anyone what time do people me
00:00:37
interested specifically in those who generally
00:00:39
didn't hear anything in the patterns
00:00:41
there is no design with this at all
00:00:42
met at all that he doesn’t know and
00:00:45
for the sake of or whatever they heard and I would like
00:00:48
I wish everyone who exactly is in this
00:00:51
topic and let’s just say don’t analyze anything
00:00:54
understand that they should just put it too
00:00:57
not pluses about, for example, units per hour
00:01:00
so that I just know how many of us there are
00:01:01
that is, people who have nothing at all
00:01:03
understands this
00:01:08
I see here already yes hello hello everyone
00:01:11
I see people here already writing that
00:01:13
someone already yes there are people who
00:01:17
then I don’t understand anything, ok then I
00:01:19
I don’t think I’ll delay anymore, let’s do it then
00:01:22
begin
00:01:23
First of all, I'll introduce myself
00:01:26
my name is mirka stage or dna steel
00:01:28
whatever you want to call it I am metal
00:01:30
stoves for developers I generally work with
00:01:32
technologies that are only called upon
00:01:34
stove that is wordpress laravel
00:01:36
Freiburg sinfonie but sometimes even for me
00:01:39
something has to be done for
00:01:40
frontend and there, for example, for the budget for
00:01:43
reactions and that's all that is most of all
00:01:47
I work specifically on stove technologies and
00:01:49
how to say in this field of everything
00:01:51
figure it out yourself, let's move on to
00:01:54
plan for the webinar so that we generally understand
00:01:56
where we are heading, what we will do and
00:01:59
so on we have a total of 8 topics first
00:02:01
I will briefly expand on this introduction
00:02:03
empty like here what is it and
00:02:06
similar 2 topics this and makeup who
00:02:09
generally came up with a pattern and further
00:02:11
let's talk why there are patterns everywhere
00:02:14
used as they generally do
00:02:16
basis for architecture why they are needed
00:02:19
use why junior junior
00:02:22
I always recommend it to developers
00:02:24
pay attention to them and start
00:02:26
study because it’s kind of trivial
00:02:28
didn't sound like it, but patterns make your code
00:02:32
more purely more understandable and about this
00:02:34
In general, we’ll talk more about the fourth topic:
00:02:37
there will be generative patterns, if anything
00:02:40
this type of pattern exists but
00:02:42
we also typify mushrooms, only three
00:02:44
kind of exists
00:02:46
fifth is use by example
00:02:48
applications, that is, it will already be
00:02:49
practice 6 this is the potter directory on their
00:02:52
fingers too song what is the catalog
00:02:54
Well, 7 cartridges is just mandatory
00:02:57
definitely need to talk about
00:02:59
factoring code as patterns for this
00:03:01
influences and how they are closely related to this
00:03:05
related 8 topic but we are already inciting this
00:03:09
the results of everything we did at
00:03:11
this webinar and yes, of course I want
00:03:14
remind you what to find is visible
00:03:17
many courses on specialization in pitching
00:03:20
developer which you can go through
00:03:21
the first lessons are free so you can
00:03:23
find out if this course is right for you and
00:03:25
very much and I definitely recommend
00:03:28
take a look at it to get a new one
00:03:30
learn better but with this income well
00:03:33
Well then let's start the vision and
00:03:36
What are design patterns anyway?
00:03:39
this is exactly what will allow
00:03:42
it's much easier for you to design
00:03:44
your application is much easier than his
00:03:46
develop make your code more
00:03:47
flexible to make it more somehow let's say
00:03:51
so clean using ready-made frames
00:03:53
over time you already know and so on
00:03:57
so now so that yes I see another hour has passed
00:04:00
just anti-pattern here writes back
00:04:02
yes, by the way, I wanted to say Adyghe people
00:04:06
I’ll also touch on this topic: what is antipas
00:04:08
container as they allow in general
00:04:11
so find out if you have any
00:04:13
troubles with architecture and so to speak
00:04:16
By the way, I also recommend recording and who
00:04:20
wants the things I say to be
00:04:22
good for the stomach I have it here
00:04:23
Let's just say there are small notes on the table
00:04:26
if this is a friend, let me just answer
00:04:28
remembered what we were talking about, that is, in general
00:04:30
the patterns can be said to be ready-made
00:04:33
decisions that allow you exactly
00:04:35
ready to solve some problem
00:04:38
developers often meet but exactly
00:04:40
the architectural task is not just there
00:04:42
for example, bring out howel you poke there
00:04:45
some kind of do while loop parse a
00:04:48
precisely the architectural task which
00:04:50
is that for example here
00:04:53
Let's imagine a situation that I need
00:04:56
make sure I have unloading
00:05:00
some kind of automatic
00:05:02
uploading files to excel format or
00:05:05
there are even three formats and instead
00:05:07
to copy classes there copy
00:05:10
all this code so as not to do something
00:05:13
close connection so that this code can be
00:05:16
later it was easy to change it was flexible
00:05:18
so other developers can understand
00:05:19
how does it work we use it there
00:05:21
some kind of pattern in the future is still
00:05:23
let's talk more and
00:05:25
pattern and who even invented them and
00:05:28
in general all the movement of patterns
00:05:31
design, that is, when let's say so
00:05:34
developers started thinking about it
00:05:37
begin with
00:05:38
1994 when let's say gang 4 is
00:05:42
can be called
00:05:44
people like four people that is 4
00:05:47
programmers developers who
00:05:48
laid the foundation for this pattern movement
00:05:51
and not even movements, but precisely this idea and I
00:05:55
I would even call it in some sense
00:05:57
development methodology is advertising, well you
00:06:01
you can send oregano yourself now
00:06:02
richard hell johnson john deal with they like
00:06:06
they're releasing a book
00:06:08
1994 which is called design
00:06:10
patterns where the main patents are posted
00:06:13
at that time I immediately want anything else
00:06:17
so wait a second let's get distracted strategy
00:06:20
I would definitely get this pattern
00:06:22
let's look at a small example so here they are
00:06:25
publishes a book in general in ninety
00:06:27
fourth year which was called for
00:06:29
seven subraces of pattern and design
00:06:32
Is there any drive like these patterns?
00:06:35
design, but that’s exactly the point
00:06:38
was that from that moment
00:06:40
that movement begins when
00:06:42
the developers thought about it
00:06:44
how exactly can they make them
00:06:46
architecture code cleaner as they
00:06:49
do so let's say others
00:06:52
developers could parse them more easily
00:06:54
code is easier to solve some issues
00:06:56
architectural, well, in general it’s simpler
00:06:59
speaking of doing architecture cleanly and solving
00:07:02
problems quickly somehow without
00:07:05
you didn't have to
00:07:06
re-study architecture which
00:07:09
written by a previous developer who
00:07:11
confused or something like that
00:07:14
well, yes, I also said exactly that
00:07:19
it was these people who laid the foundation and I would
00:07:22
I would also like to point out that this
00:07:24
the story of pattern B does not end
00:07:26
every year everyone opens some
00:07:28
other developers
00:07:30
why open because well, they are us
00:07:33
I can’t come up with some kind of problem myself
00:07:35
we meet him we just open
00:07:37
method to solve it and
00:07:40
catalogs pattern I'll talk about them later but in
00:07:43
in general, I just want to say that they are
00:07:45
is constantly being updated and I don’t know what it is
00:07:48
if you are a developer you need to take and
00:07:51
study absolutely all patterns
00:07:54
design
00:07:55
some basic ones are enough, for example
00:07:57
generating
00:07:58
there are also several others instead
00:08:02
to study there healthy is so simple
00:08:05
let's say a large catalog even from me
00:08:08
here is the book bonus tricks
00:08:10
object-oriented design
00:08:12
and here right here is just a whole list
00:08:16
cartridges are just very big thick
00:08:18
the book is very useful and I don’t know what
00:08:21
you need to study the entire list
00:08:23
it is enough just to know the basic and
00:08:25
use those that fit better
00:08:27
for your lan tasks then let's
00:08:29
move on why the pattern is everywhere
00:08:32
use their advantages
00:08:34
as I said that they make it easy
00:08:38
solve architectural problems that is
00:08:40
if you are dating someone
00:08:42
the problem is that it’s like I told you
00:08:43
need to create some kind of structure
00:08:46
so you don't have to duplicate there
00:08:49
somehow a strong cat
00:08:52
how do you take it and exactly
00:08:56
you use a pattern and so you don't
00:08:58
had to
00:09:00
duplicate code to make it easier to repeat
00:09:03
use and to others
00:09:06
the developers could figure it out exactly
00:09:08
what you wrote they are exactly
00:09:11
used this again is what I
00:09:13
I say yes by the way there is someone here
00:09:15
comments wrote this gang caught no
00:09:18
I don't know that unfortunately
00:09:20
but the guys still write books X and
00:09:23
materials from them are very useful and
00:09:27
always to each pattern if you for example
00:09:31
open any
00:09:33
just the pattern catalog you can
00:09:36
something see this full description
00:09:38
pattern of his mental pit diagram by the way
00:09:42
who doesn’t know what Yamal is?
00:09:44
a lot of Yuma can be done like this too
00:09:46
read exactly this here
00:09:49
I'll highlight who doesn't know please put it
00:09:51
pluses in chat what is it because
00:09:54
this is such a let's say language is not
00:09:59
modeling programming language
00:10:01
namely class schemas into class structures
00:10:04
application and with it you can
00:10:07
for example, describe the work of some of your
00:10:10
worked classes of some part of the code in
00:10:13
your application
00:10:14
because why am I asking because
00:10:17
we'll say exactly that with this one
00:10:20
marking we are looking for we will meet I
00:10:22
I will cite more than once and as an example when
00:10:24
we will watch exactly which one
00:10:27
pattern according to I will use the example
00:10:30
this is necessary I just I why
00:10:33
I'm asking because I want to make sure
00:10:34
know how this marking works in order to
00:10:37
if anything I could explain
00:10:40
it was a scheme yes this is your boardwalk
00:10:44
Alexandra wrote this correctly
00:10:45
the flowcharts are all absolutely correct
00:10:48
it means Pasha understands it well, yes
00:10:50
I see there are advantages here, in general I
00:10:53
now I will also explain all this and
00:10:55
even let me take this book
00:11:00
I'll show you what they look like in general
00:11:03
approximately like this
00:11:06
even I already have it on the next slide
00:11:09
the first block diagram that is, here I am a little
00:11:12
they are fighting each this is exactly the language with
00:11:16
with which you can build
00:11:18
the structure of the codes a mile ago was the scheme and
00:11:20
even for example now you can
00:11:23
see here the picture where we have
00:11:25
several classes and where is the interface
00:11:28
I immediately say there is a signed interface
00:11:31
and for example we have a crater here
00:11:34
By the way, I’ll tell you a secret here now
00:11:36
one cartridge design with
00:11:38
whom we will soon meet and be
00:11:40
do practice and
00:11:42
that's it
00:11:44
by the way, who is the most like this here?
00:11:48
Let's just say the attentive one can here
00:11:49
see even let's say
00:11:53
What
00:11:55
your in principle because he is here
00:11:59
often used in general patterns and
00:12:02
for example, run around class intact background
00:12:05
Peter, if anything, I’ll explain this now so that
00:12:07
you just understood how it is here
00:12:09
classes are designated and here we have
00:12:11
there is a creative function which
00:12:13
returns an object of type background and that's it
00:12:17
for example, this is a dark background, it’s like
00:12:20
I would say with a description of this function
00:12:23
to and Typhon so that they simply understand that
00:12:25
it’s like that, well, it’s glued together from a smartphone
00:12:28
also creates new text of its own types
00:12:32
this is the interface type background
00:12:34
which also allows the new one to inherit
00:12:37
object there smartphones flying background features
00:12:40
q but in general we’ll talk about all this later
00:12:42
speak
00:12:44
defat unified language model before
00:12:50
well yes yes I can not is some
00:12:54
in complex language, that is, without any
00:12:57
I think it will be a problem to figure it out well
00:13:01
so let's talk about what it's like
00:13:02
there is a classification of repeated
00:13:04
design
00:13:05
the first is the pattern-generating one that
00:13:08
makes it easy to create objects
00:13:10
classes not with 2 and strong
00:13:12
addictions in general why not
00:13:14
create in the application strong
00:13:16
dependencies between classes I think it is
00:13:19
it's even obvious when I say this because
00:13:20
that if you think about it like that, it’s obvious
00:13:24
that when there is a strong addiction
00:13:26
if suddenly you do something by accident like that
00:13:29
let's just say by moving each other something
00:13:33
will stop working as one part of it
00:13:36
Of course, everything may collapse together
00:13:39
structural pattern and allows
00:13:41
create different connections between objects
00:13:43
this is for creating not the objects themselves
00:13:44
and the connections between them are behavioral
00:13:47
patterns allow you to create effective
00:13:49
communication between objects here
00:13:51
already as far as communication is concerned, let’s say
00:13:54
between class objects and how it all works
00:13:57
we'll arrange everything there, too, have our own patterns
00:13:59
but we don’t want to give everything
00:14:00
attention generating detail but this is not
00:14:02
I know that I won’t talk about structural
00:14:04
I won’t bring patterns or for example
00:14:05
I definitely look like an adapter, for example a
00:14:08
strategy as there is also one person
00:14:11
wrote in the chat and many others
00:14:14
Yes, you still need to remember the principles
00:14:17
designing they are here too I have them
00:14:20
brought out the first thing, well, always always
00:14:25
need to be programmed at the level
00:14:27
interfaces and not at the implementation level
00:14:32
who doesn’t understand what he just said
00:14:35
please write to the chat what I know
00:14:37
if someone doesn't understand what exactly I mean
00:14:39
in view of programming at the level
00:14:41
Vanya interface at the implementation level
00:14:43
to explain there is also a second principle
00:14:45
which is called this
00:14:49
encapsulate everything that is
00:14:51
changes, that is, if you have, for example,
00:14:54
there are some changes in the class that
00:14:56
I mean class variables if anything
00:14:59
if they constantly change their
00:15:02
values, it’s logical that they are needed
00:15:04
encapsulate then make them private
00:15:06
and that they have separate functions for
00:15:08
working with them, well, that’s what I’ll do too
00:15:10
affect and
00:15:12
the third principle which is also this
00:15:14
composition what is composition if
00:15:17
what if someone doesn't know attack if
00:15:20
it's easier to say when we
00:15:22
instead of
00:15:25
just create a new class we create
00:15:29
a new class based on some already
00:15:30
existing classes and between them
00:15:32
there is a connection like this, for example from
00:15:35
exist at the university imagine
00:15:38
so that there is a university class and
00:15:41
he has a faculty and yes and between
00:15:45
university faculties have a close
00:15:47
connection strong connection because faculty
00:15:49
and cannot exist without the university
00:15:52
this is an example of a composition because there is
00:15:54
this is how it develops, let’s just say this
00:15:57
faculties and
00:15:58
this is the essence of the composition that we
00:16:01
created one big class with
00:16:04
some bunch of small ones is what
00:16:06
Regarding composition, this is the 3rd type and
00:16:12
Well
00:16:13
let's move on then, stop
00:16:17
give them more I'll ask right away who knows
00:16:20
what are the principles solid understands how
00:16:22
they work and
00:16:24
Is there any point at all in them?
00:16:28
pay attention please put
00:16:30
pluses in the chat again just to understand
00:16:34
So
00:16:39
By the way, by the way, the next slide is already
00:16:42
I'll switch because we're already here
00:16:44
let's start talking about the Paton generators
00:16:46
where will we do the practice?
00:16:57
hey, I don’t see something very well in the chat
00:16:58
someone can still be active with their soul
00:17:00
knows about salt they know what it is
00:17:03
principles as a result
00:17:07
I'll check again now and yes I see
00:17:11
plus or minus
00:17:12
let's wait a little longer, maybe it's clear
00:17:15
until others see here they wrote well
00:17:17
Thank you
00:17:18
then let's start already
00:17:21
talk about damaging cartridges what
00:17:23
regarding the principles of salt, I'm not talking about that
00:17:26
I'll forget about it yet
00:17:28
I will talk and explain what it is
00:17:32
in more detail if of course I hope
00:17:35
they will forget because after all, now I am
00:17:37
I want to draw attention to apb1 and although
00:17:40
I want to say that you understand the principles of solid
00:17:44
very useful for the pattern because
00:17:46
they are often used as I already said
00:17:48
when talking about the undyne vorsin principle
00:17:51
that they often use the ipad principle themselves
00:17:54
principles of fireworks they are often used in
00:17:57
padma
00:17:58
we are like a leg you said something passing
00:18:02
pattern are those cartridges that
00:18:03
allow you to conveniently create objects
00:18:06
some specific classes here is a list
00:18:08
these sub-striking patterns which
00:18:11
we will talk we will practice
00:18:13
right now we will start
00:18:15
the cat can be prepared by someone at the computer
00:18:17
its floors will now walk here
00:18:20
several repeated there are only five
00:18:23
factory method abstract factory
00:18:25
loner prototype rulers even I want
00:18:27
to say that they are pretty
00:18:31
how is it a little that they are simple here
00:18:35
Here you can give an example of a composition on
00:18:38
stove yes yes I will definitely bring it if I
00:18:42
suddenly I forget it happened please me
00:18:44
I reminded you that I will do everything and
00:18:48
well let's move on then
00:18:51
talk at all
00:18:53
what else go up to here they write that
00:18:57
we will not consider from others
00:18:59
there are no groups and we will consider them
00:19:01
because we have a lot of time and people
00:19:05
there is interest and the first patent with
00:19:07
which we begin our entire review with is
00:19:09
factory method that defines
00:19:12
interface and invite it if anything
00:19:14
Now I’m reading the wording that was demolished
00:19:16
you can’t write it down for anyone interested
00:19:18
hey allowing under classes to change type
00:19:21
created objects what is it anyway
00:19:23
such
00:19:24
because you see this diagram
00:19:25
which I already showed you
00:19:27
very informative 1 mana hockey and
00:19:31
Well
00:19:33
let's go then
00:19:35
welcome to come method
00:19:38
It all starts in the factory method with
00:19:41
interface let's imagine the situation
00:19:43
here we have a factory creation
00:19:45
smartphones yes we know what we have
00:19:48
different types of smartphones yes but all of them
00:19:51
not even smartphones, you can even take a shared one
00:19:55
kind of phones that exist
00:19:58
there are some keyboards there, these nokia ones there
00:20:00
sony ericsson there next to take some
00:20:04
cooler smartphones for example there
00:20:06
iPhone right there, some kind of Samsung, well
00:20:09
or something else like that and everyone and
00:20:11
I know what the phone can do
00:20:14
perform the call function and
00:20:17
everyone does it in their own way, that is,
00:20:20
each phone has its own implementation
00:20:22
this and this is where we create
00:20:25
call interface that is, the phone interface
00:20:29
which will unite, say, into a common group
00:20:31
that's all
00:20:32
phone numbers we will be here
00:20:34
create a smartphone in code, for example
00:20:37
belongs specifically to the background type because
00:20:39
but he has a telephone and he has his own
00:20:42
own
00:20:43
the implementation of the call is also for example here
00:20:45
we have a goal fund is cool
00:20:47
he also has a phone in his own way
00:20:49
some kind of implementation of this function
00:20:51
using examples the quality of communication so on I
00:20:54
I know this is pretty weird right now
00:20:56
sounds like I'm explaining the diagram maybe
00:20:58
But
00:20:59
now is when we start
00:21:01
practice it will become more clear
00:21:03
that's why I'm opening ours with you now
00:21:06
exactly
00:21:08
the whole bush studio code and we are now already
00:21:12
then let's start developing it like this
00:21:14
now then
00:21:16
I switch to
00:21:17
[music]
00:21:19
that is, super I’ll expand a little here
00:21:23
more
00:21:26
super, the terminal is already open for me here
00:21:30
And
00:21:32
t-t-t-there is a plantation lecture but I understand
00:21:34
what there is no no collection not panda
00:21:37
we don't have Trent Reznor's arrow today
00:21:39
will
00:21:41
solid solid won't fall off
00:21:44
use in absolutely any languages
00:21:46
50 each and object-oriented
00:21:49
programming languages
00:21:51
also pattern and design by the way
00:21:53
sorry forgot to say that it doesn't matter
00:21:55
what language are you programming in the project?
00:21:57
design patterns are being developed
00:21:59
and principles solid and principles
00:22:01
design can be used on
00:22:03
any guardianship in an oriented language
00:22:05
programming because and so as it were
00:22:07
say
00:22:10
pattern is a thing that does not depend
00:22:13
absolutely from the language of the program this is a thing
00:22:16
which is the solution to the problem, so what?
00:22:19
let's start then
00:22:21
develop and I'm already here creating ours
00:22:24
the first file will be our index. stoves
00:22:26
and we start with the first pattern
00:22:29
which we are considering is factory
00:22:32
the method can be immediately launched locally
00:22:35
server, by the way, tell me it’s ok already
00:22:38
if he sees it, that is, is it visible?
00:22:42
my daughter binary code is everything okay?
00:22:45
here are the types so you just know if it’s necessary
00:22:48
correct here I have already launched local
00:22:50
server
00:22:51
And
00:22:52
well then let's do this one
00:22:54
some example with phones, this is it
00:22:57
that it was already on the stove
00:23:00
let's start by remembering these again
00:23:03
that the phone has one thing in common here
00:23:07
function is to make calls every there
00:23:10
phone type can do it
00:23:12
differently and we will have an interface
00:23:15
which is called background and
00:23:18
it has only one function that is
00:23:21
which has no implementation but every
00:23:23
new running phone that we will have
00:23:25
created it will implement in its own way
00:23:27
this call function, that is, for example
00:23:29
we will have a class smartphone and it
00:23:31
will implement the function in its own way
00:23:33
count or for example we will have a class goal
00:23:35
background and he will also do it in his own way
00:23:37
and it will create smartphone objects
00:23:40
That's why it's called a factory
00:23:43
pattern factory factory method what
00:23:47
this is the factory it will be let's say
00:23:49
class main super class which
00:23:52
implement yourself interface background and it
00:23:56
and will create others of all types
00:23:58
smartphone
00:23:59
well let's do it then
00:24:03
creating our first
00:24:05
interface then we will have a simple
00:24:07
pan interface is not mandatory if anything
00:24:10
write the name background interface and how I
00:24:13
spoke on any phone
00:24:15
has one function, it doesn't ring a bell
00:24:19
this is if we have only one example
00:24:21
function because when will I speak
00:24:22
about the abstract factory there will be everything
00:24:24
much more difficult
00:24:25
that's basically what we have here
00:24:27
interface background as we know interfaces
00:24:30
there is no implementation of functions because in
00:24:33
all this begins to implement itself
00:24:35
already other classes and in this case here
00:24:37
we have
00:24:39
flask method and every next smartphone
00:24:42
which will be created it will be
00:24:43
inherit exactly this function ok
00:24:47
the next step is to create our
00:24:50
factory it can be called background factors
00:24:53
whatever you want to call it
00:24:56
and here is what will happen to us
00:25:00
we will be contacted
00:25:03
or fund factors in no case
00:25:06
implement yourself interface there
00:25:09
only has an addiction to it and
00:25:12
but precisely the objects that will
00:25:14
created through this class by smartphone
00:25:17
and the fun factory creates just that
00:25:20
new smartphone objects that will
00:25:24
implement yourself
00:25:25
the interface is fun and will be in its own way
00:25:27
implement the recall function, that is
00:25:29
bell function
00:25:31
Well, to put it simply, the whole logic
00:25:34
fun factory lies precisely in
00:25:36
just to simply
00:25:39
namely to create new types of smartphones
00:25:42
so let's get started right away
00:25:44
create
00:25:45
the first function that is on the plates here is
00:25:48
for example create salton meet RF
00:25:50
it will not return the background and
00:25:55
we have just come back new
00:25:58
an object
00:26:03
the following functions we will have it
00:26:05
create
00:26:10
the phone is also being returned because
00:26:13
what class c said they designed a smartphone
00:26:17
they implement themselves interface fund
00:26:19
which
00:26:20
gives them a mandatory function implementation
00:26:24
castle
00:26:26
under create in general and yes exactly here
00:26:30
you can see
00:26:33
just like that
00:26:36
then how exactly will the century be created
00:26:39
so just a second, consider the preview of the java section with
00:26:42
mines someone can see toxic for a second
00:26:46
sorry sorry I forgot to join I think
00:26:50
it will be better that way
00:26:53
I stretched it out a little here too
00:26:58
falling I see now I think better
00:27:03
in general, yes, we have a fun factory
00:27:06
and there is a main class that will
00:27:08
create us new phones that we have
00:27:11
us to implement ourselves this one
00:27:13
interface background interface that is it is
00:27:16
3rd grade has a cat which was said in
00:27:18
wording before
00:27:20
what do we get next we need
00:27:23
create further workshops and
00:27:25
class smartphone
00:27:28
In general, by the way, the example is very simple, but I
00:27:31
I'm trying to say it as much as possible now
00:27:34
to explain it so simply
00:27:36
there were no questions afterwards
00:27:39
we are now creating exactly the saphon class
00:27:43
there is just some kind of masonry
00:27:47
a phone that has everything of its own
00:27:50
own implementation of which function
00:27:52
spoke and
00:27:54
By the way, if anyone doesn't know what it is
00:27:56
general interface it can be said like this
00:27:59
well not exactly stripes
00:28:03
something like classes which where are you
00:28:06
you simply describe the functions that should
00:28:09
must have some specific
00:28:11
class but implement them in your own way
00:28:13
so that's why we have for example
00:28:15
here is the cola function, for example we have tisiz
00:28:18
smartphone and brick phone but they are both
00:28:21
implement this function of flasks differently
00:28:23
because for example it's a cool phone
00:28:25
maybe it's different there
00:28:27
there to compress the connection and there is a smartphone
00:28:30
for someone else to do something and when we create
00:28:33
For example
00:28:34
we definitely need a new class
00:28:38
create in it all the functions that exist
00:28:40
are registered in the interface in our case
00:28:42
there is a call implementation here
00:28:44
keys on the phone and here for example
00:28:45
will write hello, I'm calling, calling
00:28:50
you'll fix it but
00:28:51
let's better go there
00:28:54
smokie 303 or whatever this one is
00:28:56
was called
00:28:59
1022
00:29:01
so in general we have a keyboard
00:29:04
phone now let's create a smartphone
00:29:08
this is another class we have which is also
00:29:11
in its own way release a lot of call functions
00:29:16
we imitate here
00:29:19
he interface and now you need a smartphone
00:29:24
implement call functions for yourself
00:29:26
here we open the floor and here we are
00:29:29
we will not attribute
00:29:31
Hello
00:29:33
I'm calling from my smartphone
00:29:39
from ready and
00:29:42
so that we can see the flow, let's take a look
00:29:45
then it means we can do it like me
00:29:50
here I formatted a little bit of standards
00:29:53
So it turns out that we have a goal
00:29:55
background again we have a goal background
00:29:57
there are these two classes in March
00:30:00
implement yourself interface background
00:30:02
the interface is just a background and
00:30:06
when do these 2nd grades start
00:30:09
implement this interface with
00:30:11
using implements background they do what
00:30:14
they must have their own way
00:30:16
implement call functions like I already did
00:30:19
said that the interface allows
00:30:20
define some general functions of the class
00:30:23
which he must implement for
00:30:25
some group of even classes that
00:30:28
must still exist in these classes
00:30:30
but the implementation in each class of this
00:30:32
functions will be different in our case
00:30:34
there is a whole background for the class and a general smartphone
00:30:37
function for relays that are mandatory for
00:30:40
implementations are count and cell phone
00:30:43
a keypad phone will do things in its own way
00:30:45
calls and smartphones in their own way
00:30:47
does what concerns the background factors fun
00:30:50
factory in our case this is exactly
00:30:54
that is precisely the factory method that
00:30:56
allows you to create new objects here
00:30:59
these two classes
00:31:02
not directly, but through
00:31:05
special functions and
00:31:08
even you can remember this diagram that
00:31:11
it was shown there, that is, he is in my
00:31:13
target background and view she has a smartphone that is me
00:31:15
I hope this is already in your head somehow
00:31:16
I'm doing my best and by the way I see Andrey here
00:31:19
I wrote in the chat nokia 303 3310
00:31:23
then according to the fix, this is a little narrower
00:31:26
I forgot and it turns out that this is exactly
00:31:29
fun factory this is a factory method
00:31:31
which allows us to create or on
00:31:34
you can't call a new type of smartphone
00:31:36
what about this factory after all?
00:31:39
then we'll test it now and then
00:31:42
I'll demonstrate how it works
00:31:44
of course, as I did here in social security
00:31:47
namespace because after all
00:31:50
our example is somewhat simple and therefore
00:31:52
meaning
00:31:54
there is no legroom
00:31:57
then let's go straight to the background interface because
00:32:00
what will we have first?
00:32:02
call, give the link, we’ll connect and
00:32:08
next thing we connect and we
00:32:10
connect a class smartphone here
00:32:15
and of course the very end of our factory
00:32:18
creating new class objects has become a background
00:32:21
and a smartphone that implements itself
00:32:24
interface background interface in its own way
00:32:26
implements the count function
00:32:28
also connect from here
00:32:31
than the practical meaning of this I am now
00:32:35
by the way, I'll explain
00:32:37
Now I’ll even explain with an example of how
00:32:40
I had it on for starters let's
00:32:43
In general, we’ll test it all now
00:32:48
and by the way, now everyone after
00:32:50
let's test you can ask absolutely
00:32:52
completely any question and what is not clear
00:32:54
so that I can answer this and so that we
00:32:57
basically everyone could move on
00:33:00
starts with what you can notice
00:33:02
that we have one factory here, that is
00:33:04
we don't have to somehow create each
00:33:07
running separately we have a factory
00:33:09
which can in some sense
00:33:10
groups these two classes whole background and
00:33:13
smartphone
00:33:14
and for example, I want to create for example
00:33:16
get yourself a keypad phone
00:33:19
I do not create it through the classes themselves
00:33:22
we don't create for lunch, I just create you
00:33:24
through the factory I'm here taking and calling
00:33:28
function stick your virginity yes
00:33:32
here I am creating a new masonry object
00:33:35
phone I want a smartphone I'm creating for myself
00:33:37
new smartphone
00:33:38
yes and
00:33:40
this is where we get to the heart of the matter
00:33:45
the logic of what is being created cannot be tolerated
00:33:47
factory
00:33:49
what is being created please tell me what
00:33:52
you just pretend to
00:33:54
a little question about Nepal
00:33:56
it's just
00:33:59
later we will talk about becoming an agent
00:34:00
by the way, about a lot of interesting things
00:34:02
much simpler in general let's see what
00:34:05
we have a factory
00:34:06
which creates these types of objects
00:34:09
that is, object classes
00:34:11
you can just look like this here
00:34:14
is creating some kind of
00:34:15
a specific group of objects
00:34:18
which from the classes which has in common
00:34:20
the interface is occupied by only one class
00:34:22
this is the first thing you need to notice
00:34:24
there is this fun factory and
00:34:26
interface gives these two classes again I
00:34:29
I repeat sorry that sometimes I can
00:34:31
repeat I just want it all
00:34:32
remember that the target is the background and smartphone
00:34:35
improvise yourself interface background
00:34:37
interface or just background with implementation
00:34:41
call functions but each of these classes
00:34:43
implements the call function in its own way
00:34:45
the smartphone will be somehow from
00:34:47
call and the keypad phone in its own way and
00:34:50
we create these new objects or on
00:34:53
through special factor and factor this
00:34:55
special let's say factory
00:34:58
which creates for us new objects of this
00:35:00
and even here you may not necessarily
00:35:04
just don’t think that during the course everything is somehow
00:35:06
this is how it will be
00:35:09
to always be back only
00:35:12
but the object here can be done in your own way too
00:35:14
customize the creation of new objects
00:35:16
in general, let's have shame in it
00:35:20
then create a new object and
00:35:21
I can do it my way here in each case
00:35:24
call your own implementation
00:35:27
function count of these two objects that is
00:35:30
Here, for example, places the fund in its own way
00:35:32
I implement into light from the function, that is, with
00:35:34
of his realization to ask he to call this
00:35:36
function of a smartphone with its implementation
00:35:41
So
00:35:45
if creating a phone or smartphone
00:35:48
clogging depends on some variable
00:35:50
amounts this is interesting this is interesting then
00:35:53
is you mean that if for example
00:35:55
we have the creation of new objects
00:35:59
yes that is, if we need to implement
00:36:01
creating a new object
00:36:04
there's a smartphone or there's a phone just from
00:36:09
some variable so that it depends
00:36:11
from this but it can be done in a simple way
00:36:14
checks, that is, it does not depend on
00:36:16
right in the thick of it
00:36:18
what we mean here is exactly what we have
00:36:21
there is a common group of phone classes
00:36:23
for example, a cell phone smartphone is also there
00:36:25
some may be so that
00:36:28
it wasn’t like we had them separately
00:36:30
create their objects
00:36:32
then here we use fanfiction you
00:36:36
which each one creates for us separately
00:36:38
new class object and
00:36:41
as a result, we can continue with them
00:36:44
use it but you don’t need it here yet
00:36:46
all each of these phone classes
00:36:49
having your own implementation function is one thing
00:36:51
yes let's read further here
00:36:53
questions that is, in general, so that the crowds in
00:36:56
answer to if creating a phone or
00:36:58
smartphone depends on some variable
00:37:00
the amounts here could be simply done
00:37:02
the most common check
00:37:04
exactly
00:37:05
or
00:37:07
and inside cos a fun factory itself
00:37:11
or here just right for at least
00:37:13
check there I don’t know what kind of change
00:37:15
well, or better yet, I would have done it
00:37:18
then inside the fun factory because I
00:37:20
I say that there may be implementations here
00:37:21
do for example if we had
00:37:23
let's imagine what we have
00:37:24
from private variable
00:37:28
for example I don’t know the account there
00:37:31
balance yes here we turn to it
00:37:34
to check your account balance there
00:37:38
there is no longer there for example a herd that is
00:37:41
this is how I see it could be
00:37:43
implement
00:37:44
I also think it’s better to do it anyway
00:37:46
checking against some change specifically
00:37:49
inside the fact itself and and convey already
00:37:52
there is a balance within itself
00:37:54
constructor this can also be done this way
00:37:57
if we added properties type class a
00:38:00
it would be cool if they didn’t create the texture
00:38:02
would each class be a separate function?
00:38:05
I completely understood
00:38:07
this is a factory method this is just a factory method
00:38:10
method factory factory method that is
00:38:12
can you say this in general about her?
00:38:14
talk factory method abstract
00:38:16
the factory there everything is much more interesting there
00:38:19
we create separate factories if we
00:38:21
for example, they just created one here
00:38:23
a factory that creates objects for us
00:38:25
class that being with an abstract factory we
00:38:27
first we create separate factories, how many
00:38:30
we want and through them we can create
00:38:33
more much more different let's say
00:38:36
class objects so let's do it already
00:38:38
let's go to the browser because
00:38:42
we need to test our flow
00:38:45
here it turns out like this now I’ll create it
00:38:47
new window
00:38:49
I'll open it now, let's take a look right away
00:38:53
localhost 8000 until we open now
00:38:58
the cookies
00:39:01
window capture
00:39:05
that's all we got
00:39:08
makes it obvious that everything is very simple we
00:39:10
called
00:39:12
just for the function, that is, hello
00:39:15
I'm for down nokia 3033 10 2020 at
00:39:19
call this smartphone
00:39:20
gives in to the logical question of what
00:39:24
the point of it all let's do it again now
00:39:26
let's take exactly the diagram we have
00:39:29
was shown to you
00:39:32
look at him, I think you are
00:39:34
here you can see the essence by the way
00:39:38
not here I would like to say something like this
00:39:41
what is the version of the factory that showed
00:39:42
called symbol factors are also here
00:39:44
a little different version watch
00:39:47
carefully
00:39:48
we have it here, it's just me
00:39:51
I had a version without, let's say
00:39:54
these two let's say classes in this
00:39:57
case and
00:39:59
here for example I had just here
00:40:03
one plant, that is, if we have for example
00:40:05
background crackers smartphone creator then I have
00:40:08
in my case there is only one plant which
00:40:10
created me objects of classes target background and
00:40:14
smartphone which you will take over
00:40:16
interface but they implement it in their own way
00:40:22
more immediately 2 ask and ask
00:40:25
be sure to ask questions that you don’t need here
00:40:26
I see because I'm now let's
00:40:28
I’ll repeat again, what is it used for?
00:40:31
this one so here we have some
00:40:34
certain classes like this one
00:40:36
we had phones that has some kind of
00:40:38
one common function that is mandatory
00:40:40
must exist in everyone
00:40:43
just like that
00:40:46
Let's say this in this class and let it be
00:40:48
convenient to create and run from these classes
00:40:50
we create a separate super class which
00:40:53
creates types
00:40:56
it creates these objects of these classes
00:40:59
to which the interface was inherited
00:41:01
which
00:41:02
let's say do it so as not to
00:41:04
necessarily implemented one common
00:41:06
function only from its implementation and in
00:41:10
in general, with the help of a creator, that is,
00:41:12
in our case it was the background facts we
00:41:13
create new objects there of any class
00:41:16
which we need is a siphon there or there
00:41:20
smartphone because in general we could
00:41:22
create separate cell phone factors or
00:41:24
there are smartphone facts that would also happen
00:41:26
right and they could do it at all
00:41:28
inherit even an abstract class
00:41:31
will hide what would also be correct
00:41:32
example
00:41:35
yes yes, Andrey wrote it very correctly
00:41:39
in fact, the factory creates instances
00:41:41
class with a certain method of general
00:41:43
interface yes there is a common interface yes
00:41:45
there is a common interface with a common function and
00:41:47
every class you can get into the factory
00:41:51
just combines all these classes
00:41:53
which have one common function only
00:41:56
with their implementation and they are still
00:41:58
incriminate themselves from the interface and
00:42:00
thanks to this factory we can calmly
00:42:02
create all these just such objects
00:42:06
and all these objects but classes
00:42:10
[music]
00:42:11
created by the object they depend precisely
00:42:13
interface from interface here
00:42:15
this principle is adhered to
00:42:17
said to program at the level
00:42:19
interfaces and not at the implementation level
00:42:21
what is this anyway because I
00:42:24
it seems when there was an introduction it wasn’t quite
00:42:27
told me what it is
00:42:29
interface level programming
00:42:31
that's what you just saw
00:42:33
there was programming for the interface on
00:42:35
interface level because we created
00:42:37
interface that united let's say
00:42:40
group faucet class in our case group
00:42:43
class you there phone and up
00:42:45
prescribed common functions that are for them
00:42:48
exists in our case this is the count that is
00:42:50
every phone can make a call
00:42:52
united this group and these classes there
00:42:55
phone they depend on this interface
00:42:57
and this already allows us to say so
00:43:01
group first and second
00:43:04
This
00:43:05
gives an immediate sign that each class
00:43:09
implements this function in its own way and this
00:43:12
often used it is very useful
00:43:14
because this way we can say
00:43:17
so share all this and all this in general
00:43:22
let's say it's convenient to do and create
00:43:24
objects precisely through the factory so that we
00:43:26
were not created separately so that everyone
00:43:27
new class objects were created through
00:43:29
factory so that this is even delegation
00:43:32
it also shows what it is
00:43:34
delegation
00:43:35
this whole design topic is
00:43:38
when we, instead of ourselves
00:43:40
create an object this is passed to some
00:43:42
not not always even by the creation of this we
00:43:44
we call certain methods that
00:43:46
other classes will perform there
00:43:49
fulfill
00:43:50
work
00:43:52
some value let's say structure
00:43:55
that is, we can say 1 2 on
00:43:57
structure where everything from let's say
00:44:02
built with small classes which are in
00:44:05
in general, in the end it does some kind of
00:44:07
one common function just everything is much
00:44:11
clearer and structuring can be done too
00:44:13
this is how to describe it
00:44:15
so let's move on
00:44:18
that means we had a factory method
00:44:20
the person asked for the strategy I want
00:44:24
talk about it right now
00:44:26
pattern because there will be a lot here
00:44:28
interesting funny example I prepared
00:44:30
so I'll turn off window capture for now
00:44:32
I'll switch to our code right away
00:44:37
please ask questions what to whom
00:44:39
it was unclear to whom exactly
00:44:42
factory method and so on
00:44:46
so I just know so I can explain
00:44:48
Now
00:44:50
as long as there is someone in the chat there will be something
00:44:52
write, I’m deleting all these for now
00:44:54
let's even give an example for strategy
00:44:57
now let's create a separate folder
00:45:01
for ours with you
00:45:03
It’s easy to create a public page here
00:45:06
factory folder and here
00:45:08
I'll upload all the other files that
00:45:11
we created this factory folder here and
00:45:13
let's create a new folder right away
00:45:17
which should be called
00:45:21
we will have an example with ducks here, let's say
00:45:25
So
00:45:27
Let's just imagine a situation like this
00:45:32
you have a task when you need it
00:45:36
create different types of ducks yes that is
00:45:39
there
00:45:40
for example there is some kind of red vodka
00:45:43
you can come up with whatever you want
00:45:45
iron grip or you know the hunters
00:45:48
use some kind of aromatic duck
00:45:50
to attract other ducks find yes
00:45:52
and let’s imagine a situation where we
00:45:54
we need to clearly do so that we can
00:45:59
anyway
00:46:02
create correct classes of duck objects
00:46:06
however, we didn’t have to somehow
00:46:08
inherit other unnecessary methods there
00:46:11
we really need to call here
00:46:13
add some of our duck there too
00:46:19
in general there are functions of the class and so on
00:46:24
I’ll repeat the rural questions about
00:46:27
pattern factory just so I know
00:46:29
if there are any misunderstandings at all
00:46:31
write absolutely all the questions that
00:46:33
you think there is I, of course there is we
00:46:36
for now let's start with the example of ducks and
00:46:40
let's think about what a duck actually does
00:46:42
well, in our case, to make ore
00:46:44
a duck can eat us, for example, but
00:46:46
there is a day that can fly but cannot fly
00:46:49
flying is the first characteristic that
00:46:51
which we will have to pay attention to
00:46:53
attention we need to do so
00:46:54
you could choose the duck can fly
00:46:56
or not
00:46:58
next thing we need to do
00:47:00
this is just the same
00:47:04
for example, vodka, be able to quack there and
00:47:07
the second thing we need will be implemented
00:47:10
this is what you need to choose and do
00:47:13
its implementation is precisely quack here
00:47:16
it's best to use it
00:47:19
pattern is not a factory method, namely how
00:47:23
anyway
00:47:25
strategy what does the strategy pattern do
00:47:29
we can say that it determines
00:47:31
family of algorithm in which it
00:47:33
exists and each of them encapsulates
00:47:36
into yourself
00:47:38
these are the common ones
00:47:40
characteristics and provides them with these
00:47:43
all class and you, regardless of the angle
00:47:47
1st grade you can do them regardless
00:47:49
modify what exactly gives
00:47:52
just a weak connection, which is very
00:47:55
useful and used on the side
00:47:57
client
00:48:00
Today we are only generating patterns and
00:48:03
look no not only generating even
00:48:05
right now what I wanted to say is we already
00:48:08
look at a non-generating pattern
00:48:11
I forgot a little about which group
00:48:13
structural cartridges is the strategy
00:48:16
if I'm not mistaken neos generating yet
00:48:19
not everything I'm just a person wanted to see
00:48:22
on strategy and I just want to show
00:48:25
exactly this pattern
00:48:27
so let's do something quicker
00:48:30
Let's take a look and then come back to
00:48:32
generating
00:48:34
well as I said torture and can fly
00:48:37
in our example and can croak whatever
00:48:39
it's all to do so that it's all in
00:48:41
independently of each other
00:48:43
the first thing we will have here we will have
00:48:47
the interface, of course, wouldn’t be wet without it
00:48:49
interface
00:48:51
for each type y so for implementation
00:48:55
it is the issue of flight that will be created
00:49:00
use a separate class which
00:49:02
will, for example, give up to 20 ducks like her
00:49:06
must fly yes she will be here just
00:49:09
interface fly interface let it be so
00:49:12
be called where be just on
00:49:13
function just just function flight
00:49:16
if then
00:49:17
again with mine that there is vodka which
00:49:20
can't fly and what else should we have
00:49:22
what other interface should we have?
00:49:24
be it quacking that is just
00:49:28
the frog should not be confused because I
00:49:30
I say clock in general yes give it
00:49:33
let's create yona will be here
00:49:35
exactly one function that allows
00:49:37
quack the ducks then
00:49:40
this is also a public method
00:49:44
croak and ready super great then we
00:49:50
what we need to do next is imagine
00:49:52
the situation that we have ordinary
00:49:55
some kind
00:49:56
so wait a second I wrote a question here
00:50:00
one patent may contain another or
00:50:02
others, yes maybe, absolutely like that
00:50:04
maybe it's called related patterns in
00:50:08
We won’t consider this today, but
00:50:09
there is one and then you can say
00:50:13
harmonious interactions with each other
00:50:15
the paste is built into a harmonious
00:50:17
interaction between your Paton and
00:50:19
back to the topic
00:50:20
let's first create a class here
00:50:24
which will indicate vodka that it
00:50:26
can fly with wings that is a duck
00:50:28
who can fly with wings can
00:50:30
use this class flags
00:50:32
sphinx lazy sphinx and immediately logical
00:50:37
come to the conclusion that we should be here
00:50:41
increment the interface
00:50:43
[music]
00:50:45
exactly
00:50:49
interface to interface exit simply
00:50:52
install and
00:50:53
here we have a public function with
00:50:56
by its implementation, that is, if for example
00:50:57
this is like the eye that is responsible for
00:51:00
then to fly with wings then
00:51:02
here we will simply output for example
00:51:06
flight or
00:51:10
Let's imagine the situation that we have
00:51:12
now it is
00:51:13
like name is Alex that is to fly without wings
00:51:17
there will also be its own implementation of the function
00:51:20
fly from the interface fly interface that is
00:51:22
these two class of life with wings to
00:51:24
fly me for tanks implements in its own way
00:51:26
flight function for ducks further
00:51:30
let's have class
00:51:32
name is Vince
00:51:35
compliment
00:51:36
la interface
00:51:39
I will repeat again if anyone has
00:51:41
some questions are a must now
00:51:43
hear so that you can simply answer like this
00:51:46
there is a plo function and here it will be simple
00:51:47
write us and I just can’t fly
00:51:50
will
00:51:54
Fine
00:51:56
it behooves me to do it this way
00:52:03
how many times does he encounter
00:52:05
all implementation of the pattern by the developers
00:52:07
examples from books on wheelbarrows and
00:52:10
only these could bring real ones
00:52:11
which I can face
00:52:14
example if you are interested Konstantin
00:52:17
which concerns me personally which
00:52:19
had your own files or an example
00:52:23
even more of all this concerned precisely with
00:52:27
work and if so you are interested but
00:52:29
come on now we don’t need the car
00:52:33
newbies, well, I don’t agree with you here
00:52:35
because still to understand
00:52:36
structure needed a trivial example
00:52:38
bring and so on so let's
00:52:40
we come back and fly wizard winx that is
00:52:43
fly with wings like I said she's boobs
00:52:47
. means it can’t have two classes
00:52:49
flyers swings and fly wizard winx that is
00:52:53
it had the function of flying shot or
00:52:55
without but this one depending on what you have
00:52:57
we will be a duck because he said that
00:52:59
duck byte different imagine
00:53:01
the situation that we have for example now
00:53:04
general class
00:53:06
which is called dark and
00:53:09
what will be the essence of the situation with
00:53:14
using this class we will create
00:53:16
all the fishing rods that are convenient for us
00:53:20
here we create a class like this
00:53:23
just a duck and
00:53:26
take away from the construct
00:53:28
constructor must be created
00:53:31
now I'll explain why and
00:53:34
or here we meet already
00:53:36
just an interesting moment
00:53:39
there is a private function
00:53:42
whose function, for example, is responsible for
00:53:45
fly by kate clapp
00:53:47
or something like that
00:53:50
this variable will be stored as
00:53:52
after all, one of the objects of our class
00:53:55
who is in charge of the flight and we are in
00:53:57
in the future we will call you to fly
00:53:59
so here we write fly by him a
00:54:05
equals like a fever which we will
00:54:08
pass it through the constructor
00:54:11
folding now with croaking function
00:54:14
let's have a little
00:54:16
before we wait and figure it out first
00:54:19
exactly the back so that .
00:54:21
could fly and what do we see here
00:54:25
right here in the class constructor
00:54:28
there is a point in the class we will transfer
00:54:30
new object or flags sphinx or fly
00:54:33
wizard and does not cost 100 what is responsible for
00:54:35
flight
00:54:36
this is where the new object is inserted
00:54:38
one of these classes or something else
00:54:40
someone who is responsible for the flight
00:54:42
to yours on the site
00:54:43
flight we have a private fly function
00:54:47
quiet, let me do encapsulation right away
00:54:51
to hide this variable of others
00:54:53
classes
00:54:55
this is where we will call this
00:54:58
question that concerns but let
00:54:59
call
00:55:01
fly by her to make a flight like us
00:55:05
make alpha and immediately appears
00:55:06
the question is how it will work here
00:55:09
you can already guess that we can either
00:55:11
use the abstract class so that
00:55:14
make a big abstraction to
00:55:17
then somehow inherit this function
00:55:19
but in the data in this case so that it is
00:55:21
simpler, let's fly in our case
00:55:24
let's do it
00:55:26
here we have fly and
00:55:30
how will the fly function be called even
00:55:32
you can guess what could happen here
00:55:35
and for the meter there is some kind of interface there
00:55:36
general vodka but this is not needed yet and
00:55:39
yes roll out the date that caused mine
00:55:43
biheight
00:55:44
here owes the fly function
00:55:48
Well, actually we have some kind of duck and this
00:55:51
the general type that is issued is created
00:55:54
that in the future it turns out that we
00:55:58
when you create new types like this
00:56:01
there is, for example, some kind of red duck there
00:56:03
something like that we should always
00:56:05
we will indicate exactly how
00:56:07
must fly and this is indicated precisely with
00:56:10
with the help of these two classes there if
00:56:12
that class classes can be limited
00:56:15
not only this quantity can be created
00:56:17
I know other classes like a car
00:56:20
fly but this is purely for example
00:56:25
what we can do next we can
00:56:28
create a new type of duck for example this one
00:56:30
we will rarely go there with red
00:56:33
that's what it's called a head
00:56:37
exactly
00:56:40
So
00:56:43
she can already begin to understand herself
00:56:50
the spirit to inherit just like that yes
00:56:53
it inherits itself like this
00:56:57
or even if you think so and
00:57:01
now just trying to come up with a better one
00:57:03
the structure could even be done like this
00:57:05
it even seems like an abstract eye to me
00:57:07
somehow more
00:57:09
more logical than simple
00:57:12
exactly and
00:57:14
create a regular class yes let's do it
00:57:16
let's do then doct then to abstract and
00:57:21
then I will already inherit you if so
00:57:25
look then think about it I think it
00:57:28
it will be quite enough
00:57:31
we just have red hat duck and
00:57:36
wolf immediately question flows down okay you
00:57:39
want to create a new duck that
00:57:41
for example, it implements flight in its own way
00:57:47
place fly by her and we can use
00:57:48
doha interface question what is it
00:57:51
no no no you can if for example we
00:57:54
we write in Java I would like to too
00:57:56
come to attention that after all when you
00:57:59
you use patterns and small differences
00:58:01
depending on the language
00:58:03
programming you use mod can
00:58:05
be absolutely
00:58:06
but for me personally this is just the same
00:58:11
Can
00:58:13
using in this case we for fly by
00:58:16
he wears using new objects and
00:58:20
here we have a countdown class like this
00:58:25
how logical it is to guess here already
00:58:29
exactly we begin we followed exactly and
00:58:31
color yes, that is, if the class was inherited
00:58:34
doc and and it’s logical that when we create
00:58:36
the row of moves to us needs to be specified like this
00:58:38
the duck will fly let's do it right away
00:58:42
then let's move on, someone will start
00:58:44
test from this
00:58:45
let's go to Yandex dot php
00:58:50
immediately give the spatki strekach
00:58:53
interface
00:58:56
interface which difference is responsible for
00:58:59
flying
00:59:01
life took
00:59:07
then we immediately tighten the class that
00:59:11
for example, the flight is different
00:59:17
we have and
00:59:21
then we can get it right away
00:59:25
strategies like this. peppy, by the way, if anything
00:59:28
I remind you if anyone has questions
00:59:30
you can write, I’ll answer them, you’ll get them
00:59:35
red hat
00:59:38
only here are the folders
00:59:44
.
00:59:52
Let's then immediately create a new one
00:59:54
the boat is like this before now the browser
00:59:56
I'll see what we can do if
00:59:59
error no no delivery screen
01:00:02
well let's create it then
01:00:05
red head duck
01:00:09
long ago here immediately indicated from 5 doc and
01:00:13
here we need to indicate what we want
01:00:18
use
01:00:20
that type is exactly the Russian chance
01:00:24
bastard cops we can either through the construct
01:00:26
indicate the type of flight, that is, what should
01:00:29
used to fly
01:00:32
or we must indicate
01:00:34
exactly
01:00:36
so to speak
01:00:39
Well, through the Satra guitar function too
01:00:42
option it didn’t just occur to me
01:00:44
got a little distracted and
01:00:46
let's do it here right away here I am
01:00:48
created a new kodak object
01:00:53
don't forget the comma here
01:00:55
put and
01:00:58
let's open it right away even after
01:01:00
let's see what we got there
01:01:02
nothing that unusual
01:01:05
so there it is and I made it a ward
01:01:10
look carefully we have
01:01:11
here it turns out we have nonsense
01:01:14
which inherited just the same
01:01:17
clutches then we get what she has
01:01:22
there is a flybe hey if only for this
01:01:24
In this case, we did not indicate which class
01:01:26
must be responsible for the flights of this duck
01:01:30
micro from laptop just cloud yes I have it
01:01:34
just how can it be on a mac
01:01:36
pretty loud like that
01:01:39
you'll hear exactly these loudly
01:01:42
how do I write on the keyboard, well, in general
01:01:44
now we need to determine exactly how
01:01:46
this vodka will continue to fly
01:01:48
call the fly function
01:01:50
well here you can already guess about
01:01:53
sense
01:01:54
pattern strategy
01:01:57
so now I'll return to the code yes
01:02:01
this is where you see that we are here
01:02:04
we determine what exactly should be
01:02:06
in charge of the flight we are here
01:02:07
we allow ourselves to modify exactly that
01:02:10
how this or that duck should work
01:02:13
this could be done even in
01:02:14
class here yes for example in red hat doc
01:02:18
but you made it possible
01:02:20
do through construct
01:02:23
what needs to be done here we want
01:02:25
determine how it will fly to the show.
01:02:28
I create but also
01:02:31
Oh, by the way, the code I’m writing now
01:02:34
you could even be transferred from dreams
01:02:36
in this case, how much did I inherit?
01:02:39
I decided let's do this
01:02:41
fly with wings vodka for sale then to me
01:02:44
you don't even need to create an effect like this
01:02:46
Reminds me a little, by the way, because
01:02:49
operators and in general that's what
01:02:52
it turns out that we indicated exactly what
01:02:55
a duck can fly with wings up let's
01:02:58
Let's open the browser again and see what's on
01:03:01
this time only I will show us the ward
01:03:04
I'll reload the page here
01:03:09
weaker opens ok ok I understand
01:03:13
error
01:03:14
it means we didn’t inherit it right away
01:03:18
we can do this differently
01:03:22
I can very often get confused simply with this
01:03:25
these constructs
01:03:28
so we can take it right away then
01:03:31
then we'll make everything much simpler so that we don't
01:03:34
we had to learn somehow and we’ll do something
01:03:37
by encapsulation that we will have a function
01:03:41
set you
01:03:45
I also adhere to the principle here
01:03:48
capsules what if we have examples
01:03:52
which changes somehow is mine for
01:03:55
working with it we do separate functions
01:03:57
for example public functions and fly
01:03:59
which allow you to set the value of this
01:04:02
straight and end fly which allows
01:04:04
cause cancellation if someone has now
01:04:07
If you have any questions, please write to the chat and
01:04:09
At once
01:04:10
in this case let's do what
01:04:13
when we create new designs guys
01:04:15
ducks what have
01:04:18
we get to call a dozen
01:04:21
like
01:04:23
because so red-headed duck
01:04:25
for example, there we'll do it together
01:04:29
will be able to fly using set fly
01:04:32
[music]
01:04:35
that is, and again it will just be
01:04:40
Good you
01:04:43
We can call this function later
01:04:45
let me check the browser now
01:04:47
she brings it down to now everything is correct
01:04:50
I did everything right
01:04:52
now I'll switch directly to the browser
01:04:54
look how I said it, that is
01:04:57
we already have a fly with wings class
01:04:59
accordingly we can call and here
01:05:01
now the fly function and
01:05:04
and here are my customize and here
01:05:06
this moment which concerned
01:05:10
we could change
01:05:12
peecher that is, what will answer
01:05:15
for flying ducks
01:05:17
here the names are dynamic change
01:05:20
algorithm and don’t have to re-pisa
01:05:23
rewrite the flight function
01:05:25
himself
01:05:27
dragon so we just replace it
01:05:31
a class that describes some kind of
01:05:34
flight for example there fly ds winx there
01:05:36
fly with wings or fly wizard
01:05:40
Winx for example I don’t know if it exists
01:05:43
such nature but
01:05:44
the facts are that in the case
01:05:48
quantitative critical situation when
01:05:50
we need to change what will happen
01:05:52
you are simply responsible for the fly function
01:05:55
replacing a class simply replacing a class
01:05:57
which implements this function in its own way
01:05:58
and this is a strategy, that is, of some kind
01:06:02
I mean, that's the way it is, that's the strategy that
01:06:04
we simply change it to the one we need
01:06:06
to the story there is a faucet
01:06:10
let's call it right away then
01:06:15
Here
01:06:16
fly function
01:06:20
it should work one hundred percent because
01:06:22
that mine was inherited precisely from the function
01:06:25
yes yes and
01:06:27
fly exactly the same here you are only
01:06:30
we need to ask from fly this is already there and
01:06:32
respectively
01:06:35
now for red when to do this
01:06:39
the flight function will be performed precisely
01:06:41
cool Slavik let's move on right away
01:06:44
the browser now that it has registered it and
01:06:49
photo I'm opening the chest now
01:06:54
if if when you download it will be simple
01:06:56
flying with wings I'm any moment now
01:06:59
I can change this to fly wizard winx
01:07:02
let's do it right away that you just
01:07:04
understood the essence of what the essence of Patorn is like
01:07:07
changes exactly families of algorithms
01:07:10
so okay let's say studio year for example
01:07:13
I can immediately change the order here
01:07:16
like a phoenix and
01:07:20
at the same time, I will not experience any
01:07:23
problems or something like that, that is
01:07:26
I don't have to rewrite it myself
01:07:29
function during there rarely if it
01:07:32
existed because for this already
01:07:33
answer a separate class and here
01:07:36
same example of delegation delegation
01:07:38
sorry what the
01:07:41
one function is answered separately
01:07:44
class this is not loading but I can’t
01:07:46
fly and yes because I just changed
01:07:49
there for another class which
01:07:51
is already responsible for flight without wings and
01:07:54
this is exactly how you can change
01:07:57
itself the behavior of the algorithm itself
01:08:01
we have for the implementation of one
01:08:04
functions of an integer class like duck
01:08:06
corresponds to a separate class class which
01:08:09
there may be fly winx and so on
01:08:11
which will inherit, for example, the interface
01:08:14
fly that is, the flight interface with
01:08:17
implementation of fly functions
01:08:19
just really using this pattern
01:08:23
change the implementation of some kind
01:08:26
one function just changing trivially
01:08:28
creating changing
01:08:30
then which class should be responsible for
01:08:33
this or that function and that’s not all of us
01:08:35
only one function was given here
01:08:37
add also quake let's do this
01:08:38
We'll do it quickly if anyone has a question and
01:08:41
let's immediately with 2 those therefore because
01:08:43
this pattern strategy
01:08:45
I hope we still have time to jump and
01:08:48
factorial because I have little time
01:08:50
I thought the director would quickly sort everything out
01:08:53
pattern and very interesting and that's why it's so
01:08:56
and even now you can create another
01:08:59
like so
01:09:00
I was talking about exactly croaking croaking
01:09:05
So
01:09:06
quack princess here we go now
01:09:09
Let's quickly implement it there then
01:09:12
For example
01:09:14
ah fact high high tones there
01:09:19
for example, the prize is some kind of duck duck
01:09:21
club
01:09:22
sit here right away cool
01:09:25
How
01:09:35
interface yes, that is, and here it is already
01:09:38
its implementation is underway
01:09:41
functions like those that ducks allow
01:09:43
indicate how she wants for example there
01:09:47
make sounds with cracks yes
01:09:48
I imagined writing loudly
01:09:55
here, for example, there will be a contribution on the board
01:09:58
crack
01:10:00
to that . quacks in low tones when
01:10:03
by myself
01:10:06
I don't know about the example
01:10:10
there
01:10:12
in the lower octaves that's what I wanted to say
01:10:15
that is, despite the fact that this is this like this
01:10:17
knows how and here we are too for Mickey Rourke
01:10:19
the interface will also be its own
01:10:23
implementation of nations clock and
01:10:26
in this case we have to
01:10:30
echo
01:10:32
I'm kind of low
01:10:36
super colors it's ready now let's
01:10:41
let's go back to our class doc and how are you
01:10:47
baxis function as
01:10:51
up to 23 patterns is unlikely to be an aspen order
01:10:54
Let's hang out for a day, that's of course the main thing
01:10:56
just understand the essence and I will continue
01:10:59
I’ll explain which ones are better to study tap dance
01:11:02
it's good that everything is clear, thank you so much
01:11:06
let's move on then and logically
01:11:09
that is, we have a function
01:11:10
quack we need to create a new one
01:11:12
how to glue a hidden variable
01:11:18
this is where we implement in our own way
01:11:20
function as which will be called
01:11:22
through the seeds, as it were, hair, that is
01:11:25
variable which will be responsible for
01:11:27
call classes which is different there
01:11:29
bookmarks yes, here's what you think about varnish and what
01:11:33
in the future we definitely need
01:11:35
create because here we are
01:11:36
we adhere to the principle
01:11:38
they encapsulate this is what changes
01:11:40
make do with the cave you indicated by the way
01:11:42
It would also be possible through the constructor
01:11:44
do
01:11:45
which ones I went to initially and then
01:11:47
changed my mind deprived via atari
01:11:50
assigning a value to this variable
01:11:51
we put it in too
01:11:53
it's worth the next one to which we have
01:11:56
will be called exactly
01:11:58
function exactly how
01:12:00
with this variable which we will pass
01:12:03
let's connect everything right away
01:12:06
other interfaces classes that we
01:12:08
needed here
01:12:10
until the important moment I would like
01:12:13
notice that when you use
01:12:15
pattern strategy gets you there
01:12:18
such a situation that since classes
01:12:22
is growing greatly because we have
01:12:24
each class is responsible for some
01:12:26
there is one function of some big
01:12:28
class then a large one is created
01:12:31
number of classes but in general it’s there
01:12:33
normal and in a sense you are now
01:12:35
you can see the composition because we
01:12:37
let's assemble a doc class from some
01:12:39
separate classes, that is, there
01:12:42
quart but they are of course in their own way
01:12:44
assigned but this is all
01:12:46
vodka collects us from other classes
01:12:49
we modify simple ones in our own way
01:12:52
means we need to take this further
01:12:55
this is no longer a planter face, this is a flag interface
01:12:58
crack interface ask with frogs
01:13:00
now he's confused
01:13:02
what do we need to do with this right away?
01:13:05
if you have interface quarks you need
01:13:07
take a hack quack and be sure to connect
01:13:12
so here to say it like this
01:13:15
a large number of classes and is coming
01:13:17
mark yes you realize perfectly well that
01:13:20
after all, it was in vain that I said that there is no need for
01:13:23
in this video in this kicked use
01:13:25
space
01:13:26
it would be much better with this
01:13:29
ok great so I think I'm done
01:13:32
connected so we needed
01:13:34
run to red head
01:13:37
and now our duck which
01:13:41
there will be a red head
01:13:43
cry on higher planes nude yes at least
01:13:47
somehow there is now a quacking in this
01:13:51
ducks will meet the grades and quick in
01:13:53
in any case you can perform on
01:13:55
any other class that
01:13:56
implement yourself interface
01:14:00
[ __ ] the interface and it will be in its own way
01:14:03
implement this exact function immediately
01:14:06
we can call this function let's go there
01:14:09
for example from hit like this
01:14:12
so let's move on right away
01:14:14
Let's look at the browser now, by the way
01:14:17
we will be back as presentations so that we
01:14:19
could consider other patterns
01:14:20
which we can consider
01:14:22
reload the page and see if
01:14:24
error yes we have of course an error
01:14:26
because we couldn't and yes she didn't
01:14:28
I could only open the quack interface
01:14:31
we immediately return to the code then only
01:14:36
I couldn't open this file yet
01:14:40
interface to start something in terms of those
01:14:42
spelled it wrong
01:14:43
croak yes I already understood yes I don’t
01:14:47
inattentive was here forgot there was a bunch
01:14:49
c let's go here
01:14:52
here immediately when I upload yet not found
01:14:57
I’ll show you the interface right away
01:15:01
I still have an error here, it's not here
01:15:03
can find
01:15:05
precisely the classes of varnish and quack themselves
01:15:10
can not find
01:15:11
our interface is like an interface with you
01:15:14
submitting this too will now fix it means
01:15:16
I missed something in the title somewhere
01:15:18
more likely
01:15:20
let's see this beginning in a quack
01:15:22
interface
01:15:25
like an interface and let's do it like this
01:15:29
this is where my mistake was
01:15:32
here just by giving the ad itself too
01:15:34
I missed a letter here, that's it now
01:15:37
definitely be working let's move on to
01:15:39
let's see the node
01:15:42
reboot and now everything works
01:15:45
you flow
01:15:49
just wanted to ask about namespace yes
01:15:52
yes I agree absolutely agree as for
01:15:55
such cases
01:15:57
need to use on and spacex but I
01:16:00
thought and considering space and but dear friends
01:16:04
always use a namespace
01:16:07
do as I do now, I will always do it
01:16:10
program use we are here I decided
01:16:12
without composer from a little freeloading and in
01:16:15
In general, this is the situation, but
01:16:17
remember use namespace
01:16:19
overall good look what happened
01:16:22
two functions perfectly volunteered for us and
01:16:24
here is the meaning of strategy in any
01:16:29
case we can modify the class
01:16:32
class algorithms simply replacing it
01:16:35
a variable that is responsible for some
01:16:37
one function and in these variables
01:16:39
classes are called that can
01:16:41
I’m glad as hell to answer something in our case
01:16:44
uses the class to fly uses
01:16:46
class fly wizard frames and in order to
01:16:50
quack she uses class haik quark
01:16:53
crack and the point is that in
01:16:56
in any case, we can do it without any problems
01:16:58
You can replace these cool ones with others
01:17:00
even now create others
01:17:02
create other classes for them now
01:17:04
let's get back to our presentation
01:17:06
if something is unclear to someone exactly
01:17:09
what concerned exactly
01:17:13
pattern strategy please write now
01:17:16
your questions in the chat and for now I
01:17:19
back to our presentation
01:17:25
so even here a little maybe somehow
01:17:27
this is to expand, they'll just wait a second
01:17:35
so that somehow it would be more in the center
01:17:39
super wonderful
01:17:43
ok let's go back to the factory then
01:17:46
we have already discussed my method
01:17:48
strategy reviewed
01:17:50
so which slide do I need?
01:17:53
Singleton and I think many have heard
01:17:56
in this bo3 is not a singleton it is the simplest
01:18:00
cartridge with one class and
01:18:03
you can see all the logic right now
01:18:05
on the screen they even say what’s his name
01:18:09
I don't know if it makes sense
01:18:11
please tell me show you how
01:18:13
single panel works no or just
01:18:15
explain if talks about put
01:18:17
pluses in the chat but I'll explain how it is
01:18:20
works
01:18:21
although you say asked how and what
01:18:23
explain and it’s not visible okay, which means
01:18:25
look we have a class son groups
01:18:27
loner is the absolute best
01:18:30
a completely simple pattern that you can
01:18:33
use which creates only 11
01:18:37
only one global instance
01:18:38
some specific class for everything
01:18:41
applications and
01:18:44
wear cool he has so many 1
01:18:46
private variable
01:18:48
instance that is, which stores for itself
01:18:51
an instance of some class only
01:18:53
one copy which later
01:18:54
used there is a function Friday here
01:18:58
no constructor if anything
01:19:01
is only used to
01:19:03
call this particular instance, that is
01:19:06
call this exact instance
01:19:09
class and if it is not created then it
01:19:12
is created and everything in case it is in any
01:19:16
in case only one will be returned
01:19:17
his visas to the beach and only to there
01:19:19
instance you will always be
01:19:21
use the app most often
01:19:25
using then used then when
01:19:27
need to make some kind of company
01:19:29
there oil variables could someone like that
01:19:31
they do it although I think everyone is fine
01:19:34
we all know that for global
01:19:36
there are many different variables
01:19:38
ways you can use what gives
01:19:39
php or what it now gives him for
01:19:41
which you are studying
01:19:44
best examples of application and according to
01:19:46
let me show you better anyway
01:19:48
We are not theorists here, we are their practitioners
01:19:52
so let's switch to the neck and
01:19:56
Dasha right away and I’m a little bit of a scumbag here
01:19:59
before
01:20:02
noon for all the mistakes like you
01:20:04
got free, took the studio code and only
01:20:07
I didn't notice now because I just
01:20:09
broadcasts the cookie good then even
01:20:14
for singleton we don't have to create
01:20:16
a separate folder can be immediately
01:20:18
Singleton herds. .
01:20:20
but also see how to use the pattern
01:20:23
loner is the simplest potter from whom
01:20:26
Shouldn't it implement any at all?
01:20:29
interface has only one class
01:20:31
you know first of all what we create
01:20:33
Here
01:20:34
drive distance variables are the essence
01:20:37
which is only to
01:20:39
Just
01:20:40
[ __ ] yourself just one copy
01:20:43
class before, as I said, there is only one
01:20:48
function although others can be written here
01:20:50
but they are not needed, although they are not needed
01:20:53
depends only on a
01:20:54
someone is already writing just for you
01:20:56
used but agree should too
01:20:58
can be used for db here only
01:21:01
there is only one function get instant
01:21:03
which memory pairs memory like you already
01:21:05
guessed it is used to
01:21:07
return an instance of this class and if
01:21:10
for example here
01:21:12
authorities there
01:21:15
they are there for example empty if we have
01:21:17
wait, wait, these are the variables
01:21:20
lenses an instance of a class of some kind
01:21:22
for example then return there for example from
01:21:27
let us have it here instance there
01:21:29
equals now let's come up with it
01:21:32
some class that we could here
01:21:33
use
01:21:35
for example for example for example
01:21:40
Yes, you can save any other eye
01:21:43
and you can either just do this one yourself
01:21:46
many people do this most often, and
01:21:49
here it will just look like he's here
01:21:53
that's
01:21:56
here you can even write some of your own
01:21:58
functions
01:21:59
we do this why take all this
01:22:04
for I choose zai yes we have the same option
01:22:08
here is the center if the variable
01:22:10
essence emptiness nose it will be created logically
01:22:14
then, for example, there is an example here
01:22:17
of this same class if there is one
01:22:20
this change is filled then be
01:22:22
return only this one instance
01:22:24
shield white 2 let's come then
01:22:28
index.php tested everything, connect it
01:22:31
this class or Dalton. stoves and
01:22:34
let's create a new instance
01:22:38
yes it would be possible even then but no
01:22:41
static methods will not work here
01:22:43
because when leave the static
01:22:44
static methods they are already refuted
01:22:46
know about creating new objects
01:22:49
great then let's do it
01:22:51
Singleton you are a loner and
01:22:55
get
01:23:00
let's first we did know you know
01:23:02
Let's make a ward at the stage when ours is still
01:23:07
from singleton class
01:23:08
no, for example
01:23:11
even your own copy
01:23:17
here we drive a bartang singleton
01:23:22
and what else can we do here?
01:23:25
that's right, we can output them here from
01:23:31
bodom all this, that is, we also look again
01:23:33
when there was only one instance of the class
01:23:36
created let's go to the browser
01:23:38
let's see what happened if any
01:23:40
errors
01:23:42
ok I'm reloading the page
01:23:45
what we see is recursion wow class
01:23:48
Be right back . m at the rate
01:23:51
Well, in general, look at the first one
01:23:53
stage we do not have the only copy
01:23:55
and then he creates himself, that is, this
01:23:58
well it could be like
01:24:00
Singleton can be instantiated
01:24:02
himself that most often a bolt or
01:24:05
create instances
01:24:07
exactly
01:24:08
some other class only one but
01:24:11
most often he only creates himself and
01:24:15
Yes, it’s logical that in this case after
01:24:19
This is why we turn to him alone
01:24:21
instance and this is precisely through
01:24:25
instance
01:24:26
I can even write an example now
01:24:29
Let's imagine a function here
01:24:31
I'll immediately switch to the code, super here I am
01:24:36
for example I can
01:24:38
goodbye Akiva features
01:24:43
for example for example what yes it will be through
01:24:46
instance about appeal here to be
01:24:49
For example
01:24:52
site for example
01:24:56
here the game is an appeal to the ten calling this
01:24:59
functions will be exactly through since the
01:25:01
distance to
01:25:04
help
01:25:06
it actually smelled like sosaria
01:25:09
A little
01:25:10
got a little lost when that's why I didn't
01:25:12
it would have worked just a bloody wolf and
01:25:15
for example so that I
01:25:19
just like that
01:25:21
Here
01:25:23
I'm twins twins up to the logical to run away
01:25:26
instance I can even write here
01:25:29
[music]
01:25:32
coccyx for example one single object
01:25:35
And
01:25:36
call here already
01:25:39
ate function
01:25:41
In general, you can complicate this in your own way
01:25:43
pattern
01:25:44
get instant get in cis maybe
01:25:49
static but I because what I know
01:25:51
because I rarely benefit from society and
01:25:53
static unless I'm sporting static
01:25:56
methods there
01:25:58
where exactly do I need to create no need
01:26:01
create new objects where I don’t want to
01:26:03
create a new class object
01:26:05
in this case, I'm qualified in the cap
01:26:08
I want to say that this won't work because
01:26:10
that we are creating a new object here
01:26:12
myself that is and
01:26:14
even if you look at such examples
01:26:18
you can search there, we can even go to
01:26:20
It’s even better to consider refactoring there
01:26:22
somehow there are a lot of treasure developers
01:26:25
we'll look at the article on the atom later
01:26:28
then this is exactly what will happen
01:26:31
explanation
01:26:32
decks the best explanation of how it all works
01:26:35
will be so let's come that's why we
01:26:37
we see where the class is halvat and for some reason
01:26:40
I was taken aback by the rumor, I wonder why
01:26:46
here it is
01:26:48
instances of sleep in general, in the future everything
01:26:52
operations can be carried out through
01:26:55
this copy and
01:26:58
access it via get there
01:27:01
exactly ket just get instant
01:27:05
in general there may be instances, that is, this
01:27:08
there may be very different classes like me already
01:27:10
I have said more than once and
01:27:11
how much do we have and we still have half an hour damn
01:27:14
you don't have time
01:27:18
Then let me show you quickly
01:27:21
really fast in 10 minutes one more
01:27:24
a pattern called a prototype
01:27:26
interesting about himself because he
01:27:28
uses the magic function.
01:27:31
so let's go back
01:27:34
If anyone has any questions, write to the chat immediately
01:27:37
I immediately see then I remove this and
01:27:41
let's create a new folder for the pattern
01:27:45
prototype
01:27:46
prototype so let me do it too
01:27:50
I will explain everything in practice like we do
01:27:53
what is a prototype pattern?
01:27:57
when we create we create new objects
01:28:00
class based on what we clone
01:28:03
some other object but not that one
01:28:06
the way that we create a link to there
01:28:09
you know, I'll give you a link to some
01:28:11
certain back and what we
01:28:12
use the magic function klo and in
01:28:15
which we'll talk about if someone doesn't
01:28:16
knows you can google it or I will now
01:28:19
I’ll explain let’s imagine a situation like this
01:28:22
we have figures and I have them here too
01:28:25
shape this will be the interface, that is, which
01:28:28
there the figure is determined and
01:28:33
here is the whole interface and
01:28:38
what in the end can one have
01:28:43
For example
01:28:48
the figure has some kind of name or
01:28:51
there for example
01:28:54
these I’ll think about what we have for example
01:28:56
some figures, if for example I have
01:28:59
circle then the circle has a radius and if I have
01:29:01
a square already has an area
01:29:04
let's talk a little about the message
01:29:09
then in the end what's the matter with this?
01:29:11
it turns out that
01:29:14
then what will we have?
01:29:17
figure
01:29:18
it's even let's do it too no it's better not
01:29:21
it is not necessary to do this with the interface
01:29:23
interface I immediately want to say when we
01:29:27
it is not necessary to use a prototype
01:29:28
create an interface although it is also possible
01:29:30
there is just a certain
01:29:33
the figure we have is the figure that will be the name
01:29:36
for example yes and color and others are all there
01:29:40
parameters there there radius there width
01:29:44
length and something else like that
01:29:47
all this will be added additionally
01:29:50
let's just say so clones and
01:29:54
here is the exact moment when
01:29:58
for example I have a neck here
01:30:01
nice private here we have about
01:30:03
these parameters are color, that is
01:30:05
I have the name of the color here right away
01:30:08
will be canceled in order to surrender the name
01:30:11
figures
01:30:13
We’ll just pass on the name of the figure
01:30:15
Yes
01:30:16
here equals let's take
01:30:20
another public function which
01:30:23
called a color set that would cost 20
01:30:24
years
01:30:26
but it can be done this way although I think
01:30:30
you can do without this by asking them on
01:30:34
generation stage, exactly the meaning of these
01:30:37
two variables so that in fact and logically
01:30:39
so let's better go to the very
01:30:43
I don't know everything about the club's magic function
01:30:46
Do they know about the existence of such a function?
01:30:50
magical clone she just clones
01:30:53
class object, that is, you specify how it is
01:30:56
must be planned
01:30:58
we plan to disappear died but exactly
01:31:00
a new copy is planned
01:31:02
I can use this class as an example
01:31:06
make the wind tilt here she be
01:31:09
clone the shade and
01:31:11
what do I get as a result you are here
01:31:14
from the neck I
01:31:17
I take the shake and
01:31:20
what can I do photo mode can I do
01:31:24
For example
01:31:26
clone yourself create a new one here
01:31:28
a figure for example there just
01:31:32
come on anyway, come on come on yeah
01:31:35
let's all know what
01:31:36
we are there so much
01:31:39
he's who we do
01:31:42
at least Alan give this a name
01:31:45
we'll come back to everything later, in general it's a [ __ ]
01:31:48
as I said, we will create with a
01:31:52
for a snack abstract factory and without
01:31:55
problems just let me sort it out
01:31:57
now this and because through the
01:31:59
fabric this is very interesting this is very
01:32:02
cool but I'll explain later just there
01:32:04
a few moments I just want more
01:32:06
described heat let's quickly then
01:32:08
sheksna and look how I spoke to
01:32:11
using the pattern we create a prototype
01:32:13
create new class objects based on
01:32:16
cloning instances of classes then
01:32:19
We immediately connect the prototype spike. php and
01:32:24
It’s logical that if I, for example, want
01:32:28
take plan even not even not
01:32:32
You can definitely write a clone here
01:32:34
you can celebrate here you can give and
01:32:36
message to be displayed I cloned
01:32:40
what will be output to begin with is simple
01:32:43
Let's test everything and for example I want
01:32:45
create for example from a triangle for example
01:32:48
For this I clone to the shape class
01:32:51
object of the neck class and I should now
01:32:55
display page I cloned here
01:32:58
so let's open local right away
01:33:01
host
01:33:03
reload the page here and how
01:33:06
always a classic of the genre I forget
01:33:08
I'm connecting it wrong somehow
01:33:11
our classes
01:33:13
so let's do it right away yes I wrote I
01:33:16
forgot to write does not decrease
01:33:19
let's add it here right away then
01:33:21
nope, great, let's go back right away
01:33:26
back
01:33:27
browser and
01:33:31
reboot
01:33:35
cool shape on tv thanks
01:33:37
again and did something wrong, that means
01:33:40
again somewhere more carefully inattentively
01:33:42
connected something somewhere
01:33:45
login if vision studio code
01:33:49
whispers close shave we have super
01:33:52
wonderful and
01:33:53
we should create a Shape family here
01:33:57
something
01:33:58
about that one, well, of course it’s wrong
01:34:01
wrote to the toy play super as always
01:34:04
let's go back then browse here
01:34:07
everything will be okay now
01:34:09
as we see nothing happens right away
01:34:12
a logical question arises: why is this so?
01:34:15
yes, let me read it, let me see I already wrote it there
01:34:18
error maxim yes I already corrected it
01:34:22
[music]
01:34:23
then the question is why nothing happened
01:34:27
even though we wrote a function here that is a clone of mine
01:34:32
take advantage of logical magic
01:34:34
the handball function is really nothing
01:34:37
is happening
01:34:40
because I was just writing here
01:34:42
culture it was logical to write them I
01:34:46
a little something at the end
01:34:49
our pencil case has a little something already
01:34:51
inattentive ok reboot yes
01:34:53
now we have cloned
01:34:55
there's an object up
01:34:59
our figure with you, that is, we have
01:35:01
some new figure now and what are we
01:35:04
in the end maybe we can do it now
01:35:05
let's create functions quickly then
01:35:08
which I once said
01:35:11
they’re different so I won’t add them later
01:35:14
what is it there send me in a know 1
01:35:17
im going to use it to
01:35:19
set a new name for
01:35:22
the figures are here and we will transfer and
01:35:25
also add chocolate shapes change
01:35:30
halls
01:35:33
Here
01:35:35
it's full there
01:35:38
encapsulation classic
01:35:41
clan movie tricks on files like this
01:35:45
owls see you mistake yes
01:35:52
it’s so clever not to always return
01:35:55
meaning exactly what I wanted to say
01:35:56
What
01:35:58
In general, due to default, he is already planning a new one
01:36:01
running millet in some languages ​​is also
01:36:03
forget that you can do it in your own way
01:36:05
realized there is a cycle of some I don't
01:36:07
I know it's possible in some languages
01:36:09
Running oriented programming
01:36:10
maybe it’s something like this, for example, a clone
01:36:15
I have to write myself to return it
01:36:17
mileage but let's just shape then
01:36:19
here we will write that we will have a simple name
01:36:22
we will have
01:36:25
set on him us it will be just ordinary
01:36:29
some kind of strange figure
01:36:36
for example, we will have red here and
01:36:40
Let's imagine what we want to create
01:36:42
some kind of triangle and
01:36:44
this is why I'm here, what am I doing, I'm here
01:36:47
for the first time with two barrels in the title
01:36:50
set name
01:36:54
triangle for example before and
01:36:58
after that I can also set the color
01:37:01
to our triangle to our club if
01:37:03
that something cloned shake I for example
01:37:11
super and that is
01:37:13
then we can also create a square
01:37:16
planned or triangle is it pure
01:37:19
example, note Aziz, we are already cloning
01:37:22
ready
01:37:24
class object
01:37:26
well, you can do any functionality
01:37:29
pee the fact that we
01:37:31
we create new objects based on
01:37:35
based on one object already ready there
01:37:38
which we will square the planets and
01:37:43
for example it will have a color
01:37:46
yellow
01:37:48
give away orange
01:37:53
now let's each of these or on
01:37:59
display the object
01:38:02
someone thinks will wonder why
01:38:04
the project will survive but it’s just beautiful
01:38:07
missed by the pilots
01:38:10
we deduce to become first our figure then
01:38:13
enter the clone with a figure that represents
01:38:16
a triangle and
01:38:19
also be sure to draw a square
01:38:24
super a
01:38:28
if you compare objects with cloned ones
01:38:31
can be can be compared absolutely
01:38:35
fully
01:38:36
that is, in fact, when you plan
01:38:39
you get no reference to the object itself and you
01:38:41
you actually get a new nose object
01:38:44
you know the cloned parameters and that’s it
01:38:47
in that spirit
01:38:51
you can just write and now I’ll answer who
01:38:54
there to ask, let's do it now
01:38:56
panda tower let's see if it works
01:38:58
everything, yes yes of course we have
01:39:02
the name variable is not set, let's do it right away
01:39:05
let's come back here
01:39:08
z-nat-ok
01:39:13
we're coming back
01:39:18
so she said that somewhere here is not
01:39:20
it was he who set the change
01:39:24
defined for because yes and men's line 15 is
01:39:29
Freud in the Shape class
01:39:31
15 lines of code I missed something again
01:39:35
their
01:39:39
explains, but to the point, well, kinda got it right
01:39:42
that is
01:39:43
discover publications
01:39:48
so 25
01:39:51
but for some reason everything is fine with the light
01:39:54
only just in front of the ring she found me too
01:39:58
somehow this and
01:40:03
yes yes I see I know that I even have
01:40:06
the girl was highlighting something there
01:40:07
some errors yes now if
01:40:09
for example, now I’ll come to the browser and I can already see it
01:40:11
everything works for me here
01:40:13
in the end we see you
01:40:16
so I would like to immediately draw your attention
01:40:19
what is it that we have two
01:40:24
times and planned 2 set names
01:40:29
Yes, yes, fine
01:40:32
look we had two clonings we
01:40:35
cloned shape twice for
01:40:37
triangle for square see
01:40:39
carefully what are these two clones?
01:40:42
that's exactly what they are
01:40:45
so to speak
01:40:49
shape objects just originally had them
01:40:53
these values ​​are copied in itself but
01:40:55
we eventually changed them and I see here
01:40:58
that humana on the imbe I put orange
01:41:01
his
01:41:02
Yes, I obviously made a mistake somewhere
01:41:05
something yes, I registered twice, we know
01:41:08
I registered differently, we know I’ll change there
01:41:11
below in line 15 the hen is now a thief
01:41:14
everything will be fine but you can even
01:41:16
now notice that here is an analogue of it
01:41:19
cloning planned value
01:41:21
exactly the original 1 copy in
01:41:24
now countries are written in simple color and
01:41:26
in general what is the point
01:41:29
thank you sharp hurt sada according to so
01:41:32
sit down, the Sishov chip is a getter and
01:41:34
there is no such thing as a setter nickname, well, in general there
01:41:38
what does it ultimately look like?
01:41:41
the pattern is a prototype and in the end it
01:41:44
represents that which is in how and
01:41:46
said creates novus striking
01:41:49
with a pattern you create new objects
01:41:52
classes, clone one already
01:41:54
copy and further modifying it
01:41:56
using that is, that's the meaning of it
01:41:58
let's now anyone have any questions
01:42:01
write to the chat immediately and I will return to
01:42:05
our presentation then
01:42:07
so I’ll expand it from him
01:42:11
kay
01:42:16
super super super great
01:42:19
ok then let me go a little now
01:42:23
jumped over we've already looked at three
01:42:25
we don’t have time to look at everything in a pattern
01:42:28
using an example application using an example
01:42:31
applications using what am I here
01:42:34
I wanted to say exactly what
01:42:37
you just saw
01:42:40
you know most often patterns well you will
01:42:44
see their names in the collections
01:42:48
please write plus their children who already
01:42:51
knows how to use some kind of framework
01:42:53
if so that's just cool because all
01:42:56
tidy outside as in general not in life
01:42:58
it makes sense to use well invent
01:43:00
some cat bikes you
01:43:01
you program and what you generally wanted
01:43:04
say that for example I tried it on
01:43:08
for example, he stole the frame if you heard
01:43:11
in this case during cooking, by the way, found in the discourse
01:43:14
so they may have seen the tidy, but
01:43:17
the essence is what there is such what
01:43:21
what kind of things are in the mouth?
01:43:24
marvel what is the repository class
01:43:28
what is a class and repositories?
01:43:31
go used their essence is
01:43:34
that
01:43:35
for example you can
01:43:38
just take and does not directly contact
01:43:42
model, namely through calls repositories
01:43:44
this is an example this also exists
01:43:47
potter
01:43:48
someone will finish this already, super well done
01:43:51
great for use in tidy
01:43:53
because I'm now I think you
01:43:55
you know what I'm getting at
01:43:57
in general, often you very very often
01:44:00
you meet exactly the pattern and
01:44:02
design in the workshops and you yourself or
01:44:04
you will use it even if there
01:44:06
for example, you know that the tidy is running
01:44:10
gives you the opportunity and I
01:44:13
said that such a practice is very
01:44:16
a broad topic that even today
01:44:17
showed this is not enough
01:44:19
constantly practice practice and
01:44:21
even now I have already shown not but this
01:44:23
snow on your table here if anyone
01:44:28
I don’t understand something, I don’t contact you and
01:44:30
I practice I practice but I can’t do without it
01:44:32
it's obvious because you can comprehend
01:44:35
exactly what the site concerns about patterns
01:44:38
design is really needed all the time
01:44:40
practice but also generally allowed to drink and
01:44:42
it's always logical and
01:44:46
[music]
01:44:48
that I would like to ask you after
01:44:50
how it ends
01:44:52
then
01:44:55
catalog of patterns that you need now
01:44:57
I'll show you and practice on it too
01:44:59
that is, just keep trying
01:45:01
who wants to study
01:45:04
you can even look for yourself
01:45:06
relevant literature for example here
01:45:09
this book, by the way, gives just the same
01:45:11
also written by the gang 4-D gamma and
01:45:15
so on but the plan, that is, I’m just leading
01:45:20
who was what you always when here you even
01:45:22
you can go to some right now
01:45:24
the frame of the park scoreboard was torn
01:45:26
applications look at the repository and
01:45:28
take it apart and you will understand that you too
01:45:30
separate pattern
01:45:33
so the shameful catalog is their use of course
01:45:36
how could he say that without them?
01:45:39
when we want to find some new ones
01:45:41
patterns for
01:45:44
solving some problem or simple ones
01:45:46
teachers just find a path for
01:45:49
to study we use the Potter's catalog
01:45:51
what is a catalog pattern exactly?
01:45:55
the thing is to keep a whole list for yourself
01:45:57
patterns that we can use
01:46:00
here is a complete description of the example and so on
01:46:03
the coolest by the way which patterns with
01:46:05
which many developers know it from
01:46:07
which you can’t argue with is refactoring
01:46:09
kuru. Well, refactoring. guru
01:46:12
at least one lot of information like here I am
01:46:15
written can be found on Wikipedia books
01:46:18
for example, even this one is some
01:46:19
written by the guys who put it here
01:46:22
I’m even watching this whole culture here
01:46:24
here, of course, using the example of Jami Java
01:46:28
create one here, I’ll find some
01:46:30
example
01:46:34
Here's an example of using a pattern
01:46:37
adapter relationship is described here
01:46:39
the results are very detailed
01:46:42
so let's move the browser now
01:46:44
I will now show the paradise factors to the guru.
01:46:47
refactoring. this site because
01:46:51
you should definitely know it and
01:46:53
today after the webinar I will definitely
01:46:55
I recommend going to it on the left
01:46:57
practice something watch
01:47:00
and now I’ll switch to ours
01:47:03
browser
01:47:05
so just a second
01:47:12
super
01:47:14
here is the refactoring. hello world guru
01:47:17
hi this is the best site I think
01:47:21
patterns that exist and them
01:47:23
Everyone uses 3 all the time
01:47:25
factoring is also covered a lot
01:47:27
we'll talk about factoring too, but you
01:47:29
you can for example go here here you
01:47:30
you can just study and look into
01:47:34
boilers and what you see here here
01:47:37
it's just that absolutely everyone fell like me
01:47:40
said what to study their practical
01:47:42
use but not at one time
01:47:44
need to constantly practice
01:47:46
used today we looked here
01:47:48
this pattern this pattern this one
01:47:50
pattern and of course we looked
01:47:52
strategy that is four wow patterns
01:47:54
cool and you see we don’t even have time
01:47:57
let's take a look at everything
01:47:58
An example of an abstract factory pattern is here
01:48:01
just perfect everything is written simply
01:48:05
there are great examples of herd quarrels
01:48:09
a little blink but you see it here too
01:48:12
common interface for all chairs
01:48:15
There is
01:48:17
what is the point
01:48:19
abstract factory pattern here
01:48:22
the structure has already been described
01:48:24
food here by the way dependency injection
01:48:27
used see all these classes
01:48:29
depends on the interface and
01:48:34
I 2 yes yes yes yes yes yes I agree that it is
01:48:38
more than a directory of all developers by this
01:48:41
enjoy it and I'm just saying now
01:48:42
so that others call everyone
01:48:44
used in general see what
01:48:48
the essence is precisely the abstract background
01:48:51
factory if we don't make it in time, well
01:48:53
unfortunately it’s almost straight forward
01:48:55
but at least I’ll explain it this way here
01:48:58
upstrac interface factors to have
01:49:02
itself functions to create a product and create
01:49:04
product which in total
01:49:08
return new class objects there
01:49:11
some products that
01:49:13
accordingly, there is also its own
01:49:14
interface there products and products and
01:49:16
for example we have a factory here which
01:49:19
will create a product in its own way and
01:49:22
product b and here on in its own way
01:49:24
created and creates its own versions of the product
01:49:26
b and product that is when we have
01:49:29
abstract factory we create our own
01:49:31
factories as I said because when
01:49:34
we created using the factory method
01:49:36
we had one factory, I also had
01:49:39
pretty well
01:49:40
a simple option in something in some way
01:49:43
sense
01:49:44
factories but it’s understandable, it’s also normal and
01:49:48
Here we have, for example, another account
01:49:50
the factory we are creating which
01:49:53
implement yourself interface track
01:49:54
figures and she creates these in her own way
01:49:56
two products we have
01:49:59
implement yourself already interface and
01:50:01
about the cocktail product b&b forgive me and you
01:50:05
even here you can see that everything
01:50:07
I think I’ll notice that these are all
01:50:09
functions should return you exactly
01:50:11
so that all products are of these types then
01:50:13
there is if it just makes sense
01:50:16
abstract factory is what we create
01:50:18
create a separate family of classes
01:50:21
which create for us separate
01:50:23
families of some objects that's what
01:50:25
the meaning of this particular pattern and I
01:50:30
I definitely recommend it to everyone
01:50:33
look at this site look here
01:50:35
there are also a lot of useful things
01:50:37
here are just amazing code examples
01:50:42
here is also an interface that has its own
01:50:45
indicate here to create a button or there
01:50:48
checkbox for example here for windows
01:50:51
factory like GUI and it
01:50:54
Windows creates a button there in its own way
01:50:57
and a Windows checkbox and on the chair it’s
01:50:59
us macbook tu-tum act mac os with like y
01:51:03
for example, here he is already in his own way
01:51:05
recreate the magic button and magic checkbox then
01:51:07
there are their own factories being created here
01:51:08
who create their products here already
01:51:11
in the future it will be created by itself
01:51:12
offer arrived application but in this
01:51:14
purely as an example, does anyone have any questions?
01:51:17
write too, I will constantly remind you
01:51:20
even when the broadcast is over
01:51:24
well, in general, if you look at it like that, then
01:51:28
it turns out that all the benefit is precisely
01:51:33
patterns in the gift catalog
01:51:36
is that there is always any
01:51:38
an incomprehensible situation if you don't do something
01:51:40
you understand by similar ones you run in cauldrons
01:51:44
pattern and look there for examples and
01:51:45
you study something that is even the same as me
01:51:48
showed but it's not enough for us
01:51:51
there's simply not enough time to
01:51:52
consider how many examples we want
01:51:54
And
01:51:55
that is, I recommend it to everyone after
01:51:58
this binary look exactly the same at
01:52:01
This resource besides this one is also useful
01:52:04
will you
01:52:05
that is, this is the meaning of the catalog
01:52:08
like this too let's say like this
01:52:09
sources that will be very useful
01:52:13
I never dreamed of respect, thank you too
01:52:18
not everyone listens to this band, oh well
01:52:21
well, it’s overgrown with bar factoring and what in general
01:52:25
I wanted to say that
01:52:27
[music]
01:52:29
concerns refactoring specifically because
01:52:32
Well, I think many have already guessed that
01:52:35
refactoring can be said very strongly
01:52:38
closely mated using potter
01:52:41
because in the end these are the results of this
01:52:45
reel almost
01:52:48
I’ll make it up myself and guess what
01:52:51
there are patterns everywhere if they pay attention
01:52:54
architecture then accordingly they can be
01:52:56
use when factoring because
01:52:59
that when, for example, someone comes towards us
01:53:00
terrible spaghetti code and by the way in the package
01:53:04
code is antipater
01:53:06
thanks for the binary, thanks too, well, I’m almost there
01:53:09
already finished the catalog fire yes I agree
01:53:12
so I just want to say that
01:53:16
when we have, for example, all some
01:53:18
spaghetti code and dad anti patterns too
01:53:22
I recommend looking at it a little
01:53:24
today webinar about patterns
01:53:26
designing not antipodes is 5 7
01:53:29
says but
01:53:31
design patterns are very cool
01:53:34
can be used for factoring
01:53:36
I just recommend any type of food
01:53:38
the eye is the same when you need to break
01:53:40
some structure if you see that you
01:53:42
somewhere you can during factoring
01:53:44
use it or for some reason just
01:53:46
tasks to take advantage of some good
01:53:49
the pattern will go bad, that’s okay, by the way
01:53:52
they also want to say it’s not always necessary
01:53:54
use a factor passport where you are
01:53:56
you'll find it, you'll see that it's possible
01:53:58
use and well, depending on the type
01:54:00
and you can even do work between them
01:54:03
in general
01:54:06
thank you all too, they finish it more often
01:54:10
there is and let's sum it up I'm here
01:54:13
what I even just said and then
01:54:15
there is in the end
01:54:17
that yes, that is, it turns out that exactly
01:54:22
patterns and this is someone that allows you
01:54:25
strongly solve the problems you have
01:54:27
arises that is, if you see this
01:54:31
architectural task that's how
01:54:33
for example, we had fishing rods, that is, we
01:54:35
we could do everything there
01:54:37
some, for example, are easy to do
01:54:40
instead of just asking
01:54:42
object we made a clear flexible
01:54:44
architecture where we simply replace the class
01:54:46
which is now for some one function
01:54:48
which is very cool and
01:54:50
when factoring, also use a pattern
01:54:53
it is everywhere and sports nerd where it is
01:54:55
appropriate because you don’t need everything dry
01:54:57
tour arrange partner admire 4
01:54:59
I’ll tell you one last minute and
01:55:02
find visible by the way, also video courses on
01:55:05
specialty picks 2pir if available
01:55:07
design patterns individual
01:55:09
some kind of strong course I hope he
01:55:10
will definitely look at the stove
01:55:13
the developer here is just a bunch of spokes exactly
01:55:16
in courses on this topic just you
01:55:17
video courses available from the test and
01:55:20
so for everyone who wants to upgrade
01:55:22
skill and developer also check out
01:55:25
the course catalog can be found here
01:55:27
specialties our webinars are also available here
01:55:30
I think we’ll still do 1
01:55:33
and in general there are a lot of courses here and that
01:55:36
that it can be useful and also use
01:55:39
test provider if you use these
01:55:41
video on active there is one of these features
01:55:44
girls are cool and helpful
01:55:46
specializations so you can check
01:55:48
how much did you understand the information?
01:55:51
on the right or in the service that shows
01:55:52
you should test it all so
01:55:55
I definitely recommend checking it out
01:55:57
specialization stove developer and
01:55:59
something thank you all thank you all for
01:56:03
attended this webinar
01:56:05
thank you who supported I see you
01:56:08
I liked it very much and I still
01:56:10
I will most likely be one hundred percent
01:56:13
I also really like to hold a webinar today
01:56:15
really very very fast ward
01:56:18
time flew by I even thought that we
01:56:20
somehow we'll see faster but so
01:56:23
it turned out that I was very carried away and in
01:56:26
in general I got that there was something
01:56:28
educational portal intelligent topics
01:56:30
who is interested in looking at
01:56:32
specialization pita oven much more
01:56:34
useful courses and there will be more binaries
01:56:35
so thank you all, use it
01:56:38
pattern and teach them now right now
01:56:40
take a look at refactoring gurus at
01:56:43
try to do something on your own and in general
01:56:47
then use

Description:

🔥Промокод на скидку 15% на все курсы ITVDN - 4YOUTUBE Материалы вебинара - https://itvdn.com/ru/webinars/description/design-patterns-for-beginners-php Начинающие разработчики редко задумываются о построении структуры в приложении, и это негативно отражается на качестве кода. Мне часто приходилось видеть "спагетти-код" написанный не очень опытными разработчиками. Дальнейшая разработка с использованием такого кода доставляем массу неудобств и сложностей, которых можно было бы избежать в случае правильного изначального проектирования. Если хочешь писать ещё больше качественный код, убрать дублирование, сделать код больше понятным для других разработчиков - тогда изучение паттернов проектирования тебе очень поможет. Спикер — Демьян Костельный, Middle PHP Developer План вебинара: - Знакомство. Введение. - Паттерны, кто их вообще придумал? - Почему паттерны всюду используют, их преимущества. - Порождающее паттерны. - Использование на примере приложений - Каталоги паттернов и их польза. - Пару слов о рефакторинге кода. - Итоги

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Паттерны проектирования для начинающих с примерами на PHP" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Паттерны проектирования для начинающих с примерами на PHP" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Паттерны проектирования для начинающих с примерами на PHP" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Паттерны проектирования для начинающих с примерами на PHP" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Паттерны проектирования для начинающих с примерами на PHP"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Паттерны проектирования для начинающих с примерами на PHP"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.