 Hi guys, thank you very much So first of all I have to clarify that the talk title in the program is wrong The talk is called trailblazer a new architecture for rails and not see you on the trail because I'm not gonna talk about hiking And I have no idea how this title got into the rails kind of program, but anyway you here and that's great. Thank you I'll get you started no no worries So I have a question before we start the actual talk. It's a serious question I have a problem with active record so I have this post Class and I have this comment model and they have a has and belongs to many has and belongs to many Relationship so a post can have a lot of comments or many comments and My problem is when I create a post. Yeah, the post is The post is persistent already and then I add comments to that post how do I prevent active record from From automatically Persisting the new state of this post because I don't want this the comments to be persisted yet So I have tried this and it It saves the comments. I've tried this and it says the comments and I've tried this and it says the comments So can anyone here explain how I can prevent active record from saving the comments until I call save dot build But dot build calls dot new internally doesn't it The problem is the problem is and that that's a serious question guys Because we have this problem in reform that when we set up collections internally and then assign them to the To the collection attribute like comments it saves the entire the entire object and I don't want this So if anyone has an idea how to prevent this Please hit me up after the talk because I'm desperate and I don't want to read through all the active record Documentation I could just ask Aaron. Okay, let's talk about travel is it So before I came to Atlanta, I was traveling a little bit to conferences So this last stop before Atlanta was in Vilnius in Beautiful actually that's wrong. I was in Minsk. So that's that's the wrong Google Maps. I was in Minsk in the Bella Was a great conference great speakers. We had a couple of drinks and was fantastic Before that I was in here. I just confused the slides. So before that I was in Vilnius That's in Lithuania at the RubyConf was a great conference awesome speakers. We had a couple of drinks was awesome Before that I was in Poland at the Braslav conference Braslav is beautiful. There's churches and cathedrals or cathedrals and churches. I have no idea what's the difference It's beautiful city was a great conference great speakers. We had a couple of drinks. It was awesome Before that I was in Brazil at the tropical Ruby conference Has anyone here been to Brazil yet? It looks like this It was the so that that's that's beach like palms and stuff. Hey come in. Hello Don't be shy. I don't bite Brazil yeah tropical RubyConf was an awesome conference. We had a awesome speakers and a couple of drinks was great Before that I was in Mexico and Oaxaca Great place. So I gave it I gave a talk at a at a user group about trailblazer. This was amazing The community is incredibly cool. We had some good speeches had a couple of drinks I learned how to dance kumbia was awesome and before that I was in Australia because I actually live in Australia I'm from Germany. That's where the accent comes from and I'm not gonna show you photos of Australia because it's beautiful And you should all come and visit me there. Okay. Let's talk about trailblazer. No, let's talk about rails We're all doing rails, right? Yes This is a rail rails con. So rails is a Famous web framework just in case you didn't know it's famous for its monolithic. Oh, sorry integrated system architecture This is a monolith and this is a service oriented architecture, whatever. So rails comes with a What are you doing? What are you doing here on my stage by the way? I'm just chilling dude. Cool. It's all good. Welcome to Atlanta. Thank you Okay, let's get back to rails and rails MVC We all know it like it gives us three abstraction layers to implement applications the so-called model the so-called controller and the so-called you and that's awesome because It is quite a simple setup a simple level of abstraction So you can get up and running Applications within minutes you can build a block application in I don't know 15 minutes or what's the what's the what was your official selling point of Whatever so you can get ten minutes. Thank you. So you can get up and an application pretty fast you can you can You can implement stuff without thinking too much about encapsulation about like Not that nightmare that we had for in Java and all this stuff. So that's actually great in rails So you you get it up and running in minutes The problem is that you only have three abstraction layers and all your code goes into views and all your code goes into controllers and all your code goes into models and this usually ends up like this and The problem here is that the original selling point of rails was Hey, let's have conventions and let's have standards, but once the application gets a little bit more complex You have no idea where to put this code So one of the major problems in rails is programmers asking where do I put this kind of code in rails and what ends? So we end up with like huge models skinny controllers that still have seven levels of indentation and all that kind of stuff and Nightmare views with ifs and else and conditioners and all that stuff to make them reusable. So the problem is This monolithic architecture for me is not enough This is the monolith that David showed in his awesome keynote I couldn't find the original photo so I draw a picture This is a camel on the right-hand side. I think I'm I mean come on. I'm an artist, right? I shouldn't talk about coding I should paint Maybe not no Who's this guy? You already asked me that by the way if you fall asleep. We have stuff to throw at you. So please Stay bear with me and stay awake. So the monolith in rails The problem is I don't have a problem with monolithic Architectures at all like I don't want to deploy seven rails apps when I just wanted when I just want to solve one problem Okay, so so the thing is and I think DHH got this wrong is that a monolith the only the only Alternative to a monolith is not a microservice architecture. We have we have I Don't know like the monolithic architecture doesn't mean Put all put all your code into into one into one into one rails application and That's it's a monolith can be a service oriented architecture itself like you can have services inside of a monolith It's just about it's just about abstraction layers and so when I say monolith I'm talking about one rails, but it can be a beautiful object oriented well-destructured architecture in a monolithic Applications so please when we talk about monolith and microservices don't think of this is a physical app And this is five physical apps because you can have services in a monolith And the problem but the problem here is I was just talking about having objects and services in a monolith The problem is in rails on the rails community when you when you when you start adding new abstraction layers to MVC people automatically Blame you for being too enterprise or you were over engineering and this is too many objects I don't like this can't be good this has to be slow because objects are really expensive I mean every string is an object in Ruby so Yeah, so my problem is that rails Use we say rails are simple. I mean that's every rest developer says that actually it's easy because simple is subjective and easy is Objective for something like that so that I got taught in Lithuania that this is a wrong statement So rails is easy. That's every rails developer. However Rails is easy. It allows me to structure complex applications easily That's said no one ever because it is not true It's not funny So what happens in rails in a in a classy rails, I just walk you through the the classy symptoms I've seen in a lot of rails applications. My job has been refactoring rails applications for the last 10 years. It was Tough job a lot of tears blood, but also tears of joy So let's check out a classy controller in rails We got filters that add logic for Handling different contexts for handling authentication all that kind of stuff then we have model code Every controller action I've seen has a lot of model code. It's instantiating creating. I don't know changing attributes Then we have again contextual logic deciders is someone signed into this is someone's not signed into that So there's code handling different contexts in in the controller action Then we have a call back logic like do this if that happened and after this do this So it's like it's it's a it's a load of business logic and in the controller action And then we also have rendering code sitting sitting in a controller I mean, this is a controller action. This is a beautiful control action I've seen controller actions with like as I said earlier seven levels of ifs and else and do this and that So this is this is what happens because we we we chug in all the code into the controller or my favorite part into the model So in models we have them We have Configuration for forms. I mean, I know we don't use extra accessible anymore But you know we define fields for forms and we have Acceptness attributes to handle to handle form submissions and to handle DC realization but we only have one form per model because we don't have context and then people add ifs and else to Configure that oh, I need this form in that context and I need this form in that context when I'm an admin so I've seen horrible deciders in active model and Also, we have callbacks sitting in the model callbacks that get triggered and Sometimes they get triggered and you don't want it and sometimes you want them But they don't get triggered and add ifs and else and it is a nightmare because we collect all code in one in One asset in one class and of course. There's also business logic in the model. So everything sits in the model and I mean view I'll just Run through that because that's my favorite part of rails applications We have helpers and access to models and access to seven levels of attributes of models and We have deciders that decide about the context and if it's an admin render this if it's not an admin render that So lots of code and then we have helpers that that are supposed to help But they usually are a nightmare because if they pass around 200 Wait It was supposed to hit your head not He plays baseball Okay, so helpers helpers never helped me because what I end up is I pass a million variables and objects to nested helper calls and we have again deciders to to decide the context We have render partial this pass in locals do that. It is it is a nightmare. So when you When you look at a when you look at a classy web application, it doesn't matter if it's rails I've it's in attra or whatever it boils down to the following requirements that we have per Per request. So the first thing is we have to dispatch that we get a request and we have to dispatch If it is it HTML do this is adjacent to that in case you have a document API Then we usually do authorization. Is it okay to run this request? Is it okay to run this logic? Then we we validate the incoming data? Is it okay? Is it is it all in the this format that I want is is the user allowed to run this Task and so on then we actually run the business logic. So this is where where you run your your actual domain code and then Usually stuff gets persisted after after you run the business logic and in the end we render a result So it's not that hard as a one two three four five six steps of things that we handle in a request but in rails the controller handles, I don't know like Parts of that and then the model renders Handles parts of this stack and they they also overlaps So you have model code that should be in the controller and you have controller code That should be in the model and then the view does a little bit here and a little bit there and Sometimes it does a little bit more. So a lot of overlapping code. There's it's not clear in rails Where do I put my code? Well, what's what's there? What's the place for this kind of logic in trailblazer? Which is a cool new framework Open source by the way so you can check it out and it's got the best book cover ever Do you recognize people in it? I just got taught that this one is DHH like this So in trailblazer we have a the point of trailblazer is Take these we got these six steps of logic in an application and now take this and structure give me a structure help me structuring my rails application and Basically, this is trailblazer. So I could just go and leave so this diagram took me about ten hours to do it Was a lot of work You have a few drinks. I had a couple of drinks. Yeah a few yeah so In trailblazer we have a we introduce a couple of new abstraction layers Shown in this diagram, and I'm gonna walk you quickly through the through the concept After this we are gonna have a live demonstration by my friend Jay Austin you how do you pronounce your last name Huey Huey and You're gonna learn a little bit about and how to structure rails applications using their trailblazer approach So as the first thing I mentioned is that the old layers are still there So we still have controllers. We still have models when we still have old-fashioned rails views if you want that Trailblazer is non-intrusive. So you can use it You can use it partially you don't have to use every layer and you can use it where you feel you need more Abstraction so you don't have to use trailblazer across your application. Of course, I would love to see that but whatever so in trailblazer We got We got the following layer ring so Now it is clearly Visible which layer is responsible for which tasks. So what we do in trailblazers We introduce operations operations are your business logic and an operation is not a monolithic beast an operation Internally uses forms uses representatives for uses forms of validation and deserialization use representatives You you run your you run your Manual business logic in an operation and operations also have access to models but controllers only access operations and Views only access operations and models. So there's a clear layering in in trailblazer, which layer is supposed to do what? I have this new technique in my talks and whenever whenever this slide comes we do an breathing exercise is very simple So you inhale as much air as possible You keep it for two seconds and It's great All right, how does it work? I have no idea The controller in trailblazer ends up as a really really slim dispatching Acid yeah, so there's no business logic no persistence logic no No validation no callbacks in up in controllers the controller simply dispatches to the operation So this ends up with really really slim controllers and this is my favorite part the model in trailblazer is Empty all the model does in trailblazer is it defines associations and it defines scopes so basically we use Models the way models were supposed to be this this is active record This is active record by Martin Fowler because per definition and I don't care about definitions of patterns usually but active record was supposed to be a persistence Layer without business logic and this is what we have in trailblazer You can still have business logic in your model if you want that but per definition we say don't put it in the model and We also have views we can still use rails views in Trailblazer, so you can still use a hamel and ERB and all that kind of stuff because it's awesome I don't know some people don't like Hamel some people don't like ERB, but that's another story and You can still use helpers you can still use a partials all this stuff But but we offer you some something new it's called cells actually. It's not new. It's 10 years old It's Cells are view models. So view models help you to encapsulate parts or the entire view Into objects we call it a widget in software engineering and this is what is Missing in rails in the vanilla rail stack. So a cell Ironically is called using a helper Yeah, but all that happens is a dispatch to the cell class I'm not going to go into the detail of cells, but you have a class that represents a part of your view and This class can render a partial view Cells we call we call partial views because there is no difference between views and partial because everything is a partial the partial is Logic less as I call it so you still use Hamel you still use ERB you can still use helpers But you only call methods in your view and the cool thing is if you call a method like body or avatar This method is called on the cell instance So we don't have this problem that we have in rails with view context anymore because the cell is the view context So if you use it if you call methods in a cell, it's getting called on the on the instance It's really really helpful to replace helpers and to have an object oriented approach to in your view And as you can see you can still use image tag and URL for and all those great helpers simple form Whatever in in in cells because that's what makes rails awesome there the view helpers that actually help, but we don't have this Distinguishing between this is the controller context. This is a view anymore because everything is just an object And the brand-new thing in trailblazer is the business logic called operation the domain layer and Operation is a class again man so many classes. I don't know where to put all those classes an operation is consists of a Contract to is deserialize and validate input and business code Yeah, so the contract is defined in the operation the contract is just a reform class if you I don't know sure if you know reform reform is a form object gem for rails and we use reform in trailblazer to deserialize and validate Data without touching the model. So operations always have a form object The actual business logic happens in one method called process and that should be the only public method in that class and In that in that process method. I mean we probably gonna walk through that in the live demo, which is still in Preparation So the business logic the actual logic you you domain consists of happens in the operation in the process method and So you you still access models you still save models But a lot of work is already done by the operation for example validating and assigning the data to the actual model is done In the validate call if you want that you don't have to use it, but I like it again. What the okay one two three I Should start doing yoga And have a deep professional voice Okay, so the last thing in this introduction is I Quickly want to talk about high-level architecture because whenever people ask me what is trailblazer? I say it is a high-level architecture for For rails. What is a high-level architecture? Well a high-level architecture is everything that sits between the request dispatch and The persistence that is what I call a high-level architecture. This is where rails leaves you completely Clueless because there is no high-level architecture. There's a controller. There's a model and there's a view and What we have to learn is we have to think in our domain and not in Controllers and not in models so as an example every application has functions functions a user can perform Like you view I don't know why it's a shop like you view a shop and then you can add a comment to this shop And then you can follow the shop. So stuff when you click through an application. That's functions. Yeah, and in I Don't know in domain driven design. I have never read the book But apparently this is what we call a use case and in CQRS. I have no idea what it stands for but it's great This is called a command. Yeah, so Apparently there is existing science about this these concepts So and in rails what we have is use cases and commands get implemented in controller actions a little bit a little bit in a model And a little bit in view and maybe a little bit in your handmade service object and maybe a little bit in I don't know your presenter object and It's it is a mess and when I when I people tell me rails is so simple You can hand over a project in the next programmer is gonna understand everything if this is not true This is wrong like I've seen lots of rails projects and every project looks different. I mean great I know where the controllers sit great. I know where the models sit and I know where the views are But where's business logic? How do you structure that kind of stuff? It is a nightmare and what Travis does is it introduces the operation So you clearly know where is my business logic and what's the structure because every operation? should have the same structure validation deserialization business logic callbacks and Also an operation is not just one crud thing that has one model So an operation can have multiple models and an operation is also not and a monolithic beast as I said earlier and an operation is a composition of objects that help you to handle your request and It's it's an orchestrating instance in your in your in your architecture And the coolest thing about trailblazer is that it has a new file structure So instead of cluttering files into app controller blah blah blah app view blah blah blah app model blah blah You have one blah blah blah folder, and it's called a concept. So we structure in trailblazer. We structure code Into concepts comment thing. I don't know invoice generation that's all concepts and all the code goes into that folder that has a couple of Benefits for example, if you rename something you don't have to rename for directors You don't have to rename one directory, but that's only one one benefit I find it way more intuitive to go through that directory you see okay, we got view models, okay We got operations. Okay. Here's my model. Okay. Here's my I don't know like help us and it's also the views for the view model Sit in this directory. So it's it's way more intuitive to to to grasp what a what a con what a concept is doing in trailblazer Yeah Austin that's you here, right? Yeah, I do you want to do you want to show us some some trailblazer in action I yeah, I can I can do that but you only got ten minutes Well, thanks to you. Yeah This is really unprofessional. I usually prepare every slide So I don't have to do this kind of stuff But he wanted to be part of the talk. So it's all his fault if things go wrong. Yeah, it's all yeah, sure. Uh-huh. Yeah I see what you did there All right, guys, so as Nick said trailblazer is actually It sits on top of rails as we know It's the one thing I'd like about it is that as he said you don't have to abandon your typical rails architecture The way that you like doing things So what I did was I basically built a very simple blog. Okay, because it's a blog everybody knows how it works You know, it's you know classic example So if the thing will do what I want to do, it's not moving the window stupid technology alright Life demos. Oh my god. Hey quiet you Anyway, because I went full-screen. I'm an idiot for that. Okay, so awesome, you know I built the awesome blog of awesomeness because yeah Anyway, so the idea obviously it's very simple, you know, you just create a blog post, you know type in information and title Blah blah blah and I just for fun. I just said, you know, this is marked down enabled He's extremely proud of this mockdown feature. I like it. I like markdown. It renders on the front end So it's it's implemented in Ruby or what? Let's see anyway, see just pop my email in here anyway So creates a post block done grabs your gravitar and all that jazz anyway So that's the the basic idea that I implemented here now. We've all done this in rails This is very simple from you know perspective of rails. It's you know, not a big deal But in terms of how we did this in trailblazer as Nick said the controllers are Really skinny very tiny as is the font on this damn thing I saw you yawning Thank you. Thank you. All right, so okay big deal here post controller. Obviously we have you know your index and all this stuff New okay, so if I'm gonna create a new new You know post object what we're doing here is saying we're calling this form method on post create What's this post create nonsense, right? This comes from the concepts directory and of course underneath concepts I've just got post and a file called crud which create read update delete So in here, I'm just requiring trailblazer operation crud Most of this is documented by the way on Nick's blog for or excuse me wiki and the github project for trailblazer And in the book that I'm gonna mention in a minute Yeah, yeah, he wants you to buy his book by his book Anyway, so So we've got basically we're just saying here's we're subclassing right here So we got a post and here's some active record. We've got to create class hence form post create and one thing I have to mention is just because we reuse the post namespace which is an active record model class does not mean that the Operation create does know anything about active record. It's just reusing and Ruby namespace. This is a big confusion there's a lot of confusion in trailblazer in the community people think that create now is Inherit from active record or something. No, we just reuse a Ruby namespace So this is how you create namespaces in a in so you can have classes in classes It's a great right trick to have readable namespaces, right? It's awesome inheritance as well So that kind of brings up a question that I'm the community might have given the fact that what you just said we can namespace it in This way What is the potential in the future for separating trailblazer from active record? Say I want to swap in another ORM or no ORM at all. What do you think? I mean is that something on the you know horizon what some of that well trailblazer is not limited to active record, but In an ideal world you had a post namespace. That's not a model Then you had your operations in that namespace and you had the model that's called for example persistence So you had post calling calling persistence. That's my ideal Vision but in rails models are on the global namespace. So that's my trick to reuse this namespace But ideally it's in a separate It's it's a name. It's a real namespace and you have the persistence sitting in in that namespace and then you can replace it with Any kind of ORM you want right on okay? That Explanation out of the way here basically like I said you can look over the documentation He's got but what we're doing here is this is a contract and this is kind of the meat of You know kind of what provides some of the stuff you've probably seen like the validates for example Usually goes in the model But in this case we're telling it look you know you got a property of a title body a teaser Which is do you know a little caption waiver author and of course in this case? We're doing nested relationships because The post has one author and the post or excuse me the author belongs to a post in terms of active records macros here, so As you can see here has one author belongs to post okay, so we've seen these associations before empty models Exactly empty models. There's no logic in there. It's other than that. It's pretty pretty vanilla So of course we're doing properties here inside this this block, so what's going on here is this is how we tell The trailblazer that hey by the way you've got this thing called an author and by the way It's got these two different properties name and email This is what gives us the ability to put this inside the form later, and I'll show you that code a minute Of course here we have validations. I'm just validating presence. They don't you know fail to fill it out now This is kind of the big the big deal right here. This process method Is going to as you can see here. It's got this validate block It's basically gonna make sure that all your you know params that you pass into it are indeed valid If so it will call save on it, so that is kind of how we manage the persistence in this case Now there are a couple of things that I'm gonna ask Nick to explain this in a minute We had to override a few active record methods as well We were looking at doing the inherit or the What do you call it that thing for the yeah, so so that the operation doesn't know anything about I mean It doesn't know about the structure of the nesting, but the operation does not know how to create For example how to create the nested author of the common, so you have to provide that manually I mean there is ways and trailblazer that actually implement this for you and you can just configure it, but In this example, we explicitly create the author to to have this nested model setup Exactly so we all details explained in the book right so in other words That's basically we had to it's a little bit of a trick to get around some stuff with active record anyway So that is exactly how that piece works right here same thing inside updates So we're still inside the post-class. Actually, we're inside the Yeah, we're inside the post-class. I'm getting a little confused my own code here Nice throw, I'm an asshole. I wasn't gonna say anything but You got three more minutes Okay, yeah, you're an asshole. Yeah, anyway All right, so anyhow, we're still inside our our post-class here We've got a class called update inherits from create so we cannot also call an update action on this later If we want to I didn't write that inside the actual, you know the Architecture for it, you know forms and all that jazz, but you know you get the idea So we also had to call setup model here in overwrite it, but it's an empty method in this case, so Moving on here as you can see the post controller New so we're just saying form post create done create run this operation post create do okay And I'm just passing a block Block is only executed when it's when the validation was successful So that's the only information the operation exposes is I'm I was run and I was successful I was not successful. So the controller does not know anything else Unless you do that unless you extend extend the operation, right? It's only true and false Okay, so anyway, we're basically running this Run post create. I'm terrible at naming variables. I just call it x Anyway redirect to x.model. So in other words, this could be you know, there's no hard coding of okay post or You know, whatever it might else it might be here just call model and that's it So we've got restful routes set up in this case, of course And of course the return here. I just don't want anything to happen if you know this actually works So as opposed to rendering the new action here show as you can see is one line present post update Okay, cool The actual update method as well same thing edit all that stuff So and of course, like I said, I didn't implement all the different So the point is that the controller really just delegates to the to the operation and handles HTTP specific stuff like redirects because that's not Concern of the operation the operation doesn't know anything about HTTP and the controller doesn't know anything about the business logic That's the whole point about this. I'm structuring, right. So what does that say what? When the update fails, then the the block is not hit so you don't have this return redirect to the block is only executed when it's valid And then the form is re-rendered like just in a just as you do your controller actions and rails So the whole point is the The block is only executed for successful operations Exactly. So this particular thing doesn't work. It's gonna be like, oh, well, never mind. I'm not gonna bother with this next piece of code Oh, here we are render action new. Okay done So we've got the object accessible inside the form or inside the view and we can then look at the errors on the object Just like a active record. In fact, I'll show you if I can actually see the screen Let's use it Sorry, I don't even have it mirrored over here for whatever reason. All right, because he's unprofessional All right, so Index for posts on doing is just grabbing the posts and pretty simple stuff, right? Okay. We've all seen this before Here is our form. Okay, so I'm just saying if the number of errors objects, you know, it's better than zero then Yeah, we got problems blah blah blah. We've seen this before now in this case. I'm using simple form Basically, I saw some of Nick's documentation. It's like, okay I'm just gonna, you know, totally rip this code and you know work with it like that So as you can see it's very simple compared to existing active record or existing, you know rails very much the same thing You've got your inputs. You've got all this stuff now the inheritance fields for author So of course the form object represent, you know, based on post and now we have the the author object off the post and so on So there's the inheritance and of course the show is very simple as well. It's just, you know View code that's kind of it in a nutshell. There's a few other things, but I'm gonna let Nick take this back Now there's a little bit of a configuration. You might have to do much of which is documented It's github.com slash a pot a nick a P O T O and I C K and then you'll find the trouble as a repo You just Google for travel as a Google Google rocks. Yeah. Yeah, you could do that. Yeah. Thank you very much So that was awesome. Thank you very much. And I'm just wrapping up in the next two minutes So the thing is we have as you saw we in travels we have like net you can have easily have nested setups So like the nested form we had, you know, we have nested the author into a comment and all that kind of stuff So that's really really helpful and all based on the reform gem. So you have nested validations as well Cleanly implemented and It's great You a lot of things in travelers are based on inheritance. So we we use object orientation the way it was supposed to be Yeah, so we saw by the way inheritance. I didn't know if you know that but if you can roll your tongue and you Sippling can't and it's not your sibling, but so this is my sister apparently. I don't know. Maybe you got different parents Whatever, let's talk about inheritance So Trails up you can operations inherit from from from other operations and you inherit the contract you inherit the represent All that kind of stuff is cleanly inherited into the subclasses and you can also travel as it's made to Makes it really easy to override specific aspects of the inherited stuff like you can override properties in the contract Or you can over you can also over at nested attributes in the contract You can override stuff configuration from the represent that you can override your business logic it's just using I'm playing Ruby inheritance and The way callbacks in trailblazer work is also very raised straightforward. So you remember this validate and then we save the model so usually This goes into like the common model in rails in trailblazer. This goes into the actual Validate or process method. So you can call Callbacks explicitly or you can use the dispatch. So you define Which callbacks to call and the cool thing is let's talk again about inheritance is that Also, I didn't know that like if you have a gap in your teeth Your stipplings are supposed to have a gap as well I don't have a photo to prove it But this is also wrong because my sisters don't have a gap in their teeth Let's talk about inheritance. So the real thing is the cool thing is you can also deactivate and callbacks in inherited in inherited Operations for example in update. I might not want to have the check spelling Callback to be called. So I just am skip it. So it's really declarative and simple to override behavior And so inheritance works with contracts represent as policies We also have policies and authentication in trailblazer. I did not talk about this today And I'm sorry and it is also good to inherit configurations Representers are awesome. They render and pass stuff. So this is helpful for operations when you when an operation does handle Jason Yeah, so that the internal contract Can build and a representers of the representer helps you to work with Jason and all that kind of stuff So an operation can pass and render Jason as well if you want that. It's awesome and again trailblazer is not a monolithic beast it is an orchestration of objects handling every aspect of your of your request and People say we don't need this we do this on our own I agree, but trailblazer is an attempt to establish a standard. Okay So we get awesome stuff in trailblazer like polymorphic operations and policies and blah blah blah blah blah It's great. Check it out. There's an awesome book. It's on lean pop comm slash trailblazer lean pop comm slash trailblazer Lean pop comm slash trailblazer or you could Google it We also got stickers the cool thing about the stickers if you don't like trailblazer You just cut it off here and then you have a free ruby sticker Ha ha ha ha ha ha ha Nice hit me up I'll give you a sticker maybe and The cool thing is an engineer. It spawns at me to come and give this talk So they basically pay everything. They are awesome. They are really nice I'm not affiliated with them, but I find it a great thing and other companies should adopt this to support open source authors because it is great if you can speak at a conference and and you meet awesome people and A great company stays behind you and supports you. So thank you engineer and Just to wrap up Use trailblazer. It gives you new extraction layers use operations because they help you structure business logic use all my gems and Be nice to each other. Thank you very much