Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,650 --> 00:00:04,010
In the last section, we started talking about the next application that we're going to be working on,
2
00:00:04,280 --> 00:00:08,900
this application is going to have a heavy focus on object oriented programming, particularly on the
3
00:00:08,900 --> 00:00:13,010
design aspect of how we set up the different classes inside of our application.
4
00:00:13,910 --> 00:00:18,770
So to that end, I put together a diagram that's going to help walk us through a design approach for
5
00:00:18,770 --> 00:00:20,210
designing our application.
6
00:00:20,960 --> 00:00:22,700
So here's the diagram on the screen right here.
7
00:00:22,910 --> 00:00:24,650
The diagram is a little bit confusing.
8
00:00:24,680 --> 00:00:27,200
We start off first at the top left hand box.
9
00:00:27,450 --> 00:00:32,330
Then we move over to the green one, to the right of that, and then we go down to the next row and
10
00:00:32,330 --> 00:00:32,750
so on.
11
00:00:33,570 --> 00:00:37,250
So inside this section, you and I are going to tackle this first row here.
12
00:00:37,820 --> 00:00:42,980
We're going to start off by thinking about the different types of things that exist inside of our application.
13
00:00:43,880 --> 00:00:49,670
And then we'll create a dart class to represent each of those things, then over time we'll start to
14
00:00:49,670 --> 00:00:53,470
add on fields and add on methods to those classes as well.
15
00:00:54,550 --> 00:00:58,780
Now, before we start walking through the design of this card's application, I just want to throw out
16
00:00:58,780 --> 00:01:04,300
the really quick that inside of any object oriented programming approach program, there's not necessarily
17
00:01:04,300 --> 00:01:06,310
one right way of doing things.
18
00:01:06,500 --> 00:01:11,500
There might be several different designs that are totally appropriate to use inside this application
19
00:01:11,710 --> 00:01:14,410
and throw out all the other apps that we're going to work on through this course.
20
00:01:15,070 --> 00:01:19,060
So if you come up with your own design that you think works better, that's totally fine.
21
00:01:19,120 --> 00:01:22,210
There's nothing to say that your design is right or my design is right.
22
00:01:22,250 --> 00:01:23,710
They're just different approaches.
23
00:01:24,520 --> 00:01:30,100
So with that in mind, let's think about some of the different types of things or classes essentially
24
00:01:30,250 --> 00:01:33,310
that exist inside of our card's application.
25
00:01:34,880 --> 00:01:39,470
Now, as I look at this diagram right here, I really see two separate things.
26
00:01:39,800 --> 00:01:44,450
I think the first kind of thing that we might want to model inside of our application would be very
27
00:01:44,450 --> 00:01:45,020
obvious.
28
00:01:45,020 --> 00:01:47,060
It might be an individual card.
29
00:01:47,690 --> 00:01:53,390
So we might have an individual card class that represents every single card inside of our application.
30
00:01:53,930 --> 00:01:58,640
But then the second thing that kind of exists here that's kind of a little bit harder to see is the
31
00:01:58,640 --> 00:02:03,140
overall collection of cards as well, or the overall deck of cards.
32
00:02:03,890 --> 00:02:06,140
A card by itself is kind of meaningless.
33
00:02:06,380 --> 00:02:10,539
A card by itself really just has a suit and a ring like the ace of diamonds.
34
00:02:10,970 --> 00:02:16,130
It's only when we take a collection of cards and assemble them together do we get some actual meaning
35
00:02:16,130 --> 00:02:17,060
out of our program.
36
00:02:17,720 --> 00:02:20,560
So in total, I think we have two separate things here.
37
00:02:20,990 --> 00:02:26,180
I think we have a deck class that's going to have some number of fields and methods tied to it.
38
00:02:26,630 --> 00:02:31,310
And I think we're also going to have a card class that's also going to have some number of fields and
39
00:02:31,310 --> 00:02:32,230
methods tied to it.
40
00:02:33,020 --> 00:02:36,020
So with that in mind, let's move on on a diagram.
41
00:02:37,380 --> 00:02:43,050
So the step two right here says that we're going to create a class to represent each type of thing that
42
00:02:43,050 --> 00:02:44,280
we're going to have inside of our app.
43
00:02:44,950 --> 00:02:46,500
So I'm going to flip back over to Arpad.
44
00:02:47,310 --> 00:02:49,570
I've still got a bunch of code here if you want to.
45
00:02:49,650 --> 00:02:53,510
You could certainly copy paste this over to some other file and save a reference to it.
46
00:02:53,730 --> 00:02:58,770
But for me, I'm just going to highlight all of it and delete it and then I'll create two separate classes.
47
00:02:59,610 --> 00:03:06,390
The first one is going to represent the deck of cards and then the second one will represent an individual
48
00:03:06,390 --> 00:03:07,560
card by itself.
49
00:03:08,340 --> 00:03:10,400
OK, so very humble beginnings here.
50
00:03:10,590 --> 00:03:16,100
Let's take a pause and we'll continue with step two of this flow right here inside the next section.
51
00:03:16,410 --> 00:03:18,450
So a quick break and I'll see you in just a minute.
5273
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.