Event Storming demo & discussion

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay and we going okay so um let's see what is this about them let's let's go through what we have so far just bring it up on my screen so we can read it together here Jonas screen share that so we can see yeah as a community all right that's probably a bit too big no I mean just resize this to something that people with a normal monitor can see if if Boone who keeps stops trying to resize things for me right yeah we okay so let's let's go through this we've got a really basic well reasonably basic domain so we've got booking the room for a hotel right so say we're some my hotel booking website funnily enough all the rooms paid in advance the holiday periods super saver rate is like 200 pounds obviously that's in in in sterling because I'm British and that's how we do it we got a flexible rate which allows cancellations and stuff so I actually have kind of missed that off there so that might be useful to add in as well if you booked in the term time when all the kids are at school then it's going to be cheaper because that's basically what happens in the real world loyalty card points we can use in blocks of 500 points and you get a discount by 50 pet fifty pounds and you earn one point for each ten pound you spend so it's a terrible loyalty card scheme actually looking back at it now but I don't care which is not a real hotel so it looks very it looks very real world yeah maybe okay so I've just written a few scenarios which basically demonstrate those rules with some examples there and the plan is to go through and do some event storming about how this and how we can model this in a in a in a domain model so we've got this other tool real time board let's shoe switch to that where we can add stickies and stuff which is kind of fun your stickies are huge yeah I know I'm gonna figure that out so anyway the medium/large yes that was like extra extra extra large okay so let's see what do we want to do let's actually look at what is the the relevant part of the domain I guess this is a booking for a hotel application so if we were to work for a client that has a reservation system what can we take as the most important thing that happens during the entire I would say with the booking process yeah yeah yeah now that's exactly the point so let me actually remove this so that's a very good way to start we should probably start from the event so orange sticky that is most relevant to our customer can you filled it in well has been or should we say reserved worked or reserved yeah I think more like yeah probably reserved I don't know if if the domain wording here is better with booked or reserved probably booked everyone talks about booking here and obviously regardless if we do overbooking regardless what happens next the customer reaches this point we have them by the gut okay well that's probably a bit too harsh but that's kind of the point we want to get here and in order to get here we need to do a few other things so let me go back because I don't know what your de mine looks like this looks like Oh loyalty card related loyalty card loyalty card so you remodeled everything around the loyalty card the examples right yeah in the the reason why I've done that is to demonstrate the the variations in price and the effect that the the two different rates have on the domain there so obviously the flexible rate it's going to be more expensive because it allows you to cancel and change booking and so on so okay I I think the first example sorry say they're gonna be yeah I heard a few things that were kind of like key words okay it's old booking I just heard it you know where it happens I just heard it I'm gonna put it there little guy mission Haven has been taken that's yeah why about it and we need we need the rooms to be paid for so mm-hmm I'm gonna take it and write it down anyway even if it's duplicate we're going to figure out later which correct terminology is so um okay so talk us true what what you want this domain to do right so well we want to be able to book a room so working backwards from there we want to be able to select a rate as well so let's say you're already on it we want to book a selected duration we want to pick the date isn't that the same well no because we check in on a date and you stay for like three days so the duration would be well okay you could do it one one of two ways you could say this is when I'm checking in I'm staying for three nights or you could say this is when I check in and this is when I check out okay that I suppose is really user interface thing isn't it possibly doesn't matter because for now they're things that are actually happening so let's let's first write them down and we figure out what is actually relevant to data mine as an outcome mm-hmm now if we're a loyalty card holder we can use our points to discount the total as well I would be called this as something like complimentary it's like could say like pop pay Hartley pay depended BBC and that how was it called loyalty card yeah loyalty card okay and assuming that the customer is paid for something they can earn loyalty points after the payment has been taken as well right so like this happens like after payment for you well yeah we want to make sure that we've received the money first and then we can issue the points to their loyalty card account I guess no redeemed is the other side actually oh yeah that that's me and my terrible English so this is more loyalty points earned yeah so actually the other one might be loyalty points redeemed against the total yeah all right well Stu I'm just trying to make some space so we don't just get stuck with everything crammed together these looked like the same we don't know if they're in order or not not yet at least one thing I do like about this is it's very easy to move the stickies around much much much more much easier than in real life that's for sure yeah yeah I can already imagine that half of these already had fallen off yes I need replacement on a real wall or window all right okay so so loyalty points redeemed loyalty points earned what else do we have you say loyalty points are computed let me look at couple policies i'm riously cheating here i'm already looking at the specification you wrote I'm just trying to figure out what else is there in this denying the Wraiths there is some flexible raids and supersaver rates so there is a so they say the rate selected yeah so that'll be whether it's flexible or supersaver expect what's the other one stupid saver I've invented these names right they're not real terms it's fine it's fine don't worry marketing doesn't do anything better here anyway they would probably call it this where it will try rate whatever so I think that eliminates the room date rate selected sticky um yeah wondering about that yeah most likely I guess let's strobe it yeah I think let's cover that one it's probably too eager but that's indeed the point you write the two rates decide maybe something about the loyalty points or I don't remember if it does actually applicable hang on well whether you are a loyalty card holder or not Oh see if you have a loyalty card you can enter it at the start so or at least at some point in the booking process and you can say I'm a loyalty card holder this is my card number or whatever you know like you put Jerry miles number in and then that will allow you to redeem or earn points against that I would almost say that the loyalty points are redeemed for a discount is probably how they this kind of rate which is almost part of it's like a add-on to the rate selection hmm it's like there's a loyalty point discounted rate yeah and from from their accounting perspective it's not paying for the room it's actually them getting less money for the room that's a good show yeah and even in the policies actually I've written it that way each 500 points used discounts the rate by 50 pounds yeah so if you had like a thousand points discounted by a hundred pounds but yeah so it does it apply to both policy is to both rates is that yeah it can apply anyway so it applies after the rate was selected anyway or before it could it doesn't really come into play until you want to see it the total okay so I'm gonna put it down here since it's not really related it can be entered at any time really it's just when you want to see the discounted total is when you'd actually need to have that information oh yeah that's a good one I'm gonna put it down here for now is it raining I don't remember yeah yeah this is there we want to be able to see the current rate before we pay for it we're not gonna pay if you don't show me or it is so the input here will be these combinations of these plus all the dates maybe the availability I guess yeah here I realize I'm putting in some stuff that it's way too forward in the process that's fine that's fine it's worth pointing out that I've ignored the fact that there are of course in real situations is different room types like single a twin or whatever I've ignored that fact all rooms are the same so it's not yet about what anger it's just like economy class everyone is to see yeah so we have yeah okay tonight's and what matters is not like when you book it but whether you book it in term time or not and that's the only thing that affects the price so that's the stay dates selected back at the start and she's flexible or super saver rate and then you can use your loyalty points yeah I think that's covered actually most of what we have there are so one question that comes up here and is that loyalty points earned does that actually happen at payment because in this kind of system I would just login pay for a lot of stuff than cancel all my reservations and just keep the points and stack them up until them back and I can book it for free mmm usually you don't even you only get a hold on your credit card and you don't pay until after your stay anyway and then you earn points the payments been processed that's that's kind of the point there we go so we got some more information do we pay at the reservation do we pay later so the payment has been taken that you usually do like a credit card hold well the this hotel requires prepayment okay so what happens if I refund ah well if you're on the flexible rate you can cancel it and then you get it refunded so this is your cancel a booking there on the right hand side I'll cancel the booking ah there we go so we have tap here we probably have some information and they keep putting down the wrong color summary so this is some information about a refund I should brave they say you can only cancel or change your booking if it's a flexible rate if it's super saver rate if you booked it you've paid for it that's it that's why it's so cheap well a 200 pounds a night is not exactly that cheap but hey Doyle T points removed or canceled can't spell do we do here yeah works and I guess that happens in every case doesn't matter if you refund in one way or the other the points get remorse or do we want to keep giving you points if you if you know if we steal the money well indeed that's a hole right we want to plug that upfront let's simplify and say let that's we can't change bookings mm if you want to integrate cannot be canceled yeah if you want to change the booking you have to cancel it or and start again yeah yeah okay that's cool that seems quite straightforward which makes me think what have we missed well if you were to do this in a workshop I can tell you there's enough material to keep people stuck for an entire day here if you were to implement this yeah so Rome availability is some kind of external system or service or something like that well basically we assume it's a given we don't care about it we probably need to deduct the availability at some point when the room has been booked so we may need some sort of personification to external systems yeah yeah I also free up the room if it's been canceled yeah let me put here if there's a pink external system which is basically anything that will crash burn and hate you yeah and he has a soap API yeah just in the line at all so one knowing look at that alright it says it's a line but it's not oh that's better oh is it I did it it's not line but okay go perfect yeah alright alright so um there's an external system down here which is I would say the hotel reservation system yep sure all right and the hotel reservation system accepts a couple I'm going to put them down as blue ones commands it's just things that we can tell it to which are Oak Room and council reservation and we don't care what happens in there there's gonna be dragons but that's not our problem alright put it down somewhere here what free room after a reservation complete be a separate thing than cancel well depends of the external system we just notified it's probably going to be one of those systems where we have to provide a lot of information when we cancel something I can expect them to not have separate api's but the idea is basically we can just allocate and deallocate that's what I'm thinking at least obviously oversimplifying it as the about rotation system is provided by myself right I mean kind of done that because it's alec a room and deallocate right that's you know we you could implement that as a Redis thing and just say there are a hundred rooms when you book one take one away yeah yeah yeah ok forget it but you need to have date ranges on them but you could still do that ah yes that's cool there needs to be a policy their room has unique would be like room - baby yeah right and they were actually the room has been booked can only happen after we query the external system because we don't know about it we can't trust anyone what was a disss policy yeah this is going to be something like 100 now when payment payment is taken ah and as with it in the other event storming session this goes down here something like this okay alright and yeah so that is going to raise somewhere here there pendant so points are earned who causes this event to happen is that a good question that is crushing that's going to be a say a response from this so we're going to need a command to come back to say confirm that their looks or something like that well that is already a command so it produces an event it could be modeled as a separate aggregate here and then we copy the event with it this already very similar to what we did with external systems for tracking comets and we say when a room has go notify the recalled evasion in internal reservation system I'm gonna call it system system use a perfect word you can describe anything with system and that's gonna be something like that's gonna need a command other command here and this is gonna be something like record successful salvation yep that makes sense good enough yeah and I don't know about scenarios which lead to failures but it seems to me that these systems will not likely at least the external system will not be very automation friendly and I can imagine that they're gonna expect the fax or something like that they the this particular hotel reservation system actually needs people to send a handwritten letter on company headed that paper and then they call that through to the a single person who may may or may not be available so there's a single point of failure in the process and then they will give it a stamp to say it's approved or not even if you're like threatened by the mighty ravenous bugblatter piece of trial even death that's yeah yeah well the need to do it Britain to personally be out having a cigarette break so and they can't book a room until it until they're back right so successful restoration raises an event in our system in which we just say the boom servation firmed I suggest I suppose when the confirmation is incoming notify the customer I guess that's a bit you know superficial but yeah and there we go and you can really honestly it can explode in complexity here right it's kind of the one thing that I notice is that the workshop you started from the idea of modeling it around these two hmm right and you got enough material to keep people busy on just these two yeah I mean that's kind of some complexity that wasn't really considered there so that's kind of cool but that's kind of the point that's what I want to demonstrate I don't want it to be too simplistic like the the checking in checking out of a building is like super simplistic and it's great for demonstrating the concepts of writing a technical events or system but I'm not I'm not trying to demonstrate event sourcing here as such I'm trying to demonstrate a particular technique of brainstorming and exploring a particular domain now this can completely be written as as and very normal aggregate it's got a couple states can be a big mess if you make it one entity but my point is is it doesn't necessarily have to even be a technical process you know it doesn't have to be this is how we're going to go and implement it in the system this is just a good tool for exploring and saying how does this business work what happens when this happens and things like that and although yes we are defining it within the framework the of you know events storming from Alberto Brandolini you know that works quite nicely for just exploration and discovery and figuring out what's going on in this because we've you know as just by going through this we've discovered what happens when we book a room we need to actually go through to this external system and figure out is a room available or not and things like that so yeah you know you can go straight into the hotel reservation system and say actually a room is not available for that date but can we alert the customer earlier on and say when they select their dates their stay dates can you query the hotel reservation system and say is this date available and then it'll come back and say yes it's no it's not available and things like that so you know that that stuff with the room availability view model yeah that's not something I'd considered yeah no well we didn't we didn't absolutely didn't complete anything I just want to hear ask Evan is like how does this look is it like comprehensible modeling approach we don't well I'm gonna just label a couple things here that we didn't yet have so one is external system that we yeah wrong what did I do wrong here so this one is the external servation modeled as an aggregate in our system it's just collecting events that come from the outside it's not doing much more but so what I want you to understand now this is more about we can obviously go on and model everything okay but I don't think that's beneficial because we were just going to spike and figure out how much work can you figure out here from just doing this modeling and I think there's like so much scope of stuff that can be built you know what do you want to do them like you obviously have a time box of I guess eight hours if you want to completely destroy these people well I'm limited to three hours and I what huh yeah well I'm limited to three hours for the whole tutorial and this particular part like the event storming part is probably gonna be like 40 minutes I think wow you're optimistic this was 40 minutes with me and you and we already did this multiple times mm-hmm okay so this is very optimistic I think you can actually feel the entire workshop with just finishing the modeling here so we need a section that we can work on or we need to redefine scope of the workshop yeah yeah now this is been good this is valuable because now I can see stuff in context what it is but this wanker with a wine needs a beer yeah I think I need to I think I need to box like the scope of what we do in the event storming I'm gonna think I'm gonna keep the domain because okay it's got it's got some like it's got things that you might not necessarily think off straightaway which is what I quite like about this yeah well one thing that we absolutely didn't model around is the reed models but the problem is that the modeling here is already taking everything so what else did you want to do in a workshop let's let's go back a stab there and let's figure out what do you want to do during the workshop all right there's there's lots of stuff here hang on let me just bring up my oh good the water issues right yes issues there we go yeah so the planning exercise like that's including all the other stuff about planning is gonna be like 40 minutes okay so let me just scope it a bit if we were to go and simplify things and we were to just plan interactions between two aggregates we could get rid of the loyalty point stuff I realize that's exactly what you wanted work done mm-hm and keep you just do the core reservation stuff because the loyalty points is like an addendum to an existing reservation system and if you were to model that as you need to model that in order to get to the point where you have loyalty points so I would remove the fares okay let me let me just delete it right pick up this recorded anyway I'm gonna remove the loyalty points okay I'm gonna remove everything that has loyalty points where is it loyalty points loyalty points just gum up their refund issue I refund issued for flexing no refund issue let's keep some issues okay no no special fares no nothing and what else is there when a payment is taken successful reservation notify customer of reservation this looks much more manageable now mm-hmm you just brought in outside management for your hotel and he just told a restructured everything well yeah what mean yeah down these countries yeah no but seriously like look at it now okay so let's let's figure out if we were to add all the commands that were missing here so stays like that and this is gonna be the the input is gonna be select room that's that's the commander Camden right mhm this needs to come from these right right and I think we can just go with stay dates selected rather than stay generation selected I think that second one can go right make sense so let's simplify payment has been taken payment room has we pay for I personally prefer the room has been paid for okay over I don't know what's what's your preference there Ivan maybe yeah room isn't pay-fors okay and then we have yeah so now we have of course we need to pay it's simple for now but right and room has been paid for like this interaction with stripe or something good that's actually very good because we can add it here and there's gonna be anyway a mess the payment gateway could be a mess could not be a mess we'll see mm-hmm that's just ah just a line please okay and then we have canceled a booking and booking refund issued so to cancel a booking we need to have the my pending my future stays it's like in my account yeah yes sir no Mira and you know they're cancel the booking and and yeah look here already if you were to do a mapping session you could go completely wild about who is gonna do what all right the refund I don't know may or may not happen that's actually just add the policy here I'm gonna just make a very important policy yeah and don't forget that's also how there's also the interaction with the payment gateway again right aaaa absolutely refund hoping right so we already got a lot of complexity here and we still need when a booking is canceled we still need to notify the external participation system so and by the way I'm being a terrible terrible terrible enabler on this meeting because I'm basically doing everything freaking out people call me crack please know I mean this is kind of good because that's how I want the workshop to go I want people to run around I mean so then reason so there's another thing here so my opinion here is this is not gonna be 40 minutes anyway but if you scope it down to just what we're seeing right now yeah right so you're going to play dumb and say you're going to be the domain expert play it a bit dumb let people figure out things right yeah and if you know this is everything we want to talk about depending on how much time it takes to figure out this one the fact that there's an external aggregate an external system this is the part that is kind of like probably the design attack sure thing that is to be figured out by etnies yeah besides that I would say it will take you an hour at least the development part I don't know it looks like a lot of stuff no we're not gonna go and develop this from scratch though bear in mind I mean to provide existing code yeah yeah basically I'm gonna write a bunch of code for it I mean there's going to be examples of you know good method naming class naming using value objects you know leveraging strict type declarations and things like that so that we can have implicit trust in you know what what the code is doing so that's yeah I mean we're gonna go and sort of maybe take a couple of these aspects and convert them to code in the workshop but a lot of its going to be pre-written and it's just gonna be like a couple of exercises to go through there yeah okay so I'm thinking so basically you're going to provide existing code base and you're going to ask somebody to fill the gaps mmm and what would you do would you provide a be Hat scenario with an empty context or a semi filled context or something like that well for testing we're going going to be going through I'm also gonna provide examples of some awful terrible bad code and provide a test with it that shows that it's still possible to test it it's just not as nice hmm and then refactor that to put in dependency injection better types more small I mean more meaningful methods return Early's things like that let's code branching okay but but again you're in three hours and you seem to be basically describing half other clean code talk that already takes 50 minutes that's the problem there yeah yeah I'm I'm gonna fit a lot in okay also having a look at infection PHP and code coverage and and behavioral tests as well so you're taking so ye you're going to pilot there and be guiding the class rather than letting them do stuff here on the end yeah they're gonna be what I want to do is provide very sort of focused exercises that I know aren't gonna take long and just sort of demonstrate the concepts so it can take away in certain that's been my most successful way of doing workshops yeah doing that instead of doing Kota Long's Kota longs don't work for me because too many people get stuck and then just give up and stop following and like all this works I wanted to see this is the concept that we're learning here and even if you run it and it doesn't work it doesn't matter I don't care the point is that is as long as you understand you know why you know reducing the number of code branches in a method is good that's the point not oh yes this method works great my tests passed yeah okay it's so basically infection would show that or something like that like code branching showing that oh yeah you thought you went with full coverage and instead it's just yeah yeah and and look as I said a lot of these examples are gonna be pre-written as well so it's just stuff they can copy and paste it into the terminal and if they want to run it and it runs and it works that's great if not you know they can see with the code that can see read what's going on yeah so it's there is still gonna be I'm still planning to have those interactive exercises it's just I want them to be like really short focused you know see how this works have a quick play now let's move on because as you can see there's so much content to get through um that I want to just have a bit of a play around and then move on yeah yeah my best also my best way of distributing those has been just bring like five ten USB keys and put like exercise one dot zip exercise two dot zip exercise three dot zip on there yeah so yeah yeah what I do is I give them a git repo and I push one tag after the other and I just expect them to check out a new branch and I make it just like yes my keys in case the internet there is now working well well it's a git repo so you can copy a get revenues but anyway okay and what what I wanted to clear here with James so this stuff that we're looking at this example will not be in DaCosta yeah parts of it what possibly most of it will be but it's just gonna be basic domain implementation it's not not gonna be actually implemented as there's not gonna be a database there's not gonna be any actions or middleware or anything like that it's just gonna be the domain yeah I know that I understand is just I'm telling you well you you're planning to have this in one week or something sorry you're planning to do this in one week or something yes yeah good luck with just even writing examples with the oldest that's what I'm wondering about it eating is a lot of stuff even for somebody that has experienced that what I'm saying I don't sleep that's okay that's the that's your opinion I thought it works I've right I did my nginx talk like two days before yeah I'm going to have to prepare a very similar workshop for the first days of mice so what I'm going to do is I have to take this particular domain which honestly is fantastic for this and do the same thing with doctorate with what I will like with doctrine oh what that RI nonsense yeah exactly so I have to commit use more I'm a nonsense one which is totally not a good fit but you know that that's what it is that's what people still use in apparently they won't workshops and honestly I should stop providing them and then the next day the events are so cool alright I can use this this one I can write good good yeah I mean and and please like reuse the code and stuff I don't care it's just it's gonna be in that repo eventually when I start working on it and I'm gonna write most of it tomorrow probably yeah yeah yeah makes sense I mean maybe it still has read mumbles which is a good way to you know like oh here you're going to make an evaporate query instead of using the RM and destroying our system with memory overuse and then proper aggregate design value objects something about yeah I'm very skeptical about the three hours that's that's the only thing I don't think I think people will get stuck on this one a lot well I mean that's that's my responsibility responsibility to make sure that if we time box it adequately yeah and what you don't do is let's say that you you go over time you just take control or explain what you will do oh yeah yeah listen we're not necessarily trying I'm not trying to map out a whole domain here all I'm trying to do is demonstrate like the usefulness of an event storming workshop yeah absolutely so okay until the actual content of what we're doing is much less important yeah so the problem so that we can demonstrate oh this is a read model this is information that the the consumer will need to know in order to perform a command and then the result of that command is an event and blah blah blah and you know how can help you reason about a domain that you want to explore not necessarily this is the domain that we're exploring we need to look at it in great amount of detail because the detail we look at this particular domain in it doesn't matter too much yeah yeah because this is not this is not a DDD an event storming event storming workshop this is a how to improve the quality of your PHP applications workshop yeah absolutely that's what I'm that's why I am so skeptical because this stuff is going to take a long time that's that's all I'm saying there so the other stuff I think yeah well let me know if you need any help with a code or with the bad examples I can just dig up something from some libraries that I don't like and yeah cool all right thanks folks we shall end [Music]
Info
Channel: Roave
Views: 35,177
Rating: 4.8518519 out of 5
Keywords: #hangoutsonair, Hangouts On Air, #hoa
Id: xIB_VQVVWKk
Channel Id: undefined
Length: 48min 56sec (2936 seconds)
Published: Wed Apr 04 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.