1 00:00:06,080 --> 00:00:07,610 - We're going to start talking 2 00:00:07,610 --> 00:00:10,310 about some design related material now, 3 00:00:10,310 --> 00:00:13,310 and this is going to be around composition. 4 00:00:13,310 --> 00:00:15,700 There's a lot of things to talk about around composition, 5 00:00:15,700 --> 00:00:16,680 and composition is something 6 00:00:16,680 --> 00:00:18,840 that you're really going to be focused on 7 00:00:18,840 --> 00:00:20,860 quite a bit as a Go developer, 8 00:00:20,860 --> 00:00:22,950 even much more than all of the concurrency 9 00:00:22,950 --> 00:00:24,747 multithreaded stuff. 10 00:00:24,747 --> 00:00:27,210 What we want to start off with here is the concept 11 00:00:27,210 --> 00:00:28,350 of grouping, 12 00:00:28,350 --> 00:00:30,020 because grouping is going to be one of these things 13 00:00:30,020 --> 00:00:31,880 where I've really got to kind of break you down 14 00:00:31,880 --> 00:00:33,140 and build you back up. 15 00:00:33,140 --> 00:00:37,070 Things are going to be a little different here in Go. 16 00:00:37,070 --> 00:00:40,250 Now, every once in a while, a couple times a year, 17 00:00:40,250 --> 00:00:42,960 I'll have somebody who I don't know reach out to me, 18 00:00:42,960 --> 00:00:44,597 maybe on Slack, and they'll say, 19 00:00:44,597 --> 00:00:46,817 "Bill, I'm a new Go developer, and everything was good, 20 00:00:46,817 --> 00:00:48,527 "but I've kind hit a roadblock 21 00:00:48,527 --> 00:00:50,247 "and I don't understand what's happening. 22 00:00:50,247 --> 00:00:51,460 "Do you think you can help?" 23 00:00:51,460 --> 00:00:53,477 I'll be like, "Yeah, absolutely, sure, no problem. 24 00:00:53,477 --> 00:00:55,320 "Show me the code." 25 00:00:55,320 --> 00:00:59,680 9 times out of 10, exactly, this is exactly what I see. 26 00:00:59,680 --> 00:01:01,140 I see this Animal type, 27 00:01:01,140 --> 00:01:03,577 and normally, the conversation kind of goes like this. 28 00:01:03,577 --> 00:01:05,817 "Oh, Bill, man, I'm learning Go, and I'm coming 29 00:01:05,817 --> 00:01:08,127 "from some object-oriented programming language. 30 00:01:08,127 --> 00:01:10,027 "I was really getting the hang of this, 31 00:01:10,027 --> 00:01:11,857 "I really thought I could be a Go developer, Bill. 32 00:01:11,857 --> 00:01:12,957 "Look, look what was happening. 33 00:01:12,957 --> 00:01:14,986 "I have this Animal type, right, an Animal, 34 00:01:14,986 --> 00:01:17,857 "it's a base type, Bill, for anything that's an Animal. 35 00:01:17,857 --> 00:01:19,687 "It's got a Name, it's got an IsMammal, right. 36 00:01:19,687 --> 00:01:21,963 "These are common fields, but right, you understand it. 37 00:01:21,963 --> 00:01:23,517 "You know what, even Animals, I learned 38 00:01:23,517 --> 00:01:24,477 "that I can add behaviors, 39 00:01:24,477 --> 00:01:27,487 "so here's this Animal that knows how to Speak, there it is. 40 00:01:27,487 --> 00:01:29,877 "I know, Bill, animals generically don't know how to speak, 41 00:01:29,877 --> 00:01:31,597 "but I was able to add this behavior. 42 00:01:31,597 --> 00:01:34,087 "This was all making sense to me. 43 00:01:34,087 --> 00:01:35,737 "Bill, if you're going to have a Animal, 44 00:01:35,737 --> 00:01:37,187 "then you have to have a Dog, and look, 45 00:01:37,187 --> 00:01:39,557 "I was using embedding, just like, 46 00:01:39,557 --> 00:01:43,237 "to be able to say that a Dog is everything an Animal is, 47 00:01:43,237 --> 00:01:45,027 "and I extended it, right, Bill. 48 00:01:45,027 --> 00:01:46,537 "We can do that with inheritance and stuff, 49 00:01:46,537 --> 00:01:48,237 "but I'm doing it with embedding. 50 00:01:48,237 --> 00:01:49,947 "Life was good, and then I really made 51 00:01:49,947 --> 00:01:52,017 "this Dog be able to speak properly, 'Woof!' 52 00:01:52,017 --> 00:01:53,277 "There it is, right there, Bill, right, 53 00:01:53,277 --> 00:01:55,227 "like you see it there, Dog. 54 00:01:55,227 --> 00:01:56,167 "Bill, if you're going to have a Dog, 55 00:01:56,167 --> 00:01:57,257 "then you've got to have a Cat, 56 00:01:57,257 --> 00:01:58,987 "and here's the Cat right there. 57 00:01:58,987 --> 00:02:01,237 "Cat also embeds the Animal, 58 00:02:01,237 --> 00:02:03,507 "because a Cat is everything an Animal is, right, 59 00:02:03,507 --> 00:02:04,827 "anti-promotion, Bill. 60 00:02:04,827 --> 00:02:07,877 "Then I made the Cat speak, 'Meow,' there it is right there. 61 00:02:07,877 --> 00:02:10,367 "I got this Dog and I got this Cat, and everything was good, 62 00:02:10,367 --> 00:02:12,637 "like this is exactly how I write code, 63 00:02:12,637 --> 00:02:13,877 "and everything was good. 64 00:02:13,877 --> 00:02:16,357 "But then, Bill, I ran into a problem. 65 00:02:16,357 --> 00:02:20,387 "You see, I wanted to group the Dogs and Cats together 66 00:02:20,387 --> 00:02:24,027 "and I tried to group them by what they are, 67 00:02:24,027 --> 00:02:25,277 "which is an Animal. 68 00:02:25,277 --> 00:02:28,427 "I could do this before, but Go is not letting me do this. 69 00:02:28,427 --> 00:02:30,487 "This code is not compiling, Bill. 70 00:02:30,487 --> 00:02:33,407 "Why is it that I cannot group Dogs and Cats 71 00:02:33,407 --> 00:02:36,260 "by what they are, which is an Animal?" 72 00:02:36,260 --> 00:02:38,700 OK, this is one of the very first things 73 00:02:38,700 --> 00:02:40,150 you've got to realize. 74 00:02:40,150 --> 00:02:42,937 It goes very strong on their type system, 75 00:02:42,937 --> 00:02:46,170 and the fact that you've embedded Animal into Dog and Cat 76 00:02:46,170 --> 00:02:48,130 means zero, it means nothing, 77 00:02:48,130 --> 00:02:52,840 there is no subtyping, there is no subclassing in Go. 78 00:02:52,840 --> 00:02:55,623 Animals are animals, dogs are dogs, and cats are cats. 79 00:02:57,000 --> 00:02:59,060 I can understand how this developer has kind of 80 00:02:59,060 --> 00:03:00,550 gotten stuck here. 81 00:03:00,550 --> 00:03:02,340 How do we answer this question, 82 00:03:02,340 --> 00:03:05,230 what is the problem here and how do we solve it? 83 00:03:05,230 --> 00:03:06,273 The first thing I want you to understand 84 00:03:06,273 --> 00:03:11,273 that Go is about convention over configuration. 85 00:03:11,600 --> 00:03:13,220 Remember that. 86 00:03:13,220 --> 00:03:17,730 Go says the configuration is limiting. 87 00:03:17,730 --> 00:03:19,010 It really is. 88 00:03:19,010 --> 00:03:21,750 I mean, if I'm in a room in a classroom situation 89 00:03:21,750 --> 00:03:25,261 with 15, 20 people, I will ask them, 90 00:03:25,261 --> 00:03:27,747 "Is anybody in this room a sibling, 91 00:03:27,747 --> 00:03:30,732 "or does anybody have brothers, sisters, siblings?" 92 00:03:30,732 --> 00:03:32,670 Normally the answer is no. 93 00:03:32,670 --> 00:03:35,217 I say, "Well, look, if we really wanted to group people 94 00:03:35,217 --> 00:03:38,467 "in this classroom based on who we are, 95 00:03:38,467 --> 00:03:41,617 "based on configuration, we wouldn't be able to do it. 96 00:03:41,617 --> 00:03:43,657 "We'd all be isolated from each other, 97 00:03:43,657 --> 00:03:45,917 "because unless we have the same parents, 98 00:03:45,917 --> 00:03:49,240 "there's no configuration in the room." 99 00:03:49,240 --> 00:03:52,690 Go is very, very against that kind 100 00:03:52,690 --> 00:03:54,720 of limiting configuration. 101 00:03:54,720 --> 00:03:57,420 Go is really about diversity. 102 00:03:57,420 --> 00:04:01,720 Go is about not who we are, animals, in a sense, 103 00:04:01,720 --> 00:04:04,830 but Go is about what we do. 104 00:04:04,830 --> 00:04:08,600 If we look and group things by what we do 105 00:04:08,600 --> 00:04:12,480 and not by who we are, then we have a level of diversity. 106 00:04:12,480 --> 00:04:15,640 We can all in that classroom be paired up together 107 00:04:15,640 --> 00:04:17,220 individually, in different groups. 108 00:04:17,220 --> 00:04:19,710 There's almost an infinite number of ways 109 00:04:19,710 --> 00:04:21,040 we can group ourselves, 110 00:04:21,040 --> 00:04:24,330 because I'm sure I can find some commonality with you 111 00:04:24,330 --> 00:04:25,880 on something that we enjoy to do. 112 00:04:25,880 --> 00:04:28,810 Obviously, I think we enjoy programming in Go. 113 00:04:28,810 --> 00:04:32,070 That's a behavior that we can group ourselves behind. 114 00:04:32,070 --> 00:04:35,440 Go is very much about, let's not limit ourselves 115 00:04:35,440 --> 00:04:39,470 on configuration, but let's focus on what we do. 116 00:04:39,470 --> 00:04:42,850 In this code, we have the behavior we're looking for. 117 00:04:42,850 --> 00:04:45,930 It's Speak, dogs know how to speak, cats know how to speak. 118 00:04:45,930 --> 00:04:50,010 We can group everything by what we do. 119 00:04:50,010 --> 00:04:52,310 Now, I also, at this point, I also want to be able 120 00:04:52,310 --> 00:04:56,030 to start reading code and identify smells. 121 00:04:56,030 --> 00:04:57,510 This is very important. 122 00:04:57,510 --> 00:05:00,470 When we see smells in code, it becomes also critical 123 00:05:00,470 --> 00:05:03,210 for our ability to be able to talk about, verbalize, 124 00:05:03,210 --> 00:05:06,843 explain, have the right language to help people understand 125 00:05:06,843 --> 00:05:08,990 what the smells are and how to fix it. 126 00:05:08,990 --> 00:05:12,200 There's a lot of smells in this code as well 127 00:05:12,200 --> 00:05:13,253 when I go through it. 128 00:05:14,210 --> 00:05:18,690 Look, just alone, when I see that Animal type right there, 129 00:05:18,690 --> 00:05:20,080 when I see that Animal type, 130 00:05:20,080 --> 00:05:24,260 I notice that this is really a generic type 131 00:05:24,260 --> 00:05:28,310 just being placed in the code for reusable state. 132 00:05:28,310 --> 00:05:31,790 I'm really always concerned about that. 133 00:05:31,790 --> 00:05:34,790 The bigger smell, too, is that I've defined a type 134 00:05:34,790 --> 00:05:38,050 called Animal, and yet we're not really using it. 135 00:05:38,050 --> 00:05:42,020 I do not need a value of type Animal in this program 136 00:05:42,020 --> 00:05:44,460 in order for the program to be able to work. 137 00:05:44,460 --> 00:05:46,120 I could get rid of Animal, 138 00:05:46,120 --> 00:05:48,590 embed those fields in Cat and Dog, 139 00:05:48,590 --> 00:05:52,320 and I wouldn't have to break a single method or function. 140 00:05:52,320 --> 00:05:54,120 That, again, is a smell. 141 00:05:54,120 --> 00:05:57,600 I only want types where we need values of that type. 142 00:05:57,600 --> 00:05:59,740 I want to be very, very clear 143 00:05:59,740 --> 00:06:03,147 that to define a type, literally for reusable state, 144 00:06:03,147 --> 00:06:06,140 is a smell, there are exceptions to every rule. 145 00:06:06,140 --> 00:06:08,790 But because we don't need an Animal, guess what? 146 00:06:08,790 --> 00:06:09,840 We don't need the type. 147 00:06:09,840 --> 00:06:12,380 From my perspective, it's type pollution. 148 00:06:12,380 --> 00:06:14,727 Believe it or not, a little copying and pasting 149 00:06:14,727 --> 00:06:17,510 can go a very long way. 150 00:06:17,510 --> 00:06:19,400 We've been taught these concepts of DRY, 151 00:06:19,400 --> 00:06:21,170 Do not Repeat Yourself. 152 00:06:21,170 --> 00:06:24,740 But I think the cost of Do not Repeat Yourself in Go 153 00:06:24,740 --> 00:06:27,470 is worse than maybe some of these other languages 154 00:06:27,470 --> 00:06:28,620 you've worked on. 155 00:06:28,620 --> 00:06:31,870 Coupling is always going to be a bigger cost 156 00:06:31,870 --> 00:06:33,570 than a little duplication. 157 00:06:33,570 --> 00:06:36,340 We'll continue to see that as we move on. 158 00:06:36,340 --> 00:06:39,920 Also, when we look at the Speak implementation for Animal, 159 00:06:39,920 --> 00:06:41,740 it is completely useless. 160 00:06:41,740 --> 00:06:43,680 There's no value in it. 161 00:06:43,680 --> 00:06:45,080 Think about what we've done. 162 00:06:45,080 --> 00:06:48,070 I've added a type, I've added a method called Speak, 163 00:06:48,070 --> 00:06:51,160 these things need tests, which can't really be accurate. 164 00:06:51,160 --> 00:06:52,380 They're not used. 165 00:06:52,380 --> 00:06:54,930 This is code that we have to, now, 166 00:06:54,930 --> 00:06:57,750 increase our lines of code, increase our bug potential, 167 00:06:57,750 --> 00:06:59,430 increase our test cases, 168 00:06:59,430 --> 00:07:03,190 and it adds zero value to the software. 169 00:07:03,190 --> 00:07:05,220 We really, really, really don't want 170 00:07:05,220 --> 00:07:07,230 to be polluting software like that. 171 00:07:07,230 --> 00:07:09,720 I understand where this developer's coming from 172 00:07:09,720 --> 00:07:12,400 with the idea of grouping things by animal 173 00:07:12,400 --> 00:07:13,970 and creating this reasonable state. 174 00:07:13,970 --> 00:07:16,650 But this is not how, at least, I want you 175 00:07:16,650 --> 00:07:20,340 to design and architect and write code in the future. 176 00:07:20,340 --> 00:07:23,020 Then, how do we correct this program? 177 00:07:23,020 --> 00:07:24,920 What are we going to tell this developer? 178 00:07:24,920 --> 00:07:27,010 Well, simply what I'm going to tell the developer is, 179 00:07:27,010 --> 00:07:30,000 stop thinking about who you are. 180 00:07:30,000 --> 00:07:32,720 Stop thinking about what cats and dogs are 181 00:07:32,720 --> 00:07:37,100 and start focusing on what cats and dogs do. 182 00:07:37,100 --> 00:07:41,400 This is what's important, what cats and dogs do. 183 00:07:41,400 --> 00:07:44,490 It's configuration, no, convention, 184 00:07:44,490 --> 00:07:46,490 convention over configuration. 185 00:07:46,490 --> 00:07:47,810 Let's do this instead. 186 00:07:47,810 --> 00:07:50,680 Let's remove the Animal type, it is pure pollution 187 00:07:50,680 --> 00:07:52,290 as far as I'm concerned. 188 00:07:52,290 --> 00:07:54,190 Let's just bring in an interface, 189 00:07:54,190 --> 00:07:56,240 the Speaker interface, that behavior. 190 00:07:56,240 --> 00:08:00,370 Remember, interfaces should define behavior, 191 00:08:00,370 --> 00:08:02,600 not persons, places, and things. 192 00:08:02,600 --> 00:08:04,300 I want the Speaker interface. 193 00:08:04,300 --> 00:08:06,460 If I saw an Animal interface here, 194 00:08:06,460 --> 00:08:07,810 I'd be very, very sad. 195 00:08:07,810 --> 00:08:08,800 That's not it. 196 00:08:08,800 --> 00:08:10,700 Let's keep the concrete types 197 00:08:10,700 --> 00:08:12,840 as those persons, places, and things, 198 00:08:12,840 --> 00:08:15,340 and let's have the interface describe the behavior. 199 00:08:15,340 --> 00:08:17,300 That's the convention we're looking for. 200 00:08:17,300 --> 00:08:18,730 OK, so we've got the Speaker interface, 201 00:08:18,730 --> 00:08:20,630 one active behavior, Speak. 202 00:08:20,630 --> 00:08:23,050 Then when what I'm going to do is a little copy and paste. 203 00:08:23,050 --> 00:08:27,530 Yes, I'm going to copy those common fields into Dog and Cat. 204 00:08:27,530 --> 00:08:29,247 You might say, "No, no, no, no, Bill, what are you doing? 205 00:08:29,247 --> 00:08:31,270 "What if the common fields have to change?" 206 00:08:31,270 --> 00:08:34,070 I'm going to then go and change what needs to be changed, 207 00:08:34,070 --> 00:08:36,410 I'm going to refactor what needs to refactor. 208 00:08:36,410 --> 00:08:38,750 This is going to make code more readable 209 00:08:38,750 --> 00:08:42,340 and easier to debug and easier to test. 210 00:08:42,340 --> 00:08:45,430 I promise you, because it's always there in front of you. 211 00:08:45,430 --> 00:08:48,840 Dog is more precise, Cat is more precise. 212 00:08:48,840 --> 00:08:50,800 These things I have learned over decades 213 00:08:50,800 --> 00:08:52,050 of software development 214 00:08:52,050 --> 00:08:56,302 that these benefits outweigh that cost of DRY. 215 00:08:56,302 --> 00:08:58,530 There's my Dog, Name, IsMammal, Pack, 216 00:08:58,530 --> 00:09:00,980 here's the Speak again, here's Cat again. 217 00:09:00,980 --> 00:09:02,870 We just copied a couple of fields in there. 218 00:09:02,870 --> 00:09:03,873 Here's Speak. 219 00:09:03,873 --> 00:09:07,700 Now we're able to create a collection of Cats and Dogs 220 00:09:07,700 --> 00:09:10,710 by what they do, what they do. 221 00:09:10,710 --> 00:09:12,190 This is brilliant stuff, 222 00:09:12,190 --> 00:09:15,230 because the compiler is dynamic in its ability 223 00:09:15,230 --> 00:09:18,150 to do static code analysis. 224 00:09:18,150 --> 00:09:21,780 We're able to leverage convention, very, very powerful here. 225 00:09:21,780 --> 00:09:24,330 We're going to see, in our next section, 226 00:09:24,330 --> 00:09:27,520 what we really show how composition 227 00:09:27,520 --> 00:09:31,420 can help us design code that's really decoupled from change. 228 00:09:31,420 --> 00:09:33,750 But before we look at that next example, 229 00:09:33,750 --> 00:09:35,160 let's just go through these notes, 230 00:09:35,160 --> 00:09:37,670 because I want to give you some guidelines 231 00:09:37,670 --> 00:09:40,140 around declaring types that we're going to be using 232 00:09:40,140 --> 00:09:41,420 as we move on. 233 00:09:41,420 --> 00:09:44,230 I really want you to focus on declaring types 234 00:09:44,230 --> 00:09:47,320 that represent something new or unique, 235 00:09:47,320 --> 00:09:49,700 always new or unique. 236 00:09:49,700 --> 00:09:53,110 I really want you to avoid the concepts of aliasing. 237 00:09:53,110 --> 00:09:54,850 When I see a type like this, 238 00:09:54,850 --> 00:09:56,370 let me just throw this out here. 239 00:09:56,370 --> 00:10:00,320 If I see somebody do a type like this, handle int, 240 00:10:00,320 --> 00:10:02,800 I start to cringe a little bit. 241 00:10:02,800 --> 00:10:06,097 I try to say, "Is handle something really new and unique, 242 00:10:06,097 --> 00:10:08,397 "or are you just trying to abstract the concept 243 00:10:08,397 --> 00:10:10,090 "that a handle is an integer?" 244 00:10:10,090 --> 00:10:12,810 If I don't see a method set after this type, 245 00:10:12,810 --> 00:10:14,890 it's a good, good indication 246 00:10:14,890 --> 00:10:17,530 that maybe we're trying to do some sort 247 00:10:17,530 --> 00:10:21,250 of abstraction, really, of aliasing, right. 248 00:10:21,250 --> 00:10:22,880 But what I'm going to say is this. 249 00:10:22,880 --> 00:10:24,847 You might say, "Well, Bill, I want to do that, 250 00:10:24,847 --> 00:10:26,417 "because I want to write a function 251 00:10:26,417 --> 00:10:28,287 "that can only take a handle 252 00:10:28,287 --> 00:10:30,940 "and I want the compiler to protect me from that." 253 00:10:30,940 --> 00:10:33,100 I understand other programming languages, 254 00:10:33,100 --> 00:10:34,410 this would really be possible. 255 00:10:34,410 --> 00:10:35,970 But it's not possible in Go. 256 00:10:35,970 --> 00:10:39,580 Remember, that constant of a kind 257 00:10:39,580 --> 00:10:41,820 can be implicitly converted. 258 00:10:41,820 --> 00:10:44,810 That code on line 89 there would be compilable. 259 00:10:44,810 --> 00:10:46,520 We would be able to compile that. 260 00:10:46,520 --> 00:10:48,960 Since you can't get that protection, 261 00:10:48,960 --> 00:10:50,077 especially on a type like handle 262 00:10:50,077 --> 00:10:52,280 that's based on a built in type, 263 00:10:52,280 --> 00:10:54,000 then I don't want you to do it at all. 264 00:10:54,000 --> 00:10:56,750 If you can't have it 100% of the time, you can't have it. 265 00:10:56,750 --> 00:11:00,080 For me, a better API design here for handle 266 00:11:00,080 --> 00:11:02,250 would be the variable name being called handle 267 00:11:02,250 --> 00:11:05,380 and the type being int, because handles really are int. 268 00:11:05,380 --> 00:11:09,573 Don't abstract or alias what the data actually is. 269 00:11:10,420 --> 00:11:11,860 If you cannot define a type 270 00:11:11,860 --> 00:11:14,550 that truly represents something new, 271 00:11:14,550 --> 00:11:18,210 something that isn't truly the base type, well, guess what? 272 00:11:18,210 --> 00:11:19,890 I don't want you to have it. 273 00:11:19,890 --> 00:11:23,540 Again, the clear example of that is Duration. 274 00:11:23,540 --> 00:11:26,103 Duration and the time package is an int64, 275 00:11:26,103 --> 00:11:27,740 it's based on int64. 276 00:11:27,740 --> 00:11:30,590 But really, Duration doesn't represent an integer, 277 00:11:30,590 --> 00:11:33,350 it represents nanoseconds of time. 278 00:11:33,350 --> 00:11:35,060 I want you to see the difference 279 00:11:35,060 --> 00:11:36,820 between handle and Duration, 280 00:11:36,820 --> 00:11:39,540 it does represent something new. 281 00:11:39,540 --> 00:11:42,400 There's actually method sets around that. 282 00:11:42,400 --> 00:11:45,710 We need to always validate, that if you define a type, 283 00:11:45,710 --> 00:11:47,880 that we are creating values of that type, 284 00:11:47,880 --> 00:11:50,900 and we need to use values of a type on their own. 285 00:11:50,900 --> 00:11:52,640 If we're not, then you've defined a type 286 00:11:52,640 --> 00:11:56,090 purely as an abstraction layer of reusable state, 287 00:11:56,090 --> 00:11:59,070 and I want that to be a big, big smell. 288 00:11:59,070 --> 00:12:00,610 Another thing here is we're going to learn, 289 00:12:00,610 --> 00:12:01,780 we're going to embed. 290 00:12:01,780 --> 00:12:06,570 Embed types for behavior, not for state. 291 00:12:06,570 --> 00:12:09,660 Remember, we're decoupling, decoupling's based on behavior, 292 00:12:09,660 --> 00:12:12,910 the concrete data that has the behavior drives it. 293 00:12:12,910 --> 00:12:15,730 But if I see embedding and it's not clear to me 294 00:12:15,730 --> 00:12:17,650 why we're doing it, the behavior, 295 00:12:17,650 --> 00:12:19,120 I'm going to ask you, I want to know 296 00:12:19,120 --> 00:12:21,866 what behavior we are trying to promote 297 00:12:21,866 --> 00:12:25,660 or gain access to through the embedding? 298 00:12:25,660 --> 00:12:27,690 Question any type that is an alias 299 00:12:27,690 --> 00:12:31,280 or an abstraction of an existing type also. 300 00:12:31,280 --> 00:12:33,820 Always question types whose sole purpose 301 00:12:33,820 --> 00:12:35,220 is to share common state. 302 00:12:35,220 --> 00:12:37,653 We always want to be focusing on behavior.