In short; because if you have a map you have a context and it gives you situational awareness – without a map to navigate your business, or personal, goals you are probably walking in a dark room with the light of a matchstick – with a map you are walking in the same dark room, but holding a flashlight; giving you the opportunity to be aware of the space you are in. Having situational awareness is a strategic advantage over those who don’t, probably most companies and organization, but more importantly you have the opportunity to actually find new paths or new ways to travel on your map; or how to even redraw the map as you would like it to bee or how the future would look like.
a map gives you situational awareness, making you aware of the space you are in
A real world map example.
Imagine you are going, by car, from Stockholm in Sweden to Helsinki in Finland – you know you need a car, to explore some areas and cities around Helsinki, and to visit a friend in Lahti; about two hours north of the capital.
Without a map and no experience of the route you are likely to depend on asking people on your way there, if you are lucky you get good directions, and don’t have to stop too many times asking for new.
Now, here is a map for you, with the major roads and some water routes plotted. Depending on your needs you could now think of two ways to travel, the first and perhaps most obvious is to go by car around the water (a drive taking about 20-21 hours non stop), the second way would be to go over the water, but then you need a boat, and you must be able to take your car on the boat, but you don’t have access to a boat and are not comfortable with the idea of sailing; the drive of 20 hours seems like the best option.
But, then you meet someone, like me, you show me the map and talk about your travel plans.
me: – ”that sounds like a fun trip, are you going to see anything special up north? Like the polar light or playing golf in Tornio with 11 holes in Sweden and 7 in Finland !? ~I would like to to do that too!” you: ”no, didn’t plan that, I just want to see Helsinki and meet a friend a couple of hours north from there” me: ”I see, but.. why don’t you take the ferry then? you can sleep, eat, relax and even get a SPA treatment if you like while going there, I mean, instead of driving all the way” you: ”Oh.. is there a ferry line? that sound like a better option”
me: ”definitely, and yet another option is to go by air and rent a car, or perhaps your friend has a car to borrow while you are there.” you: ”didn’t think of that, but I’ll take the ferry, it’s definitely the best option for this trip. Thanks!”
Lesson learned: Having a map to show others and talk about makes things super clear
What could the future look like on the map?
Imagine all the things possible and not really possible to explore what might be in a future, near or distant.
Could there be a tunnel under the Baltic Sea? (Östersjön) or a bridge crossing it? Or perhaps the sea could dry out? Or the lands be extended into the sea? Or a massive earthquake could move the countries together?
If you have a map it is easy to start adding layers of ideas and to test concepts in the context of the map.
REMEMBER – on a map, the space has meaning, and you might think of the space as being an obstacle, but know that the obstacle often is the way – ”every obstacle is an opportunity in disguise”
When looking at this video walk-through of OAuth Event Modeling in Go by Jamie there was a question about how to handle commands without the need of switches over the command types.
So my reply on that got a little longer and thought I would share the resources I pointed to here (to free the comment from being stuck in youtube)
Great example and walk through Jamie! (and thanks to the rest of you for value provided)
Regarding handling events without the switch, I do not know Go – but in C# you usually register EventHandlers with commands and you will have a dispatcher or similar as a single entry point where the handlers knows what commands they should act on. see examples in referred links below.
So, maybe this is not for Go devs, but you might get some ideas from it, anyhow.. here are some links for c# resources.
”This repository shows how to implement Event Sourcing, CQRS and DDD in .NET Core, using a Bank as example.”
I like to look at things in the order of ”from entry point in the API”, Hope you can follow my logic =)
Command to Result flow.
start in ’Api\Controllers\StudentController.cs’.Register(…)
//called from UI to register student
var command = new RegisterCommand(...); // (Logic\AppServices\RegisterCommand.cs)
Result result = _messages.Dispatch(command); //finds handler, handles the command and returns the result.
The message Dispatcher
in ’Messages.Dispatch(command)’ the matching handler for the command is looked up, via DI, and then executed (aka handled).
handler = _provider.GetService(handlerType); // System.IServiceProvider (built in)
result = handler.Handle(command);
The Registration of handlers
DI, Dependency Injection, is configured in ’API\Startup.cs’ and handlers, for commands and queries; these are registered via services.AddHandlers() – where ’services’ is ’Microsoft.Extensions.DependencyInjection’
This class takes care of finding, and registering, all handlers of type ICommandHandler and IQueryHandler in the assembly,
making them available for use from IServiceProvider.GetService(serviceType)
Brick by brick, piece by piece, part by part – anything an object? anything an event?
What if.. you did lay out the bricks in a good way, to support the small house you started to build, but then decided you should widen your house, or perhaps make it taller, and just started over – brick by brick. This might be hard, probably to expensive, but possible, in the brick house world. Sure, some of the events bricks might be broken and, thrown away, replaced by new ones.
In the software world it often gets to messy and expensive, but can many times be a lot easier than in the physical world. Since we, in an event sourced system, could tear down the brick wall (our UI data projection), and replace all bricks (i.e. events) in the places we want them for our new building.
I have a simple challenge for you
Think of anything in the world and try to convince me it is not a result of events from the past.
So, last week I restarted my learning path of event sourcing and eventstore, and today I happened to stumble on this post https://eventstore.com/blog/event-sourcing-and-cqrs/ by @AlexeyZimarev – I can highly recommend it as an introductory article on event sourcing and cqrs (pointing at eventstore with some examples) + DDD talks from Alexey.
I was not about to write an article but since I had to much text for a simple post on LinkedIn I expanded 🤠
I’m familiar with the concept of event sourcing and believe most systems should use it, but haven’t worked with it for 3 years and wasn’t fluent then; now I need to learn it solidly for a personal project and also to evolve as a software developer.
Why event sourcing? What is it good for? You want the truth?(Pi)
If you are a developer and not familiar with event sourcing you should update yourself.
a 6 minute answer of why event sourcing by Alexey – in short; it enables you to know what has happened in the past which enables troubleshooting and capitalization of user behavior etc, the historical data is not destroyed as in a ”state managed system”, i.e. traditional CRUD, and thus you always have the truth.
The power of events is unlimited compared to traditional crud systems.
Events are not new in the software world, but for a long time too many systems have suffered from not having an event based implementation.
Your bank account transaction history is perhaps the most publicly known example of event sourcing – all historical events builds the current balance (history is complete).
From a technical perspective
maintenance and support in state managed vs event sourced systems.
Troubleshooting and support in a STATE managed system.
In the development phase when defects are found and no one knows what happened and the original data is overwritten by the defect but you don’t know it did – it gets hard to find the issue. Or worse, the defect gets shipped and destroys data at a customers site and you can’t restore the data, you can’t see if the system caused it or if the customer has changed the data.
Support – without the possibility to see what happened, in the system before it got to a ”broken” state, it takes a lot of effort to track what has changed and by who, and users might not know or remember, or don’t dare to tell the truth. If you have great logging in place, you might be able to track changes that way – but it’s often not efficient, if at all possible.
Troubleshooting and support in an EVENT sourced system
Troubleshooting in development and support; since you have access to all events, you can look at all events in the time between a last known good state and the broken state, you can see what really did happen, and what or who caused it, and when.
For difficult support cases it becomes possible to take a database from a production system in a broken state, replay all events (i.e. rebuilding the state from history) and observe what happens – just like following a rope from end to end, instead of wrestling in a big ball of mud or looking for a needle in a hay stack.
Aligned with the real world languages and human thinking
Perhaps the greatest power is that events are natural for our minds, and something I could talk to my mum about(she doesn’t really understand what I mean when I say web browser).
Stories are made of events
as am I, so are You, as are the history of life
Humans are exceptionally good at remembering stories, stories are made of events, as am I, so are You, as are the history of life.
So, talking with user, domain experts, developers etc. becomes easier – developers can learn the actual business process and language much faster and actually talk to non technical people (at least some.. I can 😉) about what is going on in the code.
Product and business life cycle – room for evolving and improving together.
Projecting read models f ex for display to users, or other systems, becomes easy to alter and make variations of as the system grows and as business evolves, thinks of new concepts.
Adding new types of events and letting other systems listen to event changes gets easy.
Business intelligence (i.e. tracking what happened and when) becomes easy, having insight in how customers and the user behaves is very valuable for improving the software and the business drivers. Storing the source of truth enables business to reuse the data in not yet known ways.
Getting new team members up to speed on how the system behaves is easier when events can be lined up in an overview.
Combine event storming, to understand the important things of the domain in collaboration of domain experts and software developers, with domain story telling, to find important concepts, use cases and user interactions/flows; and then map them to an eventmodeling system blueprint – readable by most people (at least with a brief explanation)
And now ”all” you need to do is to build the software (using TDD and DDD in a mobprogramming team – IMHO)
As always, not just in the ”strange” time of now, I start my morning with I writing down my dreams if I remember any, then write my thoughts arriving just before and just after getting up, then write what I should do today (work and other). To wake up the body I do a short (15-30 minutes) stretch and physical exercise (kind of yoga but not), sometimes adding a short meditation (although the stretching becomes a little meditative most times).
This makes me tuned in/on for the day with awareness and declutter my brain.
: Now (strange times) : For the last weeks, instead of commuting to work (by metro or bicycle) I either take a short walk (~20-45 minutes) in the ”forest” around the block, or just sit in my armchair with a coffee watching the clouds and trees and birds outside my window (sometimes both).
I’m ready for work – my mind is clean and focused.
I do ”focused” work for about 3-4 hours, with a daily morning meeting somewhere in the beginning or middle. Then (as usual) I go for a lunch walk, about 30-90 minutes, to get movement and to allow my mind to rest and work on the problems I’m trying to solve. Sometimes I eat before, sometimes after. After lunchbreak, I continue work for about 1-4 hours depending on my mood and time balance (working 6 hour days on contract, but, with flex, in reality sometimes 4 and sometimes 10+ and everything in between).
: As usual : Regarding the focus
I try to use the pomodoro style with tomato-timer to set 20-25 minute chunks where I rest my eyes from the screen for a minute or two, doing the 20/20/20 exercise, (previously I used protectyourvision but is made in flash..), perhaps do push-ups to energize. The tomato-timer is also good for setting breaks and restrict you from going back to the screen before the timer is done or to time box ”social media” and news.
My phone is always (95%) in silent mode (not vibrating) unless I know I have important calls, most notifications are hidden. BUT.. it does happen that I get distracted from notifications when I have to use the authentication app to login on to vpn etc. (a nice benefit of working at home is the lack of ”others” phones, in the open office at work there are always phones around me..)
My email is open in the start and end of the day, sometimes I check it after/before breaks, notifications are off.
Slack and Teams are used to communicate inside the company, notification sounds are turned of, popups turned of. (the only distracting is the Slack icon showing I have unread messages, if the app is active in my ”activity field” (windows)
: In normal times : when I’m at the office, I try to have regular breaks for coffee and chat with colleagues, but we don’t have set times where we have breaks together so.. it really depends.
: Now : I do have a couple of set times during day where I will check in on the news (usually don’t watch news, but these days I think it is important), and do some chatting on facebook etc. with friends and family and sometimes a call. The time slots are ”after morning meeting”, ”before/after/during lunchtime” around 14-15 to tune in to the daily covid press meeting updates on SVT.
Relax, rest and recover.
: What I believe (and as science proofs*) is very important, not just now: is to really take qualitative breaks – meaning RELAX YOUR MIND , e.g don’t use the phone for a paus in your work, don’t bring the phone to the toilet, allow your brain to relax and recover, allow your eyes to rest, and.. allow your wrinkles in your forehead to relax and sink back =D – you look younger and happier when not doing that 😣 FPF (frown phone face)
* I highly recommend you to Read or Listen to ”Why We Sleep: The New Science of Sleep and Dreams” by Matthew Walker
I enjoyed the audio book
and if you feel the need.. to do something creative or take a nap, meditate, exercise.. just do it! REMEMBER! work is not all about the input and output of crunching hours (although I also do that.. as it’s stated in my contract to ”deliver hours”); doing meaningful work is about outcome, and outcome is not the same as output, outcome is about delivering value and quality – things that comes from awareness, creativity and a relaxed mind.
A relaxed mind is a creative mind ~ seek for qualitative breaks to refuel
: What I do think is hard : not just now, but perhaps even harder when working at home, is to not do work when my mind goes to work even outside my ”working time”, and perhaps it is harder for us, that like me, have work and interests/hobbies that overlap – to be a craftsman in any profession requires you to have a desire to use the knowledge and skills to do great things, creative, beautiful, helpful and valuable for others.
~ Sometimes ~ I tell my self that I envy those who can switch of the brain when leaving the office or factory ~ but I do love to think deep and collect knowledge and use it to solve big problems (though I haven´t really solved any big problems yet, I have the desire and a couple of plans in the pipeline ~ I’ll be writing more of that later so stay tuned )
: Finally : Please take care of yourself and those who are important to you, and be nice, be kind, to everyone you meet. 🙏
Hur man gör ett mikrofonskydd/vindskydd för ett mobilt headset – eller två.. Ok.. jag blev inspirerad av Mats Kempesinlägg på LinkedIn var jag tvungen att försaka mina två sista tvättsvampar i ett experiment .. någon som har bunkrat sånt? 😉 Jag har sett olika varianter av skydd på nätet för omkring 50-100 kr så det är ju inte dyrt, men hur kreativt är det..?
Mål: ett mikrofonskydd som sitter på plats utan extra lösa delar (t ex tejp eller ståltråd o.s.v) Verktyg: Sax (spetsig kökssax), grillpinne. Material: Kökssvamp utan slipmedel, gärna olika färger. En kopp te eller, kaffe alternativt ett glas vin eller en öl (alkoholfria så klart). Tänk på att skumgummit kan ”smula” en del när det klipps i.
Resultatet av ca 30 minuters testande av olika varianter ser du på bilderna nedan.
Summering: Fördelen med att göra det själv är att man får fnula lite och testa olika teorier, ofta är det som från början verkar enklast ganska rätt, men inte alltid så enkelt att göra 😄
Du får ett mikrofonskydd som även kan användas till att torka av skärmen och kameralinsen (på mobilen ja, NEJ inte på din riktiga kamera).
Du hittar (ser) dina hörlurar lättare med en färgglad klick.
Andra lägger märke till dig och din tvättsvamp när ni är ute och går – kanske inte en bonus? 😊
Du kan forma skummet som du vill (nästan) – tips, tänk stort och följ formen av en pepparkaksgubbe; med ett snöre rak igenom figuren ser det ut som en sprattelgubbe! 🕺
Grundrecept: Klipp en ”stav” av tvättsvampen (lagom lång för mikrofonkontrollen). Klipp bort den vita (eller gröna) riviga sidan.
Tanke nr 1 – enklast möjliga
Enklaste möjliga – trä skumgummit över sladdens smalaste ände; hur svårt kan det va? Hur: Göra hål med en grillpinne, för att trä in plugg-änden på headsetet; funkade delvis, var tvungen att köra in saxspetsen för att göra hålet större. Problem: mikrofonen sitter högt upp och nu är både höger och vänster sladd i skumgummit, jag kan därför inte ha båda lurarna i öronen. Funkar om man bara ska använda ena luren, annars inte så praktiskt Kreativitet: Njae Resultat: 2/5 det funkar, men inte bra nog – jag vill använda båda lurarna.
Tanke nr 2 – en spiral
Gör en spiral av skumgummit så att man inte behöver trä igenom hörluren; verkade mycket lovande och blev ganska snyggt Hur: vrid skumgummit i en spiral, ca 1-2 varv, pressa ihop från kortsidorna, klipp (eller skär) till mitten (och vips har du klippt en spiral!). Problem: skumgummispiralen ”sluter” inte helt runt mikrofonen och det finns risk att det halkar av. (det går nog att få till om man har bra verktyg, typ skalpell och värme kanske, för att gröpa ur ”innanmätet” och ge plats åt mikrofon och sladd). Kreativitet: Ja Resultat: 2/5 det funkar, åtminstone en stund och kan vara ok om man sitter still, men inte bra nog – jag vill promenera och röra mig.
Tanke nr 3 – typ som nr 1
Återgå till tanke nr 1, men göra hålet stort nog för att trä igenom hörluren (det är knappt att radien på skumgummit räcker runt). Efter ett par misslyckanden (tänjt för mycket och rivit upp skumgummit på sidan) fick jag till det. Hur: Gör hål med grillpinne, utöka hålet med ena saxbladet först, därefter använd saxen för att tänja på hålet; var försiktig så att hålet inte går för nära kanten – trä igenom hörluren där mikrofonen sitter. Problem: det är svårt att trä igenom hörluren och skumgummit kan lätt gå sönder, det är inte så bra i längden om man vill ta av och på skyddet.
Kreativitet: Njae Resultat: 4/5 det funkar helt ok, löser problemet och jag har extra headset så skyddet kan sitta permanent.