so we're let's get rid of the conduct nabati counter but nothing
like a reference to the current ok in the view so we don't
want to have that anymore we still passage here so that we
can pass it two super method so that we can catch the
view to the to the car that we still need to do that we need
to have that observers scene but we don't need the actual
reference to the current you know
so we trust we through the really we got the collateral
us problems we just delete them here we really democrats easy
in this case but it might yeah if we deleted here
we might problem yes so that doesn't work anymore no
so what we need to do here we said we want to
switch from the push from the from poor to the push and so
we we would has we need to pass a value here and we will do
that we just do that and as we don't know
or as we kind of we know something we know that is this is
an integer value we are currently pulling here yes we know
that but maybe we want to attach this model to another
at this you to another model and then it might be floats
actually what i would do would be
as for object here and then that could be anything
that could be anything and then later on just because it ok
is one way to do it we also could convert just go for
the and and and use that that would be another
way to do that then we would be kind of we would
need what comes from the and then we would
draw rein danele to the value right yeah so we
just say we just assume incident well actually but as i said
we probably with need to kind of type first two sometimes nothing
so what i would do is we kind of say that's the
x value because it's the exposition so
let's create local variable and x
and x this is a constant value
very important it did
and actually now we can run into a problem
here it is safe probably already c and all content you is no
longer implementing are observed so yet but we will
may run into another problem but we will come
to that later so let's go to the user yourself
well and here we need to do the same so we want to
actually people kept how convenient
so account of you should be fine
again and it takes an object here instance as as long
as to assess the memory of because we know quality of the method
and we need to pass it something in and
maybe let's just give it a value here are zero
creation we can just pause so
so it starts on the norm or upper left corner
exactly so the process in we'll always the zero zero is the
upper left on it and we still have a role in the
content of course because here we call cannot
update method and we want to just has to come here
and now we should define again from this let's
run it and see if still works whether we really done
refectory or whether we props fresh something
so yeah looks good it's there was so now we kind of
we remove we remove the reference to the to the
model in the in the view and we switch from
pull to push and basically i mean it's not something
that you need to do is just kind of we want to play the wrong
little bit with the code and show you what what's possible
and what you can do what recruit do is we should
added flycatcher because someone malicious could just process
yeah idea is stupid enough
has a string in so run the code again over no
in front of it have enough we can take that
and knowing terms because we have
a class cus exceptional so yeah we
can not cost that's what happens here typecasting with that
in the course so what we need to do is we say
try this stuff
and if the exception happens we character sketch
the was called class costs exception
ok steers sure
how could it out
and actually we can print out something in
because we want to know something has happened
so is tom's with different things well i mean in the real problem
we actually would low yeah off that and not system operates
on it but you would be happy if you see something that something
reveals would you choose we should just ignore it
i think i can get messages nice one
could also use local as measured do i mean there's a lot of
things that you can use the and now let's run it again
and see what happens i mean it should crash we still has the
are also going to russia lower but we won't see
so we get the error message to but the program is running and
we can also click click click in there it is and there is
now we give the correct value from our counter
so it was so good thing to try catch things
things that can go wrong so
remove this again and here we go on with that
and now we still want to move the logic from the controller
into the model right yes and i would suggest we kind of
first rename this method and we can use the great refectory
feature from eclipse here we name off there's also a shortcut
for that and we we manage and we call
update cart and don't for don't forget the first
and to make refactoring work so we update updated
method namely in and it also automatically updated methane
over here we are is quite but we didn't change the logic yet
it doesn't different namely i don't so it was not what we intended
so we remove the logic relief no
there's no logic at all and now of course it doesn't
work anymore calls we still need to remove
the argument in it now with promising methods
and signature again and we don't need that count
any longer which when increase could afford to call increase
com because that's what it does it we first
because article ok now we can still i mean we can do what you
want you could rename it again but not of this became
so yeah yeah let's just let's try that three run it
and doesn't still worked just sit down
great factory let's see how far get
well probably let's and a video