WEBVTT

1
00:00:00.100 --> 00:00:04.380
so we're let's get rid of the
conduct nabati counter but nothing

2
00:00:04.700 --> 00:00:07.860
like a reference to the current
 ok in the view so we don't

3
00:00:07.860 --> 00:00:11.760
want to have that anymore we
still passage here so that we

4
00:00:11.760 --> 00:00:17.810
can pass it two super method
 so that we can catch the

5
00:00:17.810 --> 00:00:20.840
view to the to the car that we
still need to do that we need

6
00:00:20.840 --> 00:00:25.580
to have that observers scene
but we don't need the actual

7
00:00:25.800 --> 00:00:29.550
reference to the
current you know

8
00:00:29.640 --> 00:00:34.990
so we trust we through the
really we got the collateral

9
00:00:34.990 --> 00:00:39.240
us problems we just delete them
here we really democrats easy

10
00:00:39.240 --> 00:00:43.140
in this case but it might
yeah if we deleted here

11
00:00:43.150 --> 00:00:46.360
we might problem yes so that
 doesn't work anymore no

12
00:00:47.720 --> 00:00:50.440
so what we need to do
here we said we want to

13
00:00:50.930 --> 00:00:56.100
switch from the push from the
from poor to the push and so

14
00:00:56.110 --> 00:01:00.080
we we would has we need to pass
 a value here and we will do

15
00:01:00.080 --> 00:01:05.000
that we just do that
and as we don't know

16
00:01:05.230 --> 00:01:08.460
or as we kind of we know something
 we know that is this is

17
00:01:08.460 --> 00:01:12.460
an integer value we are currently
 pulling here yes we know

18
00:01:12.460 --> 00:01:16.210
that but maybe we want to
attach this model to another

19
00:01:16.270 --> 00:01:19.440
at this you to another model
and then it might be floats

20
00:01:19.500 --> 00:01:21.170
actually what i
would do would be

21
00:01:23.920 --> 00:01:27.070
as for object here and then
 that could be anything

22
00:01:27.460 --> 00:01:30.890
that could be anything and then
 later on just because it ok

23
00:01:30.900 --> 00:01:35.430
is one way to do it we also
could convert just go for

24
00:01:35.430 --> 00:01:38.910
the and and and use that
that would be another

25
00:01:38.910 --> 00:01:42.080
way to do that then we
would be kind of we would

26
00:01:42.080 --> 00:01:44.290
need what comes from
the and then we would

27
00:01:44.580 --> 00:01:49.260
draw rein danele to the
value right yeah so we

28
00:01:49.260 --> 00:01:53.340
just say we just assume incident
 well actually but as i said

29
00:01:53.340 --> 00:01:57.220
we probably with need to kind of
type first two sometimes nothing

30
00:01:57.220 --> 00:02:01.150
so what i would do is we
kind of say that's the

31
00:02:01.150 --> 00:02:04.640
x value because it's
the exposition so

32
00:02:04.920 --> 00:02:08.220
let's create local
 variable and x

33
00:02:09.300 --> 00:02:13.810
and x this is a
constant value

34
00:02:13.990 --> 00:02:16.670
very important it did

35
00:02:20.930 --> 00:02:23.140
and actually now we can
 run into a problem

36
00:02:23.690 --> 00:02:29.340
here it is safe probably already
 c and all content you is no

37
00:02:29.340 --> 00:02:33.750
longer implementing are
observed so yet but we will

38
00:02:34.080 --> 00:02:36.610
may run into another
problem but we will come

39
00:02:36.610 --> 00:02:41.910
to that later so let's go
 to the user yourself

40
00:02:41.910 --> 00:02:45.410
well and here we need to do
 the same so we want to

41
00:02:46.250 --> 00:02:48.940
actually people kept
 how convenient

42
00:02:51.320 --> 00:02:56.870
so account of you
should be fine

43
00:02:56.870 --> 00:03:01.280
again and it takes an object
 here instance as as long

44
00:03:01.540 --> 00:03:04.690
as to assess the memory of because
 we know quality of the method

45
00:03:04.690 --> 00:03:08.520
and we need to pass
it something in and

46
00:03:08.520 --> 00:03:14.870
maybe let's just give it
a value here are zero

47
00:03:15.030 --> 00:03:18.730
creation we can
just pause so

48
00:03:18.930 --> 00:03:22.260
so it starts on the norm
 or upper left corner

49
00:03:22.750 --> 00:03:27.960
exactly so the process in we'll
 always the zero zero is the

50
00:03:28.230 --> 00:03:33.570
upper left on it and we
still have a role in the

51
00:03:33.580 --> 00:03:38.350
content of course because
 here we call cannot

52
00:03:38.360 --> 00:03:41.910
update method and we want
to just has to come here

53
00:03:44.840 --> 00:03:50.410
and now we should define
again from this let's

54
00:03:50.410 --> 00:03:56.360
run it and see if still works
 whether we really done

55
00:03:56.370 --> 00:04:00.300
refectory or whether we
props fresh something

56
00:04:00.870 --> 00:04:06.180
so yeah looks good it's there
 was so now we kind of

57
00:04:06.350 --> 00:04:11.950
we remove we remove the
reference to the to the

58
00:04:11.960 --> 00:04:17.180
model in the in the view
 and we switch from

59
00:04:17.720 --> 00:04:23.020
pull to push and basically
i mean it's not something

60
00:04:23.020 --> 00:04:26.910
that you need to do is just kind
 of we want to play the wrong

61
00:04:26.910 --> 00:04:29.280
little bit with the code and
show you what what's possible

62
00:04:29.280 --> 00:04:33.170
and what you can do what
recruit do is we should

63
00:04:33.180 --> 00:04:36.760
added flycatcher because someone
 malicious could just process

64
00:04:36.770 --> 00:04:41.880
yeah idea is
stupid enough

65
00:04:42.040 --> 00:04:46.400
has a string in so run
the code again over no

66
00:04:46.400 --> 00:04:50.580
in front of it have
enough we can take that

67
00:04:51.170 --> 00:04:54.350
and knowing terms
because we have

68
00:04:54.360 --> 00:04:58.210
a class cus exceptional
 so yeah we

69
00:04:58.210 --> 00:05:02.780
can not cost that's what happens
 here typecasting with that

70
00:05:02.780 --> 00:05:08.420
in the course so what we
 need to do is we say

71
00:05:09.110 --> 00:05:13.540
try this stuff

72
00:05:17.580 --> 00:05:23.230
and if the exception happens
 we character sketch

73
00:05:25.440 --> 00:05:28.220
the was called class
 costs exception

74
00:05:34.670 --> 00:05:38.560
ok steers sure

75
00:05:40.630 --> 00:05:41.600
how could it out

76
00:05:47.280 --> 00:05:50.630
and actually we can
print out something in

77
00:05:50.650 --> 00:05:53.400
because we want to know
something has happened

78
00:05:54.310 --> 00:06:00.370
so is tom's with different things
well i mean in the real problem

79
00:06:00.370 --> 00:06:04.040
we actually would low yeah off
that and not system operates

80
00:06:04.040 --> 00:06:06.910
on it but you would be happy if
you see something that something

81
00:06:06.910 --> 00:06:10.010
reveals would you choose
we should just ignore it

82
00:06:10.450 --> 00:06:14.640
i think i can get
messages nice one

83
00:06:15.200 --> 00:06:18.280
could also use local as measured
 do i mean there's a lot of

84
00:06:18.290 --> 00:06:23.280
things that you can use the
and now let's run it again

85
00:06:23.860 --> 00:06:27.520
and see what happens i mean it
should crash we still has the

86
00:06:27.530 --> 00:06:31.020
are also going to russia
lower but we won't see

87
00:06:34.370 --> 00:06:37.460
so we get the error message to
but the program is running and

88
00:06:37.460 --> 00:06:41.170
we can also click click click
in there it is and there is

89
00:06:41.180 --> 00:06:43.500
now we give the correct
value from our counter

90
00:06:43.910 --> 00:06:49.490
so it was so good thing
 to try catch things

91
00:06:49.660 --> 00:06:52.570
things that can
 go wrong so

92
00:06:57.490 --> 00:07:00.790
remove this again and
here we go on with that

93
00:07:01.310 --> 00:07:04.730
and now we still want to move
the logic from the controller

94
00:07:04.730 --> 00:07:08.970
into the model right yes and
i would suggest we kind of

95
00:07:08.980 --> 00:07:13.930
first rename this method and we
 can use the great refectory

96
00:07:13.940 --> 00:07:19.650
feature from eclipse here we name
 off there's also a shortcut

97
00:07:19.650 --> 00:07:24.100
for that and we we
manage and we call

98
00:07:24.410 --> 00:07:29.940
update cart and don't for
don't forget the first

99
00:07:30.630 --> 00:07:36.840
and to make refactoring
work so we update updated

100
00:07:36.840 --> 00:07:41.060
method namely in and it also
automatically updated methane

101
00:07:41.100 --> 00:07:44.990
over here we are is quite but we
 didn't change the logic yet

102
00:07:45.130 --> 00:07:49.090
it doesn't different namely i don't
 so it was not what we intended

103
00:07:49.090 --> 00:07:54.140
so we remove the
logic relief no

104
00:07:54.140 --> 00:07:58.210
there's no logic at all and
now of course it doesn't

105
00:07:58.210 --> 00:08:02.020
work anymore calls we
still need to remove

106
00:08:02.270 --> 00:08:06.050
the argument in it now
with promising methods

107
00:08:06.390 --> 00:08:10.520
and signature again and we
 don't need that count

108
00:08:10.520 --> 00:08:14.280
any longer which when increase
could afford to call increase

109
00:08:14.280 --> 00:08:17.260
com because that's what
 it does it we first

110
00:08:17.560 --> 00:08:21.700
because article ok now we can
still i mean we can do what you

111
00:08:21.700 --> 00:08:24.500
want you could rename it again
 but not of this became

112
00:08:25.160 --> 00:08:30.350
so yeah yeah let's just let's
 try that three run it

113
00:08:31.840 --> 00:08:35.730
and doesn't still
worked just sit down

114
00:08:35.960 --> 00:08:39.980
great factory let's
 see how far get

115
00:08:40.400 --> 00:08:42.100
well probably let's
 and a video

