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

Download "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1"

input logo icon
Video tags
|

Video tags

golang
голенг
урок по golang
development
howto
learnbasics
coding
programming
изучаемIT
программирование
разработка
golang tutorial for beginners
golang tutorial
learn golang
golang programming
конкурс
микросервисы
microservices
restapi
rest
урок
jetbrains
goland
tutorial
изучаемit
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:00
Hello everyone, I'm back in touch again and
00:00:07
today I decided to talk to you about
00:00:09
pure architecture, they asked me to talk
00:00:14
a little, they need to talk a little,
00:00:18
they talk a little, go to the channel, presentation and
00:00:20
let's look at it in code,
00:00:22
let's go,
00:00:24
so
00:00:26
you all know your different system, your
00:00:29
architecture, yes, we have ours they are one
00:00:33
by one 1 2 3 4 5 6 and if there is a lot there then
00:00:37
antipathy appears lasagna climbing code that’s why
00:00:40
we don’t overdo it with piles
00:00:44
434 ours about ours without jumping over each
00:00:48
other theirs exchange data with each
00:00:50
other and there’s a whole story on the interfaces
00:00:53
but expanding the functionality sometimes
00:00:56
leads to the appearance of additional
00:00:58
abstractions, and as you all know very well,
00:01:01
any problem can be solved by
00:01:04
adding an
00:01:05
additional abstraction, except for the problem of a
00:01:08
large number of abstractions and you cannot
00:01:13
solve the top ones by adding additional
00:01:15
abstractions, so what is good about the salty
00:01:18
system, it is clear why the application
00:01:21
was written by it, and
00:01:23
I, too, very much I didn’t dream of
00:01:26
using my system, this is generally the first
00:01:29
type of architecture that I started to
00:01:32
promote and use myself,
00:01:35
how much I liked it and it appeared
00:01:38
due to the fact that I pervertedly understood
00:01:40
mvc mvc mvt this is the whole history of java
00:01:44
spring and I misunderstood everything we carry in
00:01:48
c how it works and in the end how I
00:01:50
understood it when it’s better than mvc in fact
00:01:53
it turned out to be a layered mvc system close
00:01:57
to this close but not about that until the
00:02:00
mvc pattern module controls the rest of the system
00:02:03
it’s just perfect, that is, from the point
00:02:05
of view of writing simple applications yes, and
00:02:07
average, and even complex,
00:02:10
it’s perfect, but we’re
00:02:13
talking about enterprise, well, development, and
00:02:17
we’re talking about printer, idle development, and when
00:02:19
we talk about
00:02:20
the corporation before enterprise, where I
00:02:23
spent a large number of years of
00:02:27
years of my life, a
00:02:31
hexagonal figure appears, an
00:02:33
ideal figure
00:02:35
that’s exactly the same as mine on architecture
00:02:37
it is also sometimes called
00:02:40
port and adapter architecture,
00:02:43
it is called that way because all of their for
00:02:46
work applications domain they are connected
00:02:50
only to each other, not just to each other as in their
00:02:53
own on the system, but using the so-
00:02:55
called ports and adapters
00:02:57
ports adapter are the guys who
00:02:59
help exchange data between
00:03:02
layers they abstract themselves from each
00:03:05
other and
00:03:06
lose the
00:03:07
code to expand the functionality has become much more
00:03:10
convenient in expanding the adapter above and the
00:03:13
methods of our buttermilk and flag become
00:03:16
much more convenient and you will see on
00:03:19
this you would have a hexagon yes only one two three
00:03:22
4 5 5 faces but no maybe six
00:03:26
maybe seven maybe as many
00:03:27
as you need I
00:03:29
dictate
00:03:34
everything in it is part of the application
00:03:38
framework base
00:03:42
some more outside the system 2 not on the ground
00:03:45
Sam with it's all outside it's all it's not
00:03:48
inside it's all outside and uses
00:03:51
its files to yes it connects to from
00:03:54
my frolovka
00:03:56
at this point, this is the meaning of such a system
00:03:59
and we finally come to what is
00:04:02
correct, pure architecture,
00:04:05
pure architecture in general was invented
00:04:08
for a different type of application, it’s not
00:04:11
just client-server
00:04:12
online stores, it’s not some
00:04:15
simple story, it’s more an application
00:04:18
for an enterprise, and for a large
00:04:20
enterprise that is constantly
00:04:23
developing,
00:04:25
constantly developing and acquiring new
00:04:28
functionality,
00:04:30
each layer and then for its own because
00:04:33
purely architecture took its toll on the
00:04:37
architecture took hexagonal
00:04:39
architecture
00:04:41
folded
00:04:43
not loudly slammed I hope mixed
00:04:46
shake but do not mix that is, together
00:04:49
with the military plus the hexagonal one gives us a
00:04:50
pure architecture means each layer
00:04:54
regulates how each other
00:04:56
can interact with it.
00:04:58
The concept of ports is taken from the hexagonal
00:05:02
type of tour, each layer is responsible for
00:05:05
determining how
00:05:07
each
00:05:09
next outer layer will interact with it, until
00:05:12
this is very clearly visible in I don’t set the picture in the
00:05:14
lower right corner of this diagram to redraw diagrams from
00:05:17
the Internet, but
00:05:19
why
00:05:20
look here buttermilk both posts
00:05:23
have the same color and what does one color mean
00:05:26
for anything in the same layer,
00:05:29
that is, the controller communicates with the
00:05:31
president using Gaussian now we let's reveal the
00:05:33
meaning of all these words, the controller
00:05:36
communicates with the presentation using these
00:05:38
interfaces, the
00:05:41
response of the interface
00:05:42
and they are all in one case views and
00:05:45
what's more, it's
00:05:47
funny funny now
00:05:50
we'll reveal it all and so on the border of each code
00:05:54
on the border of each layer there should be
00:05:57
interfaces
00:05:59
interfaces stages you
00:06:02
the same ones
00:06:05
through which they exchange
00:06:07
information,
00:06:09
now let's talk a little about
00:06:11
their own
00:06:12
interests,
00:06:14
banal kvass and objects, domain
00:06:17
areas of the subject area for the order use
00:06:23
you spaces, and here it is also important to understand yours, this is a
00:06:27
large set of many classes of different
00:06:30
classes, not that even we are only
00:06:33
narrow or only entity no
00:06:38
many many classes
00:06:41
not only
00:06:43
entity Ilisky
00:06:44
I’ll go indesit iwc the thesis can be combined
00:06:48
in fact to simplify
00:06:51
this whole story and say that this is your
00:06:53
business logic domain your own just yes we
00:06:57
take views case interests said that
00:06:59
this is on we
00:07:01
simplified
00:07:03
controllers presenters gay your little
00:07:05
green one that is with the pilot
00:07:08
entities game pictures news case with you
00:07:10
figured out
00:07:12
controllers presenters battles
00:07:16
controllers for all those same controls you
00:07:18
when you know you in cf springen in
00:07:21
django
00:07:22
where else is there a handler in a year this is the
00:07:27
control
00:07:30
presenter it’s the same
00:07:33
we throw it out ourselves a word from our vocabulary
00:07:35
not them does not swarm I don’t understand I can’t
00:07:38
understand in control
00:07:40
gateways gate you are not bad well there is
00:07:44
such a gateway pattern but if we want to
00:07:47
simplify right now and say that we are giving away this mouse
00:07:49
wedge for the little ones the
00:07:53
gateway is a repository it’s
00:07:55
simpler
00:07:58
but not quite true, but in short,
00:08:02
because in gateway there may be a little
00:08:06
more document space, there may be a login method
00:08:10
battle
00:08:11
with the torus database and method one may be
00:08:17
japa for now, for the sake of understanding, let’s
00:08:20
simplify
00:08:21
it, say that we are replacing gateway with
00:08:27
repository,
00:08:29
but the outermost layer is the outermost
00:08:33
database third-party service and I
00:08:36
haven’t changed anything, accordingly, this is
00:08:39
how the arrows lead from the outer layer, this is how the
00:08:42
data flow goes, that is,
00:08:44
just like in a hexagonal architecture, it
00:08:47
also goes there this way, that all data leads
00:08:50
externally to entities,
00:08:53
well, that’s how it
00:08:56
sounds in principle,
00:09:00
really complicated, its own ports and interfaces
00:09:06
in fact, when we write a simple
00:09:10
application,
00:09:11
it looks, first of all, cumbersome
00:09:15
because a lot of all sorts of structures are
00:09:18
created that are superfluous, this is called engineers,
00:09:22
not many wrote that the development of a
00:09:24
notes system of eight micro services
00:09:27
there are 4 databases and other things
00:09:31
[music]
00:09:33
this is Virginia here is the development of a simple
00:09:37
application using the default
00:09:39
clean architecture, yes, this is how it is given,
00:09:42
this is aver engineers, but you and I are mouse
00:09:47
programmers, you are
00:09:49
a programmer, and therefore you can fix a kettle
00:09:52
and can simplify wedge
00:09:54
architect
00:09:55
because after all, any architecture
00:09:58
should help and not hinder
00:10:01
even the horns of the master said in the video in the
00:10:05
original video to present he
00:10:08
said that the number of layers can
00:10:10
change both more and less
00:10:14
and in general he identified three
00:10:19
simple rules that can be based on
00:10:21
which you can remake this picture
00:10:23
remake and tag there this is the original
00:10:25
picture remake this entire grove names
00:10:29
and those who to leave its advantages but
00:10:31
remove its complexity and
00:10:33
these rules sound like this: the
00:10:36
first rule is the rule for crossing
00:10:39
the boundaries of layers to from green 40 times
00:10:45
the boundaries cross models
00:10:48
that are essentially a
00:10:50
cartridge do that runs a big data
00:10:56
seasoning your business logic does not depend on
00:10:59
from what not from any other layer,
00:11:04
here to panda jackson only the
00:11:06
interface only the interface
00:11:09
and
00:11:10
here we get the third rule of the
00:11:14
priority rule of the internal layer, that is, it
00:11:16
logically follows from 2
00:11:20
its business logic determines the interface
00:11:23
through which the
00:11:28
interaction of business geeks
00:11:31
with the outside world is carried out
00:11:34
from the outside blueberry systems
00:11:38
retrieving the system from the database for which
00:11:40
year I pause to make it clear that is,
00:11:45
its interface
00:11:48
is located in
00:11:49
its own business, it determines the interaction of
00:11:54
business logic with the outside world,
00:11:56
this is no longer a layered system for you, a
00:11:58
security system, so range and
00:12:02
learn,
00:12:03
yes, we have remembered 3 rules, remember this
00:12:07
whole story let's try
00:12:09
to look at this scott
00:12:15
yes we are
00:12:17
all moving into the year in Galens here
00:12:21
we are creating a new house project sea life
00:12:28
library go 16 5 let's new let's let's come
00:12:33
to you fresh
00:12:36
17 30 17 fire is
00:12:45
born when she plays like that from above it
00:12:48
starts written then Why
00:12:50
be surprised?
00:12:52
First of all, let’s create the default structure of the
00:12:55
go project, which is usually
00:12:58
considered at the moment right there to be a
00:13:01
good structure,
00:13:04
what the heck, I’ll go through it briefly, this is
00:13:07
the family, the entry point is the internal
00:13:10
internal logic,
00:13:12
the page inside, the
00:13:14
external history, that is, which can
00:13:18
move from projects to the project without
00:13:20
any- or changes in
00:13:22
the family and pulled as there was still to
00:13:28
give like all families enter well for now
00:13:32
but like everything else nothing else is needed
00:13:36
that is
00:13:38
not yet needed
00:13:41
ok all Cindy we are creating we have one
00:13:44
application - we should create a moringa
00:13:48
pour we would pump up the
00:13:51
punk mental everything
00:13:55
here, this will be the entry point,
00:14:01
yes,
00:14:05
I don’t think that we will develop
00:14:07
this project, yes, probably not, we will not
00:14:10
work, but we
00:14:13
will now try to describe the
00:14:15
architecture of the folders according to the wedge architecture
00:14:19
will receive the architecture and so we will start with
00:14:23
where we will start with the very the main thing with
00:14:26
the replacement of the area and escapes
00:14:31
and so that we have a banana was a reference to
00:14:34
I now dragged the wedge architecture
00:14:36
here
00:14:37
and did it like this and this is how you and I will
00:14:40
write our own code directly to the picture
00:14:42
and
00:14:44
together through life together before you
00:14:48
and even sketches are what your application
00:14:51
can do
00:14:52
register the user create an
00:14:55
order place a subscription and so on
00:14:58
you can simplify it a little more, here’s how we
00:15:02
simplified the gateway to a repository, you
00:15:05
can also simplify it and narrow it and say that
00:15:08
these are services
00:15:09
just services user service service and
00:15:15
also part of the water workers can be put in the entity
00:15:18
for example the order itself can calculate your
00:15:22
cost, well, you need to sort through the products
00:15:24
within yourself, take the cost of the product
00:15:27
perfectly, and this will correspond to the
00:15:29
empaths pattern domain fashion, that’s why
00:15:33
we put sketches and entities in a
00:15:36
single layer and
00:15:38
this single layer will be the model
00:15:41
domain fashion, that is,
00:15:44
domain take the business logic for power so
00:15:49
we will distribute it according to
00:15:52
that is, it will be entities and services we
00:15:55
go the library the essence is simple there are
00:15:57
books from the user users
00:16:01
come the library take the book leaves
00:16:05
read her book at that time
00:16:07
busy comes return all just the
00:16:10
basic entities which are correct the user
00:16:12
ebook let's go create folder user enter well, let's
00:16:15
create a folder beech
00:16:18
now here we need to designate
00:16:21
the entities of the domain area
00:16:24
but okay let it be Pallas's cat
00:16:27
and here we describe
00:16:33
in the book what he left services let it
00:16:36
be ai di Anthony Mann turn away I'll
00:16:38
arrive listed okay let's
00:16:41
bother with them and her Aide
00:16:44
string
00:16:46
name is The book has a
00:16:53
vintage year of publication and the author used it
00:16:56
headlong,
00:16:57
well, the book can be occupied
00:17:01
and the owner, that is,
00:17:04
who took the book,
00:17:07
so
00:17:09
naturally, here you can seat
00:17:12
Jason tags Silva in one movement each
00:17:15
conveniently, in principle, everything is
00:17:20
exactly the same kvass we create a user and
00:17:22
that too there will be a close model,
00:17:28
I’m writing a class that we will have a
00:17:32
string and with
00:17:34
[music]
00:17:36
name it will have had how come it
00:17:38
seems to the mouth it will have some kind of address there
00:17:42
will be some kind of e-mail
00:17:45
and it will be some age which is not for all
00:17:47
people can we have a library, oh, we have a hard
00:17:50
library, all of them are ours, two of them, they are
00:17:54
aggregated in models, so beech user,
00:17:58
I assign a service to the file
00:18:02
just a service
00:18:04
structure
00:18:06
service
00:18:07
but in order we will make a structure service we do not
00:18:10
export and we will create an
00:18:18
interface
00:18:19
service exported exported
00:18:23
does not export
00:18:26
so this is what the service will be like for us methods
00:18:28
to possess
00:18:30
grandfather book
00:18:33
buy aiden
00:18:37
any type
00:18:40
and string of this
00:18:44
but now on the context
00:18:47
and the
00:18:48
tape further what else do we have with books you
00:18:51
can
00:18:53
get all books
00:18:56
text
00:19:00
pagination you can give it here to me you
00:19:07
can select and vanilla kvass are not
00:19:09
important somewhere around the onion then about
00:19:12
not methods, what else can be reduced, it goes
00:19:18
without a fight digital books, we can take the book in
00:19:24
several places upsala business logic
00:19:27
with we can write methods here,
00:19:31
yes, we have beech attack
00:19:35
in the villages,
00:19:38
you take the book,
00:19:40
book and eat bizet
00:19:44
and in bizet then
00:19:47
[music ] a
00:19:50
block of meringue and everything
00:19:53
and everything is good that is, when you take a book of the day
00:19:55
you can’t take a book you can’t in all
00:19:58
other cases be a una equals gender on the
00:20:02
BBC equals
00:20:07
eternum
00:20:10
they took the book or
00:20:11
something I books
00:20:15
and the book belongs to someone or she there should already have
00:20:17
been then exception errors
00:20:19
error book is bizet
00:20:22
just like this the same method can be placed
00:20:25
in the service for work
00:20:27
ok very structure of the service it
00:20:31
will contain
00:20:32
such a service
00:20:35
it will contain the most important thing
00:20:39
put this
00:20:42
and here there will have to be an interface this
00:20:47
beech or I can’t even describe the watchman,
00:20:51
that is, this is the interface now we will
00:20:54
find it passives, let’s create it more precisely and
00:20:56
create it here go stores
00:21:02
and now let’s create cost worth
00:21:05
this is our gateway repository
00:21:10
here everything is simple it’s not funky and the time
00:21:14
this is the interface this is the watchman
00:21:18
I’m naturally and naturally you groan, here
00:21:21
he is, he
00:21:22
will have to be here right away here and here
00:21:25
what are the methods of the hetman before
00:21:28
and
00:21:29
string and get up
00:21:33
nothing at all on the context everywhere you can
00:21:35
add up to the limit in the set
00:21:39
you can twist
00:21:41
additionally
00:21:43
become another credit
00:21:46
bow
00:21:47
bow
00:21:51
elites
00:21:53
there are individual lions regarding the cartridges
00:21:56
data access magic and the repository has
00:21:59
articles that data access of jack is dead,
00:22:03
long live the repository, and there is an article
00:22:05
that the repository is dead, long live
00:22:07
data excess of and
00:22:10
these disputes have not subsided yet, by the way, I do
00:22:14
n’t know who is mixed in, I like
00:22:16
this flower, but more and more often you
00:22:19
could probably do this understand from my video
00:22:20
what I use gave they repositories are
00:22:24
more important
00:22:25
but you can use mix
00:22:28
usually I love it
00:22:31
again this is not pure architecture it is
00:22:34
inferior pure architecture because the
00:22:39
concept of pure architecture is completely taken and
00:22:41
used for a simple from a simple
00:22:44
library this is not the most complex
00:22:47
application in the world
00:22:48
they use architecture this is oral
00:22:51
for some how disgusting it is in an
00:22:54
application that takes into account the collection of oil
00:22:57
from all the top Gazprom and Rosneft
00:23:01
someone else there plus a manager from
00:23:04
analysts plus all sorts of history that’s
00:23:06
good pure architecture maybe you can
00:23:10
take it maybe it’s all the
00:23:12
watchman we have determined that we need such a machine tool,
00:23:15
so we use it in the service,
00:23:18
in turn, we can now
00:23:23
why is this happening
00:23:24
now we can create print the
00:23:31
same methods,
00:23:35
well, all that remains is we can eat
00:23:39
something like that, something like that, work like that
00:23:44
and the
00:23:47
herd goes the letter we go returns
00:23:51
a link on the side the
00:23:54
array responds
00:23:57
something like this,
00:23:59
let's bring killed okay, we think that
00:24:02
we rotate this too, well, that means an array of links
00:24:06
for us
00:24:07
this and don't rotate anything by the way, the
00:24:11
previous error,
00:24:15
they all should return an error, it
00:24:17
doesn't matter, we're not talking about that yet,
00:24:19
but not yet it’s not the service that’s missing,
00:24:22
but here there’s not enough that will be
00:24:25
expected to cost and return
00:24:31
the service
00:24:34
to feel and
00:24:36
the interface will rotate here,
00:24:42
yes of course he doesn’t want to
00:24:43
return yet because we still need to
00:24:46
do this like this
00:24:49
and now he’s returning and here get
00:24:52
all
00:24:54
and what he wants is
00:25:01
that approximately, that is, our service depends
00:25:05
on the Sturridge interface, well, I’m
00:25:08
not a person at all, I thought you
00:25:09
wrote it that way, that is, you just don’t get angry, it’s
00:25:11
called as it was described, and
00:25:13
now you and I have created an interface for
00:25:16
our business and we have already determined
00:25:20
the interface that we need, yes, where
00:25:23
is the interface in the business service we have
00:25:26
defined our business logic interface for
00:25:29
interacting with the database this is the
00:25:31
interface for
00:25:32
our our
00:25:34
service
00:25:36
our sketch
00:25:38
this is narrow
00:25:40
I give space
00:25:43
well here you can make Facebook methods
00:25:45
so on and so forth here it is this
00:25:47
video we smeared Iraq a little so about
00:25:51
domains and models for services
00:25:54
here, but these are ours in Besançon
00:25:58
and
00:25:59
so with users it won’t be the same,
00:26:01
otherwise we will be it will be for a very long time everything
00:26:04
even nothing has changed here
00:26:07
the user will log in to Boeing then at uses so on
00:26:10
so we won’t go any
00:26:12
further more
00:26:15
interesting what’s what what else is here, there is
00:26:17
still there, there must
00:26:20
be one before that, let’s write
00:26:23
it like this, yes. these structures will be one of these days, the
00:26:29
client book, and then what classes what
00:26:32
pole will come to us to create a book. it’s
00:26:36
very easy to think that they will
00:26:38
come to us, so we can take all these
00:26:40
all these fields and set what will come to us
00:26:43
when we create a book as a lawyer,
00:26:46
obviously the visit will not come, the visit will obviously not come
00:26:49
to us, the full ones will obviously come to us, all three fields
00:26:51
of which will come to us are crazy, we will
00:26:53
force here it is glues the beech to that
00:26:56
further update the beech to what fields they will
00:27:00
come to us when they want to update the
00:27:02
book, well, in fact, absolutely all
00:27:06
the questions and yes, I haven’t really decided yet,
00:27:09
here it will be possible to set from the
00:27:11
brothers to snatch and view the
00:27:14
book identifier without substituting
00:27:16
the model but you can demand it yourself to
00:27:18
transfer paths on the web from the method and
00:27:23
I probably require it to attach a method here, it’s more
00:27:27
convenient for me so as not to insert
00:27:29
less less
00:27:33
what else can you do here, you can still make
00:27:36
a patch and by the way amide empty should be removed
00:27:40
because but not amide empty it should
00:27:42
be
00:27:44
built validation subsequently no m
00:27:47
believes that optional fields are
00:27:48
required all the quirks
00:27:51
here and here
00:27:53
but it can’t help but be the author they are
00:27:56
sometimes all that and but you
00:27:59
why do you need
00:28:02
Aid then so
00:28:04
that in the service
00:28:06
when we create the
00:28:08
trade book method
00:28:10
context
00:28:12
context context we will indicate here before
00:28:16
this, well, or a link to the group and
00:28:20
the book is returned now we create
00:28:24
this method
00:28:28
[music]
00:28:31
and this one before this will be the connecting
00:28:33
story not
00:28:37
and this date this one this
00:28:40
is the connecting
00:28:43
part of the
00:28:45
business logic layer with With this controller I
00:28:50
am a controller repository
00:28:56
and let's see how it will
00:28:57
work,
00:28:58
we create a venture, well, we create a
00:29:01
daddy adapter
00:29:05
there,
00:29:08
we can create an a.p.
00:29:12
and let's create more controllers
00:29:15
so that there is a straight
00:29:17
drop out so that Poland
00:29:20
here we create a handler yes here we
00:29:24
create a handler let's now here we
00:29:27
will create a handler about spam
00:29:30
here we will create a type of
00:29:35
henna
00:29:37
unsanitary Jess 3 and
00:29:39
[music]
00:29:41
this is all in one
00:29:43
video on what to
00:29:45
use but that's all the same Gillian
00:29:47
Schmidt so the gate is somehow small and
00:29:51
we can do it no we can so
00:29:55
go
00:29:59
for three summers
00:30:02
I don’t remember I do
00:30:04
n’t remember I
00:30:06
don’t remember and I copied and pasted
00:30:08
go get that’s how
00:30:13
Julian makes noise when he took
00:30:18
the State Duma
00:30:20
thank you very much and
00:30:22
and the
00:30:24
food is
00:30:26
wonderful
00:30:29
wonderful now we're going
00:30:33
here, by the way, we can also create a user folder
00:30:37
and move controllers there,
00:30:40
but we mostly
00:30:42
work with books with books, so let's use
00:30:44
one letter,
00:30:46
but not only the file, the book directory
00:30:52
and transfer the controller there, oh
00:30:55
yes, and here we can make a separate one
00:30:58
file interface
00:31:01
and transfer our handler there so that, well,
00:31:05
not for him, so that drayton does all the work
00:31:07
without copy-paste and
00:31:10
that’s
00:31:12
all, but in this Hindley, are we already actually
00:31:14
declaring the handler structures, the
00:31:19
structure is he can
00:31:22
demand something, maybe not something demand
00:31:24
taxes and for example here there may be some
00:31:27
kind of service up to,
00:31:30
well, by the way, let’s immediately write here a
00:31:32
service is required bow service,
00:31:36
our tug is required here
00:31:40
and then we will create the new finger function but the
00:31:43
constructor and where we will pass the god
00:31:46
service of course
00:31:49
service yes we have nothing else for now no, and the
00:31:52
interface of the hander will come back; they
00:31:56
sit on the
00:31:58
Sim’s face, because he is a
00:32:00
handler, bow service, service,
00:32:04
fingers, everything seems to be fine for now, but a
00:32:08
couple, and it’s good because we don’t have a
00:32:10
Christmas method before you and me now, and I’m
00:32:16
behind the general finger, not links or in the toilet,
00:32:20
just now
00:32:23
or what feelings
00:32:26
register
00:32:28
arrow before his morning is already a handler
00:32:33
but through this, well, it doesn’t matter the handler as a
00:32:36
method method I don’t want a method get get
00:32:43
well, test dogs must endure
00:32:46
constants why not yes
00:32:50
bun it is
00:32:54
but
00:32:57
[music]
00:32:58
for clarity and
00:33:04
[music]
00:33:08
here God
00:33:11
ordered ph there get all books
00:33:17
naturally get all books there is no so the
00:33:22
implementation started in this response
00:33:27
sponsor
00:33:29
holes to have a request well and nothing
00:33:34
is returned this thing and also
00:33:40
[music]
00:33:43
no what
00:33:46
Lenin
00:33:48
what do you want from me
00:33:52
handy handy
00:33:57
Candace get all books times punk
00:34:00
sponsor is when request
00:34:07
request and also folders
00:34:11
and what you can’t
00:34:25
dumb
00:34:28
understandable
00:34:30
everything is wonderful wonderful
00:34:32
wonderful here and here before business is not for the
00:34:36
euro and before
00:34:43
boxing here we called pine god service
00:34:48
received all the books transferred to Kontek
00:34:52
so both ground than there still wants
00:34:55
limits color, well, it’s clear that we
00:34:57
got the limit, everything was so great,
00:34:59
we got all the books,
00:35:01
here’s ours,
00:35:03
or these torments before,
00:35:07
well, it was all good,
00:35:10
cover it up, or in general,
00:35:14
well, yes, you can’t, it doesn’t matter, in
00:35:16
general,
00:35:18
I won’t take up your time,
00:35:22
so we get service beeches he is a machine
00:35:25
in bytes and MB, we give it back, I say that
00:35:27
in general everything is great, that’s
00:35:38
super
00:35:44
it’s control,
00:35:45
I’ll fix the water, it depends
00:35:49
accordingly in paragraphs.
00:35:54
here we create and work with all
00:35:59
the entities that are needed to
00:36:01
service the external
00:36:05
controller here we create everything we
00:36:11
register here in general you
00:36:14
can renounce the
00:36:18
family and make an entry point here
00:36:25
in adapters
00:36:26
you can not do this because the
00:36:28
architecture still needs something to
00:36:31
help and not break so we leave 7
00:36:34
and personally I leave my family I leave main
00:36:37
doesn’t do but inside the adapters you don’t ruin
00:36:41
your life
00:36:43
I don’t ruin your life why
00:36:47
and why should I do this and
00:36:51
one more thing that we should
00:36:53
talk about this is also talk about bibi you have
00:36:55
us here there will be a directory d.b.
00:36:59
and in this debi there will be several things
00:37:08
so
00:37:11
well as
00:37:14
not here why I'm here connections soda
00:37:17
and here the adapter
00:37:19
went
00:37:21
here another small nuance
00:37:24
here come service is defined service interface
00:37:29
it can be defined not only here
00:37:32
it can be defined in another place
00:37:34
it can be defined in the adapter
00:37:41
yes
00:37:42
where by we do everything the same means here we have
00:37:44
adapters
00:37:47
and you and I can make another
00:37:49
directory here and 5 so that we can
00:37:51
separate both
00:37:54
in and pia very well and we transfer god and use
00:37:58
and where by we create the same thing
00:38:01
or the king of beech
00:38:03
territory iodide
00:38:07
that's how it turned out in the adapters again
00:38:10
I go the application has rippain and the
00:38:12
outer layer which is not the business logic of
00:38:15
communication frisk ours escorts essentially
00:38:17
none of the hundred business logic let's say
00:38:22
so they were separated hell separate
00:38:25
[music]
00:38:28
let's get to the end dzevi
00:38:32
them daddy domain let's move here the
00:38:35
user
00:38:36
and the daddy adapter
00:38:39
which consists of
00:38:41
five db.
00:38:43
interface
00:38:46
for now exit on the spot,
00:38:49
yes, just like that, and now it’s counting,
00:38:52
now to assemble it,
00:38:55
I forgot a little at home, I created a few folders, here are the
00:38:59
adapters here, IP and db.
00:39:05
and write out from on the controller the
00:39:08
service controller, that is, your adapter
00:39:12
and 5 to which the
00:39:17
control is connected to yu with cases, that is,
00:39:20
control and all this goes into the service and
00:39:23
space this is the service
00:39:26
sketch this is the service and the service
00:39:29
here the interface the interface is declared
00:39:32
services
00:39:36
let's do
00:39:39
this announce the MAZ interface
00:39:41
at the level of all adapters, here you
00:39:44
can see the service interface,
00:39:50
but I usually announce it here, it’s inconvenient, don’t
00:39:54
forget the dirt, don’t forget it costs them a long time on the
00:39:56
Maidan, a silver bullet to help,
00:39:58
to help, this is where we have to go to
00:40:00
differentiate everything in debi, everything is just
00:40:03
baby, everything is simple, it means we are creating
00:40:08
you are already 100 nights
00:40:12
and here we are
00:40:16
implementing
00:40:19
God
00:40:22
we will have that
00:40:25
beech
00:40:26
watchman structure that implements the
00:40:28
interface
00:40:30
watchman interface where is it
00:40:37
or test syntax we take all these
00:40:39
methods
00:40:54
and raises
00:40:55
and God we import from his
00:40:58
lookbook
00:41:04
everything was super box that night implements
00:41:07
the interface which declared domain
00:41:10
area
00:41:11
is great
00:41:13
in it we have methods
00:41:15
it all those plan this whole story yes I did
00:41:21
n’t swear
00:41:25
bookstore g what should be
00:41:29
boxing the same can be anything the client
00:41:33
team
00:41:35
can be a wrapper over all the client as
00:41:38
you want this is already a question of the date base but this is
00:41:43
already there must be a sky adapter yes it
00:41:45
must be here this is like a
00:41:49
p&g client already clients that man where the trouble is a
00:41:55
client [ __ ] db
00:41:58
file
00:42:00
manga [ __ ]
00:42:03
and already here there is a certain client a
00:42:07
certain client who is there
00:42:12
punk new point who does something
00:42:15
something calls before him here this client
00:42:19
will live here, would live here,
00:42:23
that is, he will be here this client
00:42:27
manga before the tables
00:42:30
and such a story
00:42:32
you don’t have in magic
00:42:34
or there in take-off then
00:42:40
so, let’s finish for 1 time often
00:42:44
yes I think an overload happened an overload
00:42:46
happened write is it necessary Is there a continuation of
00:42:49
this application that needs to be completed with the
00:42:51
use of Is it necessary to be
00:42:52
completed if the topic is
00:42:55
interesting and if you liked the presto and
00:42:57
most importantly it became clear, God bless him I
00:42:59
liked it if it’s clear, like it,
00:43:03
write comments,
00:43:04
if it’s not clear, put a dislike,
00:43:08
please so that I understand how it is in
00:43:10
general, that’s why it’s
00:43:13
broken off now in
00:43:15
mid-sentence essentially didn’t finish baby
00:43:20
butch if you want to be often
00:43:24
everyone thank you very much everyone health until we
00:43:27
meet again

Description:

Пришло время пообщаться про чистую архитектуру и ее реализацию в Go. Приятного просмотра! GitHub репозиторий: https://github.com/theartofdevel/golang-clean-architecture С радостью хочу вам представить, что я запускаю курс “Начальная подготовка” по языку Golang. Курс как для совсем начинающих в сфере IT, так и для тех, кто хочет просто изучить язык Go. Больше обо мне и курсах можно прочитать здесь: https://artofedu.org/ Больше информации есть в ролике на ютубе: https://www.youtube.com/watch?v=E0b0dmwf-6c На все вопросы могу ответить в Телеграм группе канала и в личных сообщениях. Другие видео: Уроки по Golang. Advanced. REST API. Вебсервер. https://www.youtube.com/watch?v=oTC-86QADI0 Изучаем Python. Урок 1. Основы. Бонус: Пишем приложение на FastAPI https://www.youtube.com/watch?v=JTbNTllXJBk Изучаем Golang. Урок 1. Основы + веб-сервер в 3 строки в конце урока! https://www.youtube.com/watch?v=G6eZaX_lgbQ Разработка системы заметок на Python, Golang и микросервисы в 2021 году https://www.youtube.com/watch?v=Txi95RQPRP0 Как стать разработчиком. Часть 1 https://www.youtube.com/watch?v=tUQrrm3UcbI Что такое микросервисы за 200 секунд https://www.youtube.com/watch?v=Q99r7ssHrvU Что такое Apache Kafka за 200 секунд https://www.youtube.com/watch?v=IX3N_io80es Telegram Group: https://t.me/theartofdevel VK: https://vk.com/theartofdevel Дружественный Golang чат: https://t.me/gogolang ---- Меня зовут Артур Карапетов и я занимаюсь всем, что связано с разработкой. Я создаю высоконагруженные информационные системы, стартапы, занимаюсь личным обучением людей в сфере разработки (программисты, аналитики, системные администраторы), также я помогаю компаниям и стартапам с обучением людей работать и повышением их квалификации, об этом можно почитать здесь: https://mitkadr.ru. На этом канале я выкладываю ролики на интересующие меня темы, здесь можно найти серию роликов про создание информационной системы с нуля, а также можно найти серию уроков по языкам, которые я люблю. Добро пожаловать и хорошего просмотра!

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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1" 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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1" 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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1" 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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1" 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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1"?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 "Уроки по Golang. Advanced. Чистая Архитектура / Clean Architecture Часть 1"?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.