[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:16.76,0:00:20.81,Default,,0000,0000,0000,,NICHOLAS HENRY: Good morning. Dialogue: 0,0:00:20.81,0:00:24.12,Default,,0000,0000,0000,,How many of you have read or heard of the\Nbook, Dialogue: 0,0:00:24.12,0:00:25.62,Default,,0000,0000,0000,,Drawing on the Right Side of the Brain? Dialogue: 0,0:00:25.62,0:00:28.75,Default,,0000,0000,0000,,OK. We've got a, we've got a few people. Dialogue: 0,0:00:28.75,0:00:30.31,Default,,0000,0000,0000,,All right. Excellent. Dialogue: 0,0:00:30.31,0:00:32.07,Default,,0000,0000,0000,,For those who don't know, this book was authored Dialogue: 0,0:00:32.07,0:00:36.73,Default,,0000,0000,0000,,by Betty Edwards. It was originally published\Nin 1979, Dialogue: 0,0:00:36.73,0:00:40.54,Default,,0000,0000,0000,,and this latest edition was published in 1999.\NAnd Dialogue: 0,0:00:40.54,0:00:43.39,Default,,0000,0000,0000,,it dispelled this myth that drawing was a\Ntalent Dialogue: 0,0:00:43.39,0:00:45.71,Default,,0000,0000,0000,,that you were born with. And it's actually\Na Dialogue: 0,0:00:45.71,0:00:47.98,Default,,0000,0000,0000,,skill that can be learned. Dialogue: 0,0:00:47.98,0:00:52.83,Default,,0000,0000,0000,,Now, one of these skills is viewing negative\Nspace. Dialogue: 0,0:00:52.83,0:00:55.13,Default,,0000,0000,0000,,The idea that you draw the ob- you don't Dialogue: 0,0:00:55.13,0:00:57.66,Default,,0000,0000,0000,,draw the object, but you draw the spaces in Dialogue: 0,0:00:57.66,0:01:01.21,Default,,0000,0000,0000,,between the object. And this tricks the brain.\NIt Dialogue: 0,0:01:01.21,0:01:03.29,Default,,0000,0000,0000,,switches the brain from a left mode to a Dialogue: 0,0:01:03.29,0:01:06.44,Default,,0000,0000,0000,,logical think- from a logical thinking mode\Nto a Dialogue: 0,0:01:06.44,0:01:09.46,Default,,0000,0000,0000,,right-brain or a perceptual mode. Dialogue: 0,0:01:09.46,0:01:11.75,Default,,0000,0000,0000,,And the benefit of this is when we're making Dialogue: 0,0:01:11.75,0:01:16.37,Default,,0000,0000,0000,,logical decisions, but we make bad perceptual\Ndecisions. Great Dialogue: 0,0:01:16.37,0:01:18.86,Default,,0000,0000,0000,,example is this chair. If you look at the Dialogue: 0,0:01:18.86,0:01:21.72,Default,,0000,0000,0000,,chair, you'll see the legs are quite thin.\NAnd Dialogue: 0,0:01:21.72,0:01:23.83,Default,,0000,0000,0000,,logically you think, man, if I sit on that Dialogue: 0,0:01:23.83,0:01:25.67,Default,,0000,0000,0000,,chair, that's not gonna hold. That's not gonna\Nsupport Dialogue: 0,0:01:25.67,0:01:28.94,Default,,0000,0000,0000,,a person. And so logically would go, would\Nincrease Dialogue: 0,0:01:28.94,0:01:31.19,Default,,0000,0000,0000,,the size of those legs, and we end up Dialogue: 0,0:01:31.19,0:01:33.17,Default,,0000,0000,0000,,distorting the, the picture. Dialogue: 0,0:01:33.17,0:01:39.81,Default,,0000,0000,0000,,Betty Edwards describes drawing as five, sorry,\Nshe describes Dialogue: 0,0:01:39.81,0:01:43.70,Default,,0000,0000,0000,,drawing as a global skill, consisting of five\Nbasic Dialogue: 0,0:01:43.70,0:01:48.84,Default,,0000,0000,0000,,skills. And she describes these skills as\Nperceptual skills. Dialogue: 0,0:01:48.84,0:01:52.92,Default,,0000,0000,0000,,The ability to correctly and efficiently understand\Nwhat is Dialogue: 0,0:01:52.92,0:01:54.92,Default,,0000,0000,0000,,being seen. Dialogue: 0,0:01:54.92,0:01:57.14,Default,,0000,0000,0000,,I'm Nicholas Henry, and I'd like to welcome\Nyou Dialogue: 0,0:01:57.14,0:01:59.70,Default,,0000,0000,0000,,to my talk, Modeling on the Right Side of Dialogue: 0,0:01:59.70,0:02:02.09,Default,,0000,0000,0000,,the Brain, where I'll introduce you to the\Nfive Dialogue: 0,0:02:02.09,0:02:06.28,Default,,0000,0000,0000,,basic skills of object-modeling. We will explore\Nusing color Dialogue: 0,0:02:06.28,0:02:09.62,Default,,0000,0000,0000,,and patterns to help you visualize and communicate\Nand Dialogue: 0,0:02:09.62,0:02:13.34,Default,,0000,0000,0000,,understand the main models. Dialogue: 0,0:02:13.34,0:02:16.39,Default,,0000,0000,0000,,And the five basic skills for object-modeling\Nare finding Dialogue: 0,0:02:16.39,0:02:23.37,Default,,0000,0000,0000,,objects, identifying collaborations, defining\Nbusiness rules, and assigning services Dialogue: 0,0:02:23.37,0:02:26.03,Default,,0000,0000,0000,,and attributes. Dialogue: 0,0:02:26.03,0:02:27.36,Default,,0000,0000,0000,,So I just want to make sure we're all Dialogue: 0,0:02:27.36,0:02:29.95,Default,,0000,0000,0000,,on the same page, in, in terms of what Dialogue: 0,0:02:29.95,0:02:32.26,Default,,0000,0000,0000,,a domain model is. So we're just gonna review Dialogue: 0,0:02:32.26,0:02:35.47,Default,,0000,0000,0000,,the scenario of shipping an order, which would\Nbehest Dialogue: 0,0:02:35.47,0:02:37.52,Default,,0000,0000,0000,,be an economist domain. Dialogue: 0,0:02:37.52,0:02:41.74,Default,,0000,0000,0000,,Now, a domain really represents a business\Nprocess. So Dialogue: 0,0:02:41.74,0:02:44.15,Default,,0000,0000,0000,,let's go through, through this example. So\Nwe have Dialogue: 0,0:02:44.15,0:02:47.28,Default,,0000,0000,0000,,a business request that comes into our domain.\NIn Dialogue: 0,0:02:47.28,0:02:50.71,Default,,0000,0000,0000,,this case it's to ship an order. An order Dialogue: 0,0:02:50.71,0:02:54.74,Default,,0000,0000,0000,,which represents a business object will receive\Nthis, and Dialogue: 0,0:02:54.74,0:02:57.64,Default,,0000,0000,0000,,it will go ahead and create a shipment. Another Dialogue: 0,0:02:57.64,0:03:00.29,Default,,0000,0000,0000,,business object that it'll collaborate with. Dialogue: 0,0:03:00.29,0:03:02.58,Default,,0000,0000,0000,,But we probably want to make sure that order's Dialogue: 0,0:03:02.58,0:03:04.88,Default,,0000,0000,0000,,been paid for before we ship that order. It Dialogue: 0,0:03:04.88,0:03:07.66,Default,,0000,0000,0000,,probably wouldn't make much sense, business\Nsense, right. So Dialogue: 0,0:03:07.66,0:03:10.42,Default,,0000,0000,0000,,we have a business role that will check that Dialogue: 0,0:03:10.42,0:03:12.72,Default,,0000,0000,0000,,that order's actually been paid for. Dialogue: 0,0:03:12.72,0:03:17.38,Default,,0000,0000,0000,,So, essentially, a business domain, or a domain\Nmodel, Dialogue: 0,0:03:17.38,0:03:20.90,Default,,0000,0000,0000,,is a set of business objects that represent\Nthese Dialogue: 0,0:03:20.90,0:03:25.64,Default,,0000,0000,0000,,real-world entities. There are collaborations,\Nthere are business rules, Dialogue: 0,0:03:25.64,0:03:29.91,Default,,0000,0000,0000,,and there are services that respond to business\Nrequests. Dialogue: 0,0:03:29.91,0:03:33.40,Default,,0000,0000,0000,,Now, a model is simply a representation of\Nsomething. Dialogue: 0,0:03:33.40,0:03:36.36,Default,,0000,0000,0000,,It could be a mental model, our mental understanding Dialogue: 0,0:03:36.36,0:03:39.23,Default,,0000,0000,0000,,of how a business process works. It might\Nbe Dialogue: 0,0:03:39.23,0:03:42.23,Default,,0000,0000,0000,,a graphical notation or, sorry, a graphical\Nmodel such Dialogue: 0,0:03:42.23,0:03:44.96,Default,,0000,0000,0000,,as a notation that I'm using up here. Or Dialogue: 0,0:03:44.96,0:03:47.89,Default,,0000,0000,0000,,it might even be codified in your models directory Dialogue: 0,0:03:47.89,0:03:49.69,Default,,0000,0000,0000,,in your Rails application. Dialogue: 0,0:03:49.69,0:03:53.24,Default,,0000,0000,0000,,Of course, there are other concerns when you're\Nbuilding Dialogue: 0,0:03:53.24,0:03:56.39,Default,,0000,0000,0000,,an application. These things like persisting\Nthose business objects Dialogue: 0,0:03:56.39,0:04:01.81,Default,,0000,0000,0000,,to a database, generating HTML or JSON, or\Neven Dialogue: 0,0:04:01.81,0:04:05.44,Default,,0000,0000,0000,,handling that HTTP request that comes into\Nyour controller. Dialogue: 0,0:04:05.44,0:04:07.65,Default,,0000,0000,0000,,But these are things that are outside of your Dialogue: 0,0:04:07.65,0:04:09.86,Default,,0000,0000,0000,,domain model. And you can, can think of the Dialogue: 0,0:04:09.86,0:04:15.78,Default,,0000,0000,0000,,domain model as the heart of your application. Dialogue: 0,0:04:15.78,0:04:17.88,Default,,0000,0000,0000,,So I use this term business services when\Na Dialogue: 0,0:04:17.88,0:04:21.06,Default,,0000,0000,0000,,business request comes in, we'll use a business\Nservice Dialogue: 0,0:04:21.06,0:04:24.45,Default,,0000,0000,0000,,to respond to that request. Now, this is where Dialogue: 0,0:04:24.45,0:04:26.80,Default,,0000,0000,0000,,the services that you might have heard in\Nthe Dialogue: 0,0:04:26.80,0:04:30.41,Default,,0000,0000,0000,,previous talk on domain-driven design, and\Nit's a pattern Dialogue: 0,0:04:30.41,0:04:33.35,Default,,0000,0000,0000,,that Rails developers have developed over\Nthe last couple Dialogue: 0,0:04:33.35,0:04:35.67,Default,,0000,0000,0000,,of years, where we create a service class\Nto Dialogue: 0,0:04:35.67,0:04:38.85,Default,,0000,0000,0000,,encapsulate logic such as, sort of, sending\Nout an Dialogue: 0,0:04:38.85,0:04:44.07,Default,,0000,0000,0000,,email or finding, finding a user record. Dialogue: 0,0:04:44.07,0:04:45.50,Default,,0000,0000,0000,,And the idea is to kind of thin down Dialogue: 0,0:04:45.50,0:04:48.28,Default,,0000,0000,0000,,the responsibilities of the controller. When\NI use the Dialogue: 0,0:04:48.28,0:04:50.76,Default,,0000,0000,0000,,term service, I'm not referring to that. I'm\Nreferring Dialogue: 0,0:04:50.76,0:04:53.91,Default,,0000,0000,0000,,to this idea of responding to a business request. Dialogue: 0,0:04:53.91,0:04:56.16,Default,,0000,0000,0000,,I'll try to use the, the term business service Dialogue: 0,0:04:56.16,0:05:02.12,Default,,0000,0000,0000,,to differentiate from this idea of a service\Nclass. Dialogue: 0,0:05:02.12,0:05:05.95,Default,,0000,0000,0000,,So why, why object modeling? Well, it feels\Nlike Dialogue: 0,0:05:05.95,0:05:08.90,Default,,0000,0000,0000,,there's a gap between user stories. You know,\Nuser Dialogue: 0,0:05:08.90,0:05:12.10,Default,,0000,0000,0000,,stories are great at requirements gathering.\NThey're great for Dialogue: 0,0:05:12.10,0:05:17.98,Default,,0000,0000,0000,,describing business requests at, from the\Nend user's perspective. Dialogue: 0,0:05:17.98,0:05:19.85,Default,,0000,0000,0000,,But how do we take those requirements and\Nthen Dialogue: 0,0:05:19.85,0:05:22.51,Default,,0000,0000,0000,,go ahead and implement that model in our Rails Dialogue: 0,0:05:22.51,0:05:23.17,Default,,0000,0000,0000,,application? Dialogue: 0,0:05:23.17,0:05:26.94,Default,,0000,0000,0000,,It's almost like we're missing a tool. We're\Nmissing Dialogue: 0,0:05:26.94,0:05:30.78,Default,,0000,0000,0000,,a tool to represent this underlying business\Nmodel. A Dialogue: 0,0:05:30.78,0:05:33.88,Default,,0000,0000,0000,,tool to identify the business objects that\Nrepresent these Dialogue: 0,0:05:33.88,0:05:38.38,Default,,0000,0000,0000,,real-world entities. A tool to define the\Ndefine rules Dialogue: 0,0:05:38.38,0:05:40.59,Default,,0000,0000,0000,,that govern these collaborations. Dialogue: 0,0:05:40.59,0:05:43.72,Default,,0000,0000,0000,,I think as Rails developers, we kind of lack Dialogue: 0,0:05:43.72,0:05:47.02,Default,,0000,0000,0000,,a language, in terms of talking about domains.\NNormally, Dialogue: 0,0:05:47.02,0:05:49.44,Default,,0000,0000,0000,,we talk about domains in the form of associations Dialogue: 0,0:05:49.44,0:05:53.50,Default,,0000,0000,0000,,and has_many and belongs_to. Dialogue: 0,0:05:53.50,0:05:55.90,Default,,0000,0000,0000,,Object modeling is a practice, and these five\Nbasic Dialogue: 0,0:05:55.90,0:05:58.64,Default,,0000,0000,0000,,skills will help us bridge this gap between\Nuser Dialogue: 0,0:05:58.64,0:06:02.19,Default,,0000,0000,0000,,stories and implementation. Now, I just want\Nto be Dialogue: 0,0:06:02.19,0:06:05.05,Default,,0000,0000,0000,,clear in terms of setting expectations for\Nthis talk. Dialogue: 0,0:06:05.05,0:06:08.16,Default,,0000,0000,0000,,I'm not gonna be showing any code. OK. Great. Dialogue: 0,0:06:08.16,0:06:10.79,Default,,0000,0000,0000,,No one got up and left. That's a good Dialogue: 0,0:06:10.79,0:06:11.25,Default,,0000,0000,0000,,sign. Dialogue: 0,0:06:11.25,0:06:13.89,Default,,0000,0000,0000,,And, so there's gonna be no code examples.\NAnd Dialogue: 0,0:06:13.89,0:06:15.58,Default,,0000,0000,0000,,there'll be lots of talks that are, over the Dialogue: 0,0:06:15.58,0:06:18.61,Default,,0000,0000,0000,,next couple of days, you know, showing different\Nimplementations. Dialogue: 0,0:06:18.61,0:06:21.23,Default,,0000,0000,0000,,And the thing is with this, with this practice Dialogue: 0,0:06:21.23,0:06:24.78,Default,,0000,0000,0000,,of object modeling, I believe it's independent\Nof implementation. Dialogue: 0,0:06:24.78,0:06:28.33,Default,,0000,0000,0000,,It just helps you understand the business\Nmodel itself. Dialogue: 0,0:06:28.33,0:06:32.38,Default,,0000,0000,0000,,Now, this idea of, this practice of object\Nmodeling, Dialogue: 0,0:06:32.38,0:06:35.58,Default,,0000,0000,0000,,it's not new. And Peter Coad first discussed\Nthis Dialogue: 0,0:06:35.58,0:06:39.97,Default,,0000,0000,0000,,in his book, Java Modeling in Color with UML. Dialogue: 0,0:06:39.97,0:06:43.01,Default,,0000,0000,0000,,This was first published in 1999. And, this\Nis Dialogue: 0,0:06:43.01,0:06:45.67,Default,,0000,0000,0000,,not gonna be a popular book for Rubyists,\Nright. Dialogue: 0,0:06:45.67,0:06:47.41,Default,,0000,0000,0000,,It has two things going wrong with it. It Dialogue: 0,0:06:47.41,0:06:51.34,Default,,0000,0000,0000,,has Java and UML in the title. Dialogue: 0,0:06:51.34,0:06:52.74,Default,,0000,0000,0000,,But there were some other books that were\Npublished Dialogue: 0,0:06:52.74,0:06:55.02,Default,,0000,0000,0000,,around the time, and other ones such as Streamlined Dialogue: 0,0:06:55.02,0:06:58.43,Default,,0000,0000,0000,,Object Modeling by Jill Nicola. And this really\Ninfluenced Dialogue: 0,0:06:58.43,0:07:01.99,Default,,0000,0000,0000,,my thinking in terms of how to understand\Na Dialogue: 0,0:07:01.99,0:07:04.36,Default,,0000,0000,0000,,business domain. Dialogue: 0,0:07:04.36,0:07:07.11,Default,,0000,0000,0000,,And what I like about object modeling is that Dialogue: 0,0:07:07.11,0:07:10.10,Default,,0000,0000,0000,,it provides us a framework. Very much like\NRails Dialogue: 0,0:07:10.10,0:07:13.50,Default,,0000,0000,0000,,provides us a framework in terms of providing\Nus Dialogue: 0,0:07:13.50,0:07:17.42,Default,,0000,0000,0000,,guidance in terms of structuring our application.\NIt provides Dialogue: 0,0:07:17.42,0:07:21.77,Default,,0000,0000,0000,,us conventions. And it helps us accelerate\Nour web Dialogue: 0,0:07:21.77,0:07:22.54,Default,,0000,0000,0000,,development. Dialogue: 0,0:07:22.54,0:07:24.55,Default,,0000,0000,0000,,And object modeling's a little like that.\NIt allows Dialogue: 0,0:07:24.55,0:07:27.93,Default,,0000,0000,0000,,us to discuss, visualize, and help us, guide\Nus Dialogue: 0,0:07:27.93,0:07:30.82,Default,,0000,0000,0000,,in terms of implementing those domains. But\Nit also, Dialogue: 0,0:07:30.82,0:07:34.58,Default,,0000,0000,0000,,it helps us to accelerate our understanding\Nof those Dialogue: 0,0:07:34.58,0:07:35.98,Default,,0000,0000,0000,,business domains. Dialogue: 0,0:07:35.98,0:07:40.37,Default,,0000,0000,0000,,Now, I'm not advocating any big upfront design.\NThis Dialogue: 0,0:07:40.37,0:07:44.36,Default,,0000,0000,0000,,is simply a tool to sketch out those ideas, Dialogue: 0,0:07:44.36,0:07:47.24,Default,,0000,0000,0000,,to collaborate with your team members and\Nhelp guide Dialogue: 0,0:07:47.24,0:07:50.73,Default,,0000,0000,0000,,your implementation. Sure, the diagrams that\NI'm going to Dialogue: 0,0:07:50.73,0:07:54.48,Default,,0000,0000,0000,,be using today are URML, UML, the unified\Nmodeling Dialogue: 0,0:07:54.48,0:07:59.33,Default,,0000,0000,0000,,language. But these are simply communication\Ntools. The goal Dialogue: 0,0:07:59.33,0:08:02.38,Default,,0000,0000,0000,,is not the diagrams themselves. Dialogue: 0,0:08:02.38,0:08:07.29,Default,,0000,0000,0000,,Now as object modelers, our basic building\Nblocks are Dialogue: 0,0:08:07.29,0:08:10.02,Default,,0000,0000,0000,,objects. Which is fantastic, cause as Rubyists,\Nwe work Dialogue: 0,0:08:10.02,0:08:13.02,Default,,0000,0000,0000,,in a object-oriented language. Now, when I\Nspeak about Dialogue: 0,0:08:13.02,0:08:16.34,Default,,0000,0000,0000,,objects, I'm going to speak in the first person. Dialogue: 0,0:08:16.34,0:08:20.03,Default,,0000,0000,0000,,And this helps us personify these objects. Dialogue: 0,0:08:20.03,0:08:26.87,Default,,0000,0000,0000,,So objects have three responsibilities. Who\NI know, what Dialogue: 0,0:08:26.87,0:08:31.93,Default,,0000,0000,0000,,I do, and what I know. Dialogue: 0,0:08:31.93,0:08:34.02,Default,,0000,0000,0000,,An example of that, coming back to an order, Dialogue: 0,0:08:34.02,0:08:36.09,Default,,0000,0000,0000,,an order would know a number, it would know Dialogue: 0,0:08:36.09,0:08:38.36,Default,,0000,0000,0000,,its state - if it's paid. It would know Dialogue: 0,0:08:38.36,0:08:40.95,Default,,0000,0000,0000,,a timestamp for when it was purchased at.\NOf Dialogue: 0,0:08:40.95,0:08:43.27,Default,,0000,0000,0000,,course, it knows other collaborators. So it\Nknows a Dialogue: 0,0:08:43.27,0:08:46.02,Default,,0000,0000,0000,,shipment and it knows how to ship itself:\Nits Dialogue: 0,0:08:46.02,0:08:49.06,Default,,0000,0000,0000,,business service. Dialogue: 0,0:08:49.06,0:08:51.11,Default,,0000,0000,0000,,So now that we have this building block, let's Dialogue: 0,0:08:51.11,0:08:56.05,Default,,0000,0000,0000,,look at finding objects, our first skill. Dialogue: 0,0:08:56.05,0:08:58.61,Default,,0000,0000,0000,,The problem with finding objects is that often\Nwe Dialogue: 0,0:08:58.61,0:09:01.78,Default,,0000,0000,0000,,look at business objects as unique. They're\Nthese pretty Dialogue: 0,0:09:01.78,0:09:05.02,Default,,0000,0000,0000,,little snow flakes. But in effect, we can\Ngroup Dialogue: 0,0:09:05.02,0:09:09.33,Default,,0000,0000,0000,,objects with more or less the same responsibilities\Nof Dialogue: 0,0:09:09.33,0:09:12.14,Default,,0000,0000,0000,,what, who I know, what I do, and what Dialogue: 0,0:09:12.14,0:09:13.80,Default,,0000,0000,0000,,I know. Dialogue: 0,0:09:13.80,0:09:16.46,Default,,0000,0000,0000,,And these groups are known as archetypes,\Nthe term Dialogue: 0,0:09:16.46,0:09:18.55,Default,,0000,0000,0000,,that Peter Coad assigned to this. And we have Dialogue: 0,0:09:18.55,0:09:22.81,Default,,0000,0000,0000,,four archetypes. We have an event, a role,\Na Dialogue: 0,0:09:22.81,0:09:27.16,Default,,0000,0000,0000,,party, place, or thing, or a description.\NParty, place, Dialogue: 0,0:09:27.16,0:09:29.33,Default,,0000,0000,0000,,or thing's a little bit of a mouthful to Dialogue: 0,0:09:29.33,0:09:31.29,Default,,0000,0000,0000,,say every time, so we'll refer to these as Dialogue: 0,0:09:31.29,0:09:34.34,Default,,0000,0000,0000,,the PPTs. Dialogue: 0,0:09:34.34,0:09:37.54,Default,,0000,0000,0000,,So let's look at our first archetype. Our\Nfirst Dialogue: 0,0:09:37.54,0:09:40.54,Default,,0000,0000,0000,,archetype are events. And these are modeled\Nas transactions Dialogue: 0,0:09:40.54,0:09:44.71,Default,,0000,0000,0000,,within our domain. They're the most important\Nbusiness objects. Dialogue: 0,0:09:44.71,0:09:47.27,Default,,0000,0000,0000,,They're the glue for all the other objects\Nin Dialogue: 0,0:09:47.27,0:09:51.09,Default,,0000,0000,0000,,our business domain. And without an event,\NI would Dialogue: 0,0:09:51.09,0:09:55.95,Default,,0000,0000,0000,,assert the application is simply a catalog\Napplication. Dialogue: 0,0:09:55.95,0:09:57.92,Default,,0000,0000,0000,,So we've got some examples up here. So in Dialogue: 0,0:09:57.92,0:09:59.62,Default,,0000,0000,0000,,the, in the domain of the ecommerce we would Dialogue: 0,0:09:59.62,0:10:02.44,Default,,0000,0000,0000,,have an order and a shipment. These are transactions Dialogue: 0,0:10:02.44,0:10:05.67,Default,,0000,0000,0000,,within that domain. If we're modeling a hotel\Nreservation Dialogue: 0,0:10:05.67,0:10:08.87,Default,,0000,0000,0000,,system or a car reservation, we'd have a reservation Dialogue: 0,0:10:08.87,0:10:11.80,Default,,0000,0000,0000,,event. Dialogue: 0,0:10:11.80,0:10:14.19,Default,,0000,0000,0000,,And we have two types of events. We have Dialogue: 0,0:10:14.19,0:10:16.87,Default,,0000,0000,0000,,a point in time and an interval. So a Dialogue: 0,0:10:16.87,0:10:19.42,Default,,0000,0000,0000,,point in time has a single timestamp, such\Nas Dialogue: 0,0:10:19.42,0:10:23.08,Default,,0000,0000,0000,,order, with the purchased_at date. And then\Nwe have Dialogue: 0,0:10:23.08,0:10:28.87,Default,,0000,0000,0000,,reservation. A reserv- sorry. We have an internal\Narchetype, Dialogue: 0,0:10:28.87,0:10:31.36,Default,,0000,0000,0000,,illustrated by the reservation here. Dialogue: 0,0:10:31.36,0:10:34.55,Default,,0000,0000,0000,,And this is timestamped, or bookend by two\Ntimestamps. Dialogue: 0,0:10:34.55,0:10:38.51,Default,,0000,0000,0000,,So the checkin_at date and the checkout. Dialogue: 0,0:10:38.51,0:10:42.45,Default,,0000,0000,0000,,Now, roles don't live in isolation. They,\Nthey're the Dialogue: 0,0:10:42.45,0:10:45.74,Default,,0000,0000,0000,,glue in the domain. And other objects interact\Nin Dialogue: 0,0:10:45.74,0:10:49.61,Default,,0000,0000,0000,,this event. And we use roles to represent\Nthe Dialogue: 0,0:10:49.61,0:10:54.44,Default,,0000,0000,0000,,way an object participates in this event.\NSo as Dialogue: 0,0:10:54.44,0:10:56.58,Default,,0000,0000,0000,,an example, we have a customer and a sales Dialogue: 0,0:10:56.58,0:10:59.33,Default,,0000,0000,0000,,agent that would interact with an order. And\Na Dialogue: 0,0:10:59.33,0:11:03.82,Default,,0000,0000,0000,,fulfillment provider that would interact with\Nthe shipment. Dialogue: 0,0:11:03.82,0:11:08.36,Default,,0000,0000,0000,,So if we have roles, then we need actors. Dialogue: 0,0:11:08.36,0:11:10.92,Default,,0000,0000,0000,,And the actors in our domain, as, are these, Dialogue: 0,0:11:10.92,0:11:15.06,Default,,0000,0000,0000,,is the PPTs. Now, so, a party would be Dialogue: 0,0:11:15.06,0:11:19.43,Default,,0000,0000,0000,,a person or an organization. The place would\Nbe, Dialogue: 0,0:11:19.43,0:11:21.65,Default,,0000,0000,0000,,such of a thing as a warehouse if we Dialogue: 0,0:11:21.65,0:11:24.35,Default,,0000,0000,0000,,were doing shipment. And everything else is\Na thing. Dialogue: 0,0:11:24.35,0:11:26.67,Default,,0000,0000,0000,,So, again, an example here is the, is the Dialogue: 0,0:11:26.67,0:11:27.84,Default,,0000,0000,0000,,product. Dialogue: 0,0:11:27.84,0:11:33.81,Default,,0000,0000,0000,,And our final archetype is a description.\NAnd descriptions Dialogue: 0,0:11:33.81,0:11:38.60,Default,,0000,0000,0000,,are responsible for describing a collection\Nof similar objects, Dialogue: 0,0:11:38.60,0:11:41.38,Default,,0000,0000,0000,,such as our PPTs. An example of this would Dialogue: 0,0:11:41.38,0:11:44.53,Default,,0000,0000,0000,,be a product category that would describe\Na, a Dialogue: 0,0:11:44.53,0:11:46.83,Default,,0000,0000,0000,,collection of products. A collection of things\Nsuch as Dialogue: 0,0:11:46.83,0:11:50.13,Default,,0000,0000,0000,,t-shirts. Or a collection of jeans on an ecommerce Dialogue: 0,0:11:50.13,0:11:50.74,Default,,0000,0000,0000,,site. Dialogue: 0,0:11:50.74,0:11:54.18,Default,,0000,0000,0000,,Now, the concept of a description object can\Nbe Dialogue: 0,0:11:54.18,0:11:56.98,Default,,0000,0000,0000,,a little tough to kind of grasp sometimes.\NSo Dialogue: 0,0:11:56.98,0:11:58.43,Default,,0000,0000,0000,,I'll talk about this in a little bit more Dialogue: 0,0:11:58.43,0:12:02.71,Default,,0000,0000,0000,,detail when we talk about identifying collaborations. Dialogue: 0,0:12:02.71,0:12:08.74,Default,,0000,0000,0000,,Now, when we're collaborating or presenting\Na diagram visually, Dialogue: 0,0:12:08.74,0:12:10.48,Default,,0000,0000,0000,,as soon as we have a few business objects Dialogue: 0,0:12:10.48,0:12:12.68,Default,,0000,0000,0000,,on a, on a diagram, it becomes a little Dialogue: 0,0:12:12.68,0:12:15.68,Default,,0000,0000,0000,,tough to navigate. Don't worry, you're not\Nsupposed to Dialogue: 0,0:12:15.68,0:12:19.09,Default,,0000,0000,0000,,be able to read all the details here. I'm Dialogue: 0,0:12:19.09,0:12:21.35,Default,,0000,0000,0000,,just gonna illustrate something. Dialogue: 0,0:12:21.35,0:12:23.69,Default,,0000,0000,0000,,But we can solve this issue in, in terms Dialogue: 0,0:12:23.69,0:12:27.94,Default,,0000,0000,0000,,of navigating these diagrams. We can add color,\Nto Dialogue: 0,0:12:27.94,0:12:33.53,Default,,0000,0000,0000,,give another layer of information. Did anyone\Nnotice the Dialogue: 0,0:12:33.53,0:12:35.70,Default,,0000,0000,0000,,slides change color when I was talking about\Nthe Dialogue: 0,0:12:35.70,0:12:40.67,Default,,0000,0000,0000,,archetypes? Anyone paying notice? Oh, one\Nperson. What, what, Dialogue: 0,0:12:40.67,0:12:41.52,Default,,0000,0000,0000,,what color was event? Dialogue: 0,0:12:41.52,0:12:41.99,Default,,0000,0000,0000,,Sorry? Dialogue: 0,0:12:41.99,0:12:42.93,Default,,0000,0000,0000,,AUDIENCE: Yellow. Dialogue: 0,0:12:42.93,0:12:46.71,Default,,0000,0000,0000,,N.H.: Yellow? Almost. It was the role. But,\Nthe Dialogue: 0,0:12:46.71,0:12:49.63,Default,,0000,0000,0000,,event was the pink or the red. And pink's Dialogue: 0,0:12:49.63,0:12:52.52,Default,,0000,0000,0000,,a great color for an event, cause it highlights Dialogue: 0,0:12:52.52,0:12:56.85,Default,,0000,0000,0000,,sensitivity in the domain model. It's this\Nhot spot. Dialogue: 0,0:12:56.85,0:13:00.25,Default,,0000,0000,0000,,We'll use yellow for roles. The green for\Nthe Dialogue: 0,0:13:00.25,0:13:04.52,Default,,0000,0000,0000,,PPTs. And the blue for the description. Dialogue: 0,0:13:04.52,0:13:06.61,Default,,0000,0000,0000,,So we can take a visualization of this in Dialogue: 0,0:13:06.61,0:13:09.81,Default,,0000,0000,0000,,terms of our domain model and add color to Dialogue: 0,0:13:09.81,0:13:13.14,Default,,0000,0000,0000,,that, and you can immediately see this hotspot\Nwithin Dialogue: 0,0:13:13.14,0:13:15.02,Default,,0000,0000,0000,,your domain model. Dialogue: 0,0:13:15.02,0:13:17.18,Default,,0000,0000,0000,,You can see the events and you can see Dialogue: 0,0:13:17.18,0:13:20.10,Default,,0000,0000,0000,,the other objects interacting with those events\Nthrough the Dialogue: 0,0:13:20.10,0:13:21.33,Default,,0000,0000,0000,,yellow roles. Dialogue: 0,0:13:21.33,0:13:26.22,Default,,0000,0000,0000,,Now, more importantly, we have this awesome\Ncollaboration tool Dialogue: 0,0:13:26.22,0:13:29.52,Default,,0000,0000,0000,,where we can use post-it notes that correspond\Nto Dialogue: 0,0:13:29.52,0:13:32.75,Default,,0000,0000,0000,,these colored archetypes, and a white board,\Nand with Dialogue: 0,0:13:32.75,0:13:36.12,Default,,0000,0000,0000,,our team members we can collaborate in an\Nagile Dialogue: 0,0:13:36.12,0:13:42.22,Default,,0000,0000,0000,,manner into, on our business domain. Dialogue: 0,0:13:42.22,0:13:44.70,Default,,0000,0000,0000,,So now we have these four archetypes that\Nhelps Dialogue: 0,0:13:44.70,0:13:48.54,Default,,0000,0000,0000,,us guide finding business objects in our domain.\NBut Dialogue: 0,0:13:48.54,0:13:50.91,Default,,0000,0000,0000,,you might have found, might have noticed that\Nit Dialogue: 0,0:13:50.91,0:13:52.53,Default,,0000,0000,0000,,was a little difficult for me to talk about Dialogue: 0,0:13:52.53,0:13:56.35,Default,,0000,0000,0000,,one object in isolation. And this leads us\Nto Dialogue: 0,0:13:56.35,0:14:02.43,Default,,0000,0000,0000,,our next skill, identifying collaborations. Dialogue: 0,0:14:02.43,0:14:04.62,Default,,0000,0000,0000,,Before moving onto collaborations, I just\Nwanted to discuss Dialogue: 0,0:14:04.62,0:14:10.00,Default,,0000,0000,0000,,this idea of associations versus collaborations.\NAs Rails developers, Dialogue: 0,0:14:10.00,0:14:13.10,Default,,0000,0000,0000,,we're very familiar with the idea of associations,\Nfrom, Dialogue: 0,0:14:13.10,0:14:16.97,Default,,0000,0000,0000,,from ActiveRecord. But associations kind of\Nhave this idea Dialogue: 0,0:14:16.97,0:14:20.97,Default,,0000,0000,0000,,of a passive relationship, where collaborations\Nkind of communicates Dialogue: 0,0:14:20.97,0:14:24.62,Default,,0000,0000,0000,,this idea of an active relationship with dialogue. Dialogue: 0,0:14:24.62,0:14:27.84,Default,,0000,0000,0000,,And dialogue becomes very important when we\Ntalk about Dialogue: 0,0:14:27.84,0:14:30.44,Default,,0000,0000,0000,,business rules. So I'm gonna use the idea\Nof Dialogue: 0,0:14:30.44,0:14:33.44,Default,,0000,0000,0000,,collaborations for the rest of this talk. Dialogue: 0,0:14:33.44,0:14:39.19,Default,,0000,0000,0000,,Now, identifying collaborations addresses\Nthis object's responsibility of who Dialogue: 0,0:14:39.19,0:14:44.09,Default,,0000,0000,0000,,I know. Now, often we think about objects\Nin Dialogue: 0,0:14:44.09,0:14:48.47,Default,,0000,0000,0000,,isolation. We think about a customer. We think\Nabout Dialogue: 0,0:14:48.47,0:14:52.03,Default,,0000,0000,0000,,an order. But the presence of one business\Nobject Dialogue: 0,0:14:52.03,0:14:55.95,Default,,0000,0000,0000,,suggests the presence of another. Dialogue: 0,0:14:55.95,0:14:58.62,Default,,0000,0000,0000,,And this is really highlighted by this, what\NI've Dialogue: 0,0:14:58.62,0:15:02.56,Default,,0000,0000,0000,,dubbed the elementary collaboration pattern.\NSo let's walk through Dialogue: 0,0:15:02.56,0:15:05.27,Default,,0000,0000,0000,,this. So when we have the presence of an Dialogue: 0,0:15:05.27,0:15:08.28,Default,,0000,0000,0000,,event, we know that that, there's a role required Dialogue: 0,0:15:08.28,0:15:10.98,Default,,0000,0000,0000,,to interact with that event. And if we have Dialogue: 0,0:15:10.98,0:15:14.17,Default,,0000,0000,0000,,roles, we need an actor. And this is our Dialogue: 0,0:15:14.17,0:15:16.45,Default,,0000,0000,0000,,PPTs. And, of course, if we have a collection Dialogue: 0,0:15:16.45,0:15:20.02,Default,,0000,0000,0000,,of PPTs, perhaps we need a description to\Ndescribe Dialogue: 0,0:15:20.02,0:15:21.53,Default,,0000,0000,0000,,that collection. Dialogue: 0,0:15:21.53,0:15:25.77,Default,,0000,0000,0000,,Now, this is essentially a template. And templates\Nare Dialogue: 0,0:15:25.77,0:15:30.25,Default,,0000,0000,0000,,meant to be modified based on need. An example Dialogue: 0,0:15:30.25,0:15:32.75,Default,,0000,0000,0000,,of this, if you have a PPT that only Dialogue: 0,0:15:32.75,0:15:37.00,Default,,0000,0000,0000,,participates in one event, do not create a\Ndedicated Dialogue: 0,0:15:37.00,0:15:39.74,Default,,0000,0000,0000,,role for that. That's just going to complicate\Nyour Dialogue: 0,0:15:39.74,0:15:43.03,Default,,0000,0000,0000,,object model. Dialogue: 0,0:15:43.03,0:15:45.58,Default,,0000,0000,0000,,Here we have an example of a person interacting Dialogue: 0,0:15:45.58,0:15:50.03,Default,,0000,0000,0000,,with order. So a person can either interact\Nwith Dialogue: 0,0:15:50.03,0:15:53.17,Default,,0000,0000,0000,,that as a customer or as a sales agent. Dialogue: 0,0:15:53.17,0:15:55.73,Default,,0000,0000,0000,,So, of course, the customer is the one who Dialogue: 0,0:15:55.73,0:15:57.97,Default,,0000,0000,0000,,is purchasing that order, and the other is\Nthe, Dialogue: 0,0:15:57.97,0:16:00.07,Default,,0000,0000,0000,,perhaps, approving that order. Dialogue: 0,0:16:00.07,0:16:03.08,Default,,0000,0000,0000,,Now, we might have a business role that suggests Dialogue: 0,0:16:03.08,0:16:06.16,Default,,0000,0000,0000,,that we, the same person cannot be the same, Dialogue: 0,0:16:06.16,0:16:08.73,Default,,0000,0000,0000,,sorry, the same person cannot play the roles\Nat Dialogue: 0,0:16:08.73,0:16:11.56,Default,,0000,0000,0000,,the same time. Meaning they can't be the customer Dialogue: 0,0:16:11.56,0:16:13.99,Default,,0000,0000,0000,,and the sales agent. Dialogue: 0,0:16:13.99,0:16:18.45,Default,,0000,0000,0000,,There's another notation that I've introduced\Nhere, in terms Dialogue: 0,0:16:18.45,0:16:20.89,Default,,0000,0000,0000,,of the UML, is that we have multiplicity rules Dialogue: 0,0:16:20.89,0:16:23.87,Default,,0000,0000,0000,,identified. So the one next to the customer\Non Dialogue: 0,0:16:23.87,0:16:28.36,Default,,0000,0000,0000,,the right-hand side suggests that there's\Na, an order Dialogue: 0,0:16:28.36,0:16:31.17,Default,,0000,0000,0000,,only belongs to one customer. And a customer\Ncan Dialogue: 0,0:16:31.17,0:16:33.36,Default,,0000,0000,0000,,actually belong to many orders, and that's\Ndenoted by Dialogue: 0,0:16:33.36,0:16:37.49,Default,,0000,0000,0000,,the zero and the asterisks next to the order. Dialogue: 0,0:16:37.49,0:16:43.06,Default,,0000,0000,0000,,Now, here's a description of the PPTs, sorry,\Na Dialogue: 0,0:16:43.06,0:16:46.09,Default,,0000,0000,0000,,PPT versus a description. I was talking about\Nhow Dialogue: 0,0:16:46.09,0:16:48.25,Default,,0000,0000,0000,,descriptions might be a little bit tough to\Ngrasp. Dialogue: 0,0:16:48.25,0:16:50.43,Default,,0000,0000,0000,,We're just gonna go through an example here. Dialogue: 0,0:16:50.43,0:16:54.53,Default,,0000,0000,0000,,Here, we have a vehicle that's uniquely identified\Nby Dialogue: 0,0:16:54.53,0:16:57.62,Default,,0000,0000,0000,,a registration number. And we have a vehicle\Nmake Dialogue: 0,0:16:57.62,0:17:01.62,Default,,0000,0000,0000,,that describes that vehicle. It describes\Nthe model and Dialogue: 0,0:17:01.62,0:17:04.68,Default,,0000,0000,0000,,it describes the year that model was released. Dialogue: 0,0:17:04.68,0:17:07.40,Default,,0000,0000,0000,,Let's take a little concrete example and we'll\Nmake Dialogue: 0,0:17:07.40,0:17:10.46,Default,,0000,0000,0000,,this a little clearer. So here we have four Dialogue: 0,0:17:10.46,0:17:15.40,Default,,0000,0000,0000,,instances of, of a vehicle. We have one and Dialogue: 0,0:17:15.40,0:17:18.08,Default,,0000,0000,0000,,two, and you'll see that there's a uniquely\Nidentified Dialogue: 0,0:17:18.08,0:17:21.93,Default,,0000,0000,0000,,registration number. But we have duplicated\Ndata here, sorry, Dialogue: 0,0:17:21.93,0:17:25.18,Default,,0000,0000,0000,,duplicated attributes here, with the model\Nand year. Dialogue: 0,0:17:25.18,0:17:27.73,Default,,0000,0000,0000,,And this is repeated again in the instances\Nthree Dialogue: 0,0:17:27.73,0:17:30.72,Default,,0000,0000,0000,,and four. I've highlighted it here so you\Ncan Dialogue: 0,0:17:30.72,0:17:34.76,Default,,0000,0000,0000,,see the, the repeating data. Dialogue: 0,0:17:34.76,0:17:36.76,Default,,0000,0000,0000,,And we can, of course, extract them. We'll\Nuse Dialogue: 0,0:17:36.76,0:17:40.00,Default,,0000,0000,0000,,a business, business, request kind of term\Nbusiness service Dialogue: 0,0:17:40.00,0:17:42.51,Default,,0000,0000,0000,,when we can extract those repeating attributes. Dialogue: 0,0:17:42.51,0:17:44.25,Default,,0000,0000,0000,,(weird audio - (00:17:45) Dialogue: 0,0:17:44.25,0:17:47.99,Default,,0000,0000,0000,,And here business object in the, with the\Nregistration Dialogue: 0,0:17:47.99,0:17:50.51,Default,,0000,0000,0000,,number is our vehicle, and with the model\Nand Dialogue: 0,0:17:50.51,0:17:53.79,Default,,0000,0000,0000,,year we have the vehicle make. So the instances Dialogue: 0,0:17:53.79,0:17:56.06,Default,,0000,0000,0000,,of one and two of the vehicle are described Dialogue: 0,0:17:56.06,0:17:58.46,Default,,0000,0000,0000,,by the first instance of the description,\Nwhich is Dialogue: 0,0:17:58.46,0:18:02.65,Default,,0000,0000,0000,,the Corolla 2010. And the rows three, sorry,\Nthe Dialogue: 0,0:18:02.65,0:18:05.29,Default,,0000,0000,0000,,instances three and four are described by\Nthe second Dialogue: 0,0:18:05.29,0:18:10.23,Default,,0000,0000,0000,,instance of that description, the Focus 2014. Dialogue: 0,0:18:10.23,0:18:11.66,Default,,0000,0000,0000,,So you can sort of think about this in Dialogue: 0,0:18:11.66,0:18:17.28,Default,,0000,0000,0000,,the terms of data normalization. Dialogue: 0,0:18:17.28,0:18:22.09,Default,,0000,0000,0000,,Now, archetypes can collaborate with the same\Narchetype. So Dialogue: 0,0:18:22.09,0:18:26.06,Default,,0000,0000,0000,,a PPT can collaborate with another PPT. In\Nthis Dialogue: 0,0:18:26.06,0:18:28.76,Default,,0000,0000,0000,,instance we're gonna look at event collaborations.\NAnd there's Dialogue: 0,0:18:28.76,0:18:31.03,Default,,0000,0000,0000,,two event collaborations that we'll have a\Nlook at. Dialogue: 0,0:18:31.03,0:18:34.38,Default,,0000,0000,0000,,The first one is the composite. The composite\Nis Dialogue: 0,0:18:34.38,0:18:37.56,Default,,0000,0000,0000,,actually made up of other events. Dialogue: 0,0:18:37.56,0:18:39.61,Default,,0000,0000,0000,,So here we have the, the composite transaction\Nand Dialogue: 0,0:18:39.61,0:18:43.52,Default,,0000,0000,0000,,the line item. The example is the order and Dialogue: 0,0:18:43.52,0:18:46.33,Default,,0000,0000,0000,,the order line item. I've introduced another\Nlittle bit Dialogue: 0,0:18:46.33,0:18:50.10,Default,,0000,0000,0000,,of UML notation with that solid, the solid\Ndiamond, Dialogue: 0,0:18:50.10,0:18:55.00,Default,,0000,0000,0000,,and that denotes the composite within this\Npattern. Dialogue: 0,0:18:55.00,0:18:58.65,Default,,0000,0000,0000,,Another event collaboration pattern is the\Nfollow-up pattern, where Dialogue: 0,0:18:58.65,0:19:00.41,Default,,0000,0000,0000,,we have a transaction and then we have a Dialogue: 0,0:19:00.41,0:19:03.32,Default,,0000,0000,0000,,follow-up transaction. And in this case we\Nhave an Dialogue: 0,0:19:03.32,0:19:06.67,Default,,0000,0000,0000,,order that is followed up by a shipment. Another Dialogue: 0,0:19:06.67,0:19:08.68,Default,,0000,0000,0000,,example of this would be an order followed\Nup Dialogue: 0,0:19:08.68,0:19:12.25,Default,,0000,0000,0000,,by a payment. Dialogue: 0,0:19:12.25,0:19:13.62,Default,,0000,0000,0000,,So let's sort of take a look at this Dialogue: 0,0:19:13.62,0:19:17.07,Default,,0000,0000,0000,,in a, in an example, a larger example. Here Dialogue: 0,0:19:17.07,0:19:20.15,Default,,0000,0000,0000,,we have a, a product description describing\Na collection Dialogue: 0,0:19:20.15,0:19:23.97,Default,,0000,0000,0000,,of products. This product is interacting with\Nthis order Dialogue: 0,0:19:23.97,0:19:26.61,Default,,0000,0000,0000,,line item. And this is kind of a, this, Dialogue: 0,0:19:26.61,0:19:29.11,Default,,0000,0000,0000,,this product interacting with a, a order line\Nitem, Dialogue: 0,0:19:29.11,0:19:32.01,Default,,0000,0000,0000,,the idea of the thing interacting with a,\Nwith Dialogue: 0,0:19:32.01,0:19:33.87,Default,,0000,0000,0000,,a line item. That's a common pattern that\Nyou'll Dialogue: 0,0:19:33.87,0:19:37.93,Default,,0000,0000,0000,,see in, in domains. Dialogue: 0,0:19:37.93,0:19:39.49,Default,,0000,0000,0000,,But the interesting thing here is the, is\Nthe Dialogue: 0,0:19:39.49,0:19:43.46,Default,,0000,0000,0000,,composite. And that, the highlighting's not\Nshowing up very Dialogue: 0,0:19:43.46,0:19:45.29,Default,,0000,0000,0000,,well. I apologize for that. Dialogue: 0,0:19:45.29,0:19:47.47,Default,,0000,0000,0000,,But the order and the order line item is Dialogue: 0,0:19:47.47,0:19:51.26,Default,,0000,0000,0000,,our composite pattern that we've seen before.\NThe interesting Dialogue: 0,0:19:51.26,0:19:54.17,Default,,0000,0000,0000,,thing is, we repeat this pattern as well.\NSo Dialogue: 0,0:19:54.17,0:19:56.74,Default,,0000,0000,0000,,with a shipment and a shipment line item,\Nthere Dialogue: 0,0:19:56.74,0:19:59.95,Default,,0000,0000,0000,,is a comp, a composite. Dialogue: 0,0:19:59.95,0:20:01.74,Default,,0000,0000,0000,,And we can repeat this again in terms of Dialogue: 0,0:20:01.74,0:20:04.43,Default,,0000,0000,0000,,the order line, sorry, the shipment line item\Nis Dialogue: 0,0:20:04.43,0:20:08.60,Default,,0000,0000,0000,,a follow-up for the order-line item. But this\Nis Dialogue: 0,0:20:08.60,0:20:10.77,Default,,0000,0000,0000,,when the magic starts to happen, is when we Dialogue: 0,0:20:10.77,0:20:14.36,Default,,0000,0000,0000,,had another composite with a return and return\Nline-item. Dialogue: 0,0:20:14.36,0:20:19.02,Default,,0000,0000,0000,,And again, and this is a collaboration, a\Ncomposite Dialogue: 0,0:20:19.02,0:20:19.70,Default,,0000,0000,0000,,collaboration. Dialogue: 0,0:20:19.70,0:20:22.84,Default,,0000,0000,0000,,And we can use these, these collaboration\Npatterns as Dialogue: 0,0:20:22.84,0:20:28.49,Default,,0000,0000,0000,,a building block in our domains as well. Dialogue: 0,0:20:28.49,0:20:31.64,Default,,0000,0000,0000,,And this moves us on to business rules. So, Dialogue: 0,0:20:31.64,0:20:34.34,Default,,0000,0000,0000,,you know, so we're talking about these collaborations,\Nbut Dialogue: 0,0:20:34.34,0:20:40.38,Default,,0000,0000,0000,,what governs these collaborations. So business\Nrules are either Dialogue: 0,0:20:40.38,0:20:44.78,Default,,0000,0000,0000,,policies that specify how a business should\Noperate, or Dialogue: 0,0:20:44.78,0:20:48.62,Default,,0000,0000,0000,,these are constraints that are forced upon\Na business, Dialogue: 0,0:20:48.62,0:20:52.32,Default,,0000,0000,0000,,such as laws determined by a government. Dialogue: 0,0:20:52.32,0:20:54.50,Default,,0000,0000,0000,,Now often when we think about business rules,\Nwe Dialogue: 0,0:20:54.50,0:20:57.67,Default,,0000,0000,0000,,kind of think about validation roles, where\Nwe're just Dialogue: 0,0:20:57.67,0:21:00.52,Default,,0000,0000,0000,,validation that an email is present, or if\Nit's Dialogue: 0,0:21:00.52,0:21:03.63,Default,,0000,0000,0000,,in the correct format such as using a regular Dialogue: 0,0:21:03.63,0:21:08.54,Default,,0000,0000,0000,,expression for that email address. But business\Nrules extend Dialogue: 0,0:21:08.54,0:21:10.40,Default,,0000,0000,0000,,beyond this. Dialogue: 0,0:21:10.40,0:21:13.36,Default,,0000,0000,0000,,They govern, or validate, collaborations. Dialogue: 0,0:21:13.36,0:21:19.66,Default,,0000,0000,0000,,Now, if business rules govern collaborations,\Nthen each partner, Dialogue: 0,0:21:19.66,0:21:23.30,Default,,0000,0000,0000,,that business object, must determine if that\Ncollaboration is Dialogue: 0,0:21:23.30,0:21:27.17,Default,,0000,0000,0000,,valid. Because each partner may have a different\Ncondition Dialogue: 0,0:21:27.17,0:21:31.33,Default,,0000,0000,0000,,to determine if that is a valid collaboration. Dialogue: 0,0:21:31.33,0:21:34.85,Default,,0000,0000,0000,,Here we have an example of a shipment and Dialogue: 0,0:21:34.85,0:21:37.89,Default,,0000,0000,0000,,a shipping method that are looking to collaborate.\NThe Dialogue: 0,0:21:37.89,0:21:40.21,Default,,0000,0000,0000,,shipment has a total weight, and it might\Nbe Dialogue: 0,0:21:40.21,0:21:42.74,Default,,0000,0000,0000,,expedited. So we want to get that shipment\Nout Dialogue: 0,0:21:42.74,0:21:43.45,Default,,0000,0000,0000,,quickly. Dialogue: 0,0:21:43.45,0:21:46.23,Default,,0000,0000,0000,,A shipping method has a, has a maximum weight Dialogue: 0,0:21:46.23,0:21:48.53,Default,,0000,0000,0000,,and a duration. So let's look at these two Dialogue: 0,0:21:48.53,0:21:51.82,Default,,0000,0000,0000,,ob, business objects collaborating. Dialogue: 0,0:21:51.82,0:21:56.35,Default,,0000,0000,0000,,Now, a shipping method adds a constraint on\Nits Dialogue: 0,0:21:56.35,0:22:00.20,Default,,0000,0000,0000,,collaboration with a shipment. It will not\Ncollaborate with Dialogue: 0,0:22:00.20,0:22:05.37,Default,,0000,0000,0000,,a shipment whose total weight exceeds the\Nmaximum weight. Dialogue: 0,0:22:05.37,0:22:10.13,Default,,0000,0000,0000,,Likewise, a shipment has a constraint on its\Ncollaboration Dialogue: 0,0:22:10.13,0:22:14.23,Default,,0000,0000,0000,,with the shipping method. It will not collaborate,\Nsorry, Dialogue: 0,0:22:14.23,0:22:17.68,Default,,0000,0000,0000,,if that shipment is expedited, it will not\Ncollaborate Dialogue: 0,0:22:17.68,0:22:21.38,Default,,0000,0000,0000,,with a shipment, sorry, with a shipping method\Nwhose Dialogue: 0,0:22:21.38,0:22:24.36,Default,,0000,0000,0000,,duration exceeds two days. Dialogue: 0,0:22:24.36,0:22:29.18,Default,,0000,0000,0000,,So from this example, we've illustrated that\Neach partner Dialogue: 0,0:22:29.18,0:22:32.96,Default,,0000,0000,0000,,must validate the collaboration. And each\Npartner adds a Dialogue: 0,0:22:32.96,0:22:37.66,Default,,0000,0000,0000,,constraint, sorry, each partner adds a constraint\Nto that Dialogue: 0,0:22:37.66,0:22:41.17,Default,,0000,0000,0000,,collaboration, owns that business rule. And\Nthat business rule's Dialogue: 0,0:22:41.17,0:22:45.55,Default,,0000,0000,0000,,encapsulated in that business object. And\Nit shields that Dialogue: 0,0:22:45.55,0:22:49.58,Default,,0000,0000,0000,,condition from its collaborator. Dialogue: 0,0:22:49.58,0:22:52.64,Default,,0000,0000,0000,,So now that we understand that business rules\Nare Dialogue: 0,0:22:52.64,0:22:57.00,Default,,0000,0000,0000,,simply not validation rules, that they govern\Nthese collaborations, Dialogue: 0,0:22:57.00,0:23:00.40,Default,,0000,0000,0000,,when do these collaborations form? Dialogue: 0,0:23:00.40,0:23:02.92,Default,,0000,0000,0000,,And this takes us to our fourth skill or Dialogue: 0,0:23:02.92,0:23:06.26,Default,,0000,0000,0000,,assigning services. Dialogue: 0,0:23:06.26,0:23:09.99,Default,,0000,0000,0000,,And services, it's, are related to the responsibility\Nof Dialogue: 0,0:23:09.99,0:23:15.86,Default,,0000,0000,0000,,what I do. Now, business services respond\Nto business Dialogue: 0,0:23:15.86,0:23:21.02,Default,,0000,0000,0000,,requests. They form new collaborations. They\Ndissolve collaborations. And Dialogue: 0,0:23:21.02,0:23:24.89,Default,,0000,0000,0000,,they may even create new event objects. Of\Ncourse, Dialogue: 0,0:23:24.89,0:23:26.66,Default,,0000,0000,0000,,services can update attributes. Dialogue: 0,0:23:26.66,0:23:30.92,Default,,0000,0000,0000,,However, for this talk, I'm gonna focus on\Ncollaboration. Dialogue: 0,0:23:30.92,0:23:34.13,Default,,0000,0000,0000,,Now, as a reminder, we'll just revisit this\Nscenario Dialogue: 0,0:23:34.13,0:23:36.66,Default,,0000,0000,0000,,from the beginning of my talk. Here, we have Dialogue: 0,0:23:36.66,0:23:40.18,Default,,0000,0000,0000,,a business request coming into our domain,\Nand that's Dialogue: 0,0:23:40.18,0:23:42.51,Default,,0000,0000,0000,,gonna be to ship an order. The order's going Dialogue: 0,0:23:42.51,0:23:44.72,Default,,0000,0000,0000,,to respond to that. But it's gonna check that Dialogue: 0,0:23:44.72,0:23:47.12,Default,,0000,0000,0000,,business rule to make sure it's being paid.\NAnd Dialogue: 0,0:23:47.12,0:23:49.56,Default,,0000,0000,0000,,then it'll go ahead and it will create a Dialogue: 0,0:23:49.56,0:23:54.66,Default,,0000,0000,0000,,new shipment and collaborate with that. Dialogue: 0,0:23:54.66,0:23:56.88,Default,,0000,0000,0000,,So a challenge when we're object modeling\Nis that Dialogue: 0,0:23:56.88,0:24:01.60,Default,,0000,0000,0000,,in the real world, entities are acted upon.\NSomeone Dialogue: 0,0:24:01.60,0:24:06.12,Default,,0000,0000,0000,,ships an order. But when we're object modeling,\Nobjects Dialogue: 0,0:24:06.12,0:24:10.42,Default,,0000,0000,0000,,that represent those real world entities perform\Nthe actions Dialogue: 0,0:24:10.42,0:24:11.90,Default,,0000,0000,0000,,themselves. Dialogue: 0,0:24:11.90,0:24:15.06,Default,,0000,0000,0000,,So an order will ship itself. And the reason Dialogue: 0,0:24:15.06,0:24:17.91,Default,,0000,0000,0000,,for that is that all the information inside\Nan Dialogue: 0,0:24:17.91,0:24:22.23,Default,,0000,0000,0000,,object, sorry, all the information needed\Nto act on Dialogue: 0,0:24:22.23,0:24:25.25,Default,,0000,0000,0000,,that object is inside of that object. So let Dialogue: 0,0:24:25.25,0:24:27.20,Default,,0000,0000,0000,,that object do the work. Dialogue: 0,0:24:27.20,0:24:30.10,Default,,0000,0000,0000,,Otherwise we end up sort of creating these\Ndedicated Dialogue: 0,0:24:30.10,0:24:34.29,Default,,0000,0000,0000,,coordinating objects like shipment manager.\NAnd an object like Dialogue: 0,0:24:34.29,0:24:38.36,Default,,0000,0000,0000,,shipment manager doesn't represent a real-world\Nentity and just Dialogue: 0,0:24:38.36,0:24:43.73,Default,,0000,0000,0000,,adds conceptual noise to our domain model. Dialogue: 0,0:24:43.73,0:24:47.21,Default,,0000,0000,0000,,So with this in mind, we assign this ship Dialogue: 0,0:24:47.21,0:24:50.04,Default,,0000,0000,0000,,service to the order, so it can respond to Dialogue: 0,0:24:50.04,0:24:54.63,Default,,0000,0000,0000,,that business request. And the service becomes\Nan object Dialogue: 0,0:24:54.63,0:24:57.96,Default,,0000,0000,0000,,factory for the shipment. And this is a pat, Dialogue: 0,0:24:57.96,0:25:02.01,Default,,0000,0000,0000,,and follows the pattern of services becoming\Nobject factories Dialogue: 0,0:25:02.01,0:25:06.10,Default,,0000,0000,0000,,for events. Dialogue: 0,0:25:06.10,0:25:07.86,Default,,0000,0000,0000,,And here we come to our last skill, in Dialogue: 0,0:25:07.86,0:25:11.30,Default,,0000,0000,0000,,terms of assigning attributes. And we've already\Ntaken a Dialogue: 0,0:25:11.30,0:25:15.65,Default,,0000,0000,0000,,look at some attributes. These attributes\Nrespond to what Dialogue: 0,0:25:15.65,0:25:17.62,Default,,0000,0000,0000,,I know. Dialogue: 0,0:25:17.62,0:25:19.91,Default,,0000,0000,0000,,So coming back to our vehicle and our vehicle Dialogue: 0,0:25:19.91,0:25:24.55,Default,,0000,0000,0000,,make, a vehicle with its registration number\Nis a Dialogue: 0,0:25:24.55,0:25:28.88,Default,,0000,0000,0000,,descriptive or tacking attribute, which is\Ntypical of a Dialogue: 0,0:25:28.88,0:25:32.06,Default,,0000,0000,0000,,PPT. With the vehicle make we have these two Dialogue: 0,0:25:32.06,0:25:37.26,Default,,0000,0000,0000,,descriptive attributes of a, of the model\Nand the Dialogue: 0,0:25:37.26,0:25:38.54,Default,,0000,0000,0000,,year. Dialogue: 0,0:25:38.54,0:25:41.20,Default,,0000,0000,0000,,From our order example, again, we, for the\Norder Dialogue: 0,0:25:41.20,0:25:43.72,Default,,0000,0000,0000,,it has this tracking attribute of a number.\NIt Dialogue: 0,0:25:43.72,0:25:46.88,Default,,0000,0000,0000,,knows its state and it has this time stamp Dialogue: 0,0:25:46.88,0:25:50.67,Default,,0000,0000,0000,,that's, that point in time events have. Dialogue: 0,0:25:50.67,0:25:56.04,Default,,0000,0000,0000,,Now, Jill Nicola, in her book Streamlined\NObject Modeling, Dialogue: 0,0:25:56.04,0:25:59.73,Default,,0000,0000,0000,,has identified six types of attributes. I\Nwon't go Dialogue: 0,0:25:59.73,0:26:02.10,Default,,0000,0000,0000,,through all six, but you can see some examples Dialogue: 0,0:26:02.10,0:26:03.92,Default,,0000,0000,0000,,on the right hand side there. Dialogue: 0,0:26:03.92,0:26:07.38,Default,,0000,0000,0000,,I'll focus on two attributes. The life cycle\Nstate Dialogue: 0,0:26:07.38,0:26:11.46,Default,,0000,0000,0000,,and the operating state. The life cycle state\Nis Dialogue: 0,0:26:11.46,0:26:15.85,Default,,0000,0000,0000,,a, is a one-way state transition. So an order Dialogue: 0,0:26:15.85,0:26:19.94,Default,,0000,0000,0000,,would transition from pending to paid to complete,\Nbut Dialogue: 0,0:26:19.94,0:26:22.53,Default,,0000,0000,0000,,it won't revert back to that stage. Dialogue: 0,0:26:22.53,0:26:26.54,Default,,0000,0000,0000,,An operating stage is a state that switches\Nback Dialogue: 0,0:26:26.54,0:26:30.00,Default,,0000,0000,0000,,and forth between two states. So an example\Nhere Dialogue: 0,0:26:30.00,0:26:32.11,Default,,0000,0000,0000,,is a product could be active, so active in Dialogue: 0,0:26:32.11,0:26:34.83,Default,,0000,0000,0000,,a, in a catalog. We could switch that off Dialogue: 0,0:26:34.83,0:26:38.61,Default,,0000,0000,0000,,and it wouldn't appear, appear in the catalog\Nanymore. Dialogue: 0,0:26:38.61,0:26:40.09,Default,,0000,0000,0000,,And then we could switch it on. So it Dialogue: 0,0:26:40.09,0:26:45.25,Default,,0000,0000,0000,,switches back and forth. Dialogue: 0,0:26:45.25,0:26:47.58,Default,,0000,0000,0000,,So now that you've been introduced to the\Nfive Dialogue: 0,0:26:47.58,0:26:51.52,Default,,0000,0000,0000,,basic skills of object modeling, we have a\Nset Dialogue: 0,0:26:51.52,0:26:54.79,Default,,0000,0000,0000,,of skills to bridge this gap between your\Nuser Dialogue: 0,0:26:54.79,0:26:59.91,Default,,0000,0000,0000,,stories and your Rails application. You have\Na framework Dialogue: 0,0:26:59.91,0:27:02.79,Default,,0000,0000,0000,,to explore business domains. Dialogue: 0,0:27:02.79,0:27:07.27,Default,,0000,0000,0000,,So, I've simply given you an introduction\Nhere. And Dialogue: 0,0:27:07.27,0:27:10.18,Default,,0000,0000,0000,,if this talk has resonated with you, you're\Nprobably Dialogue: 0,0:27:10.18,0:27:13.55,Default,,0000,0000,0000,,hungry for more. So I've outlined these three\Nsteps Dialogue: 0,0:27:13.55,0:27:15.86,Default,,0000,0000,0000,,to help get you started. Dialogue: 0,0:27:15.86,0:27:19.70,Default,,0000,0000,0000,,First, I've created a dedicated blog post\Nproviding some Dialogue: 0,0:27:19.70,0:27:24.13,Default,,0000,0000,0000,,online resources that, resources that you\Ncan read today. Dialogue: 0,0:27:24.13,0:27:26.48,Default,,0000,0000,0000,,Plus links to the books that I talked about Dialogue: 0,0:27:26.48,0:27:27.80,Default,,0000,0000,0000,,in this talk. Dialogue: 0,0:27:27.80,0:27:32.90,Default,,0000,0000,0000,,Secondly, talk, share this with you team members.\NThis Dialogue: 0,0:27:32.90,0:27:35.60,Default,,0000,0000,0000,,idea of object modeling is awesome to use\Nas Dialogue: 0,0:27:35.60,0:27:38.13,Default,,0000,0000,0000,,an individual, but the real power is when\Nyou Dialogue: 0,0:27:38.13,0:27:40.78,Default,,0000,0000,0000,,have this common language with your team mates,\Nand Dialogue: 0,0:27:40.78,0:27:43.59,Default,,0000,0000,0000,,collaborate with each other. Dialogue: 0,0:27:43.59,0:27:45.60,Default,,0000,0000,0000,,And then the third step is buy some post-it Dialogue: 0,0:27:45.60,0:27:50.33,Default,,0000,0000,0000,,notes. Post-it notes are an awesome collaboration\Ntool and Dialogue: 0,0:27:50.33,0:27:52.60,Default,,0000,0000,0000,,some, and a simple collaboration tool, and\Nit makes Dialogue: 0,0:27:52.60,0:27:57.12,Default,,0000,0000,0000,,this whole modeling fun. Dialogue: 0,0:27:57.12,0:28:00.16,Default,,0000,0000,0000,,So the next time, when a team member asks Dialogue: 0,0:28:00.16,0:28:04.32,Default,,0000,0000,0000,,you, how do I model this? Use archetypes to Dialogue: 0,0:28:04.32,0:28:09.83,Default,,0000,0000,0000,,guide you in finding objects. Use color to\Nvisualize Dialogue: 0,0:28:09.83,0:28:13.34,Default,,0000,0000,0000,,and collaborate with your team members. Use\Nthe presence Dialogue: 0,0:28:13.34,0:28:16.78,Default,,0000,0000,0000,,of one object to suggest the presence of another Dialogue: 0,0:28:16.78,0:28:21.78,Default,,0000,0000,0000,,and form collaborations. Use business rules\Nto validate or Dialogue: 0,0:28:21.78,0:28:27.40,Default,,0000,0000,0000,,govern these collaborations. Assign services\Nto business objects to Dialogue: 0,0:28:27.40,0:28:31.73,Default,,0000,0000,0000,,fulfill business requests. And use these skills\Nto build Dialogue: 0,0:28:31.73,0:28:35.84,Default,,0000,0000,0000,,a model that mirrors the business, enabling\Nyou to Dialogue: 0,0:28:35.84,0:28:39.93,Default,,0000,0000,0000,,correctly and efficiently understand the domain. Dialogue: 0,0:28:39.93,0:28:41.89,Default,,0000,0000,0000,,Thank you.