Maverick by Ricardo Semler

I found out about Ricardo Semler from an IT blog, I don’t remember details, but the gist of it: successful Latin-American IT company follows Ricardo Semler’s approach – corporate democracy. The last bit peaked my curiosity, ultimately driving me to the book and let me say, if you never crossed the path, it is enlightening.

Every company wants to stay lean, competitive and ahead of the curve. There are multiple options to achieve it, however once a company grows, it inevitably gets fat and the ability to maneuver is diminished. Ricardo Semler addresses exactly the point – how to stay lean, agile, profitable in a competitive and turbulent environment.

“To survive in modern times, a company must have an organizational structure that accepts change as its basic premise, let’s tribal customs thrive, and fosters a power that is derived from respect, not rules. In other words, the successful companies will be the ones that put quality of life first. Do this and the rest – quality of product, productivity of workers, profits for all – will follow.“

The book is an easy read, the closest I can compare it to is “The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win”. However Maverick is written from experience in a real company (Semco) and by a real CEO/Chairman (Ricardo Semler) – it is not a novel or a fantasy. The author has a nag for writing, I found the book entertaining to read, among other things. Described ideas, practices and methodologies that are innovative and provocative at least at a time the book was published – 1995. Not all ideas are original (but what’s new under the moon), some came from the land of rising sun, others from elsewhere, however all of them seem to be remixed and modified to fit the unique Brazilian market conditions Semco found itself in. Considering the age of the book, some of the ideas seemed to survive and flourish in fairly modern and big companies, such as Amazon and Netflix. As I was reading the book, I couldn’t help but say to myself: “oh look, Amazon does this…” or “sure sounds like Netflix’s approach”. I don’t know if those companies consciously adapted those ideas or arrived to the same ideas independently.

So it is fair to ask: is the book relevant after so many years? As I mentioned before, some modern companies already adopted some ideas, but not everything the author had to offer. There is more and the reason for more is fairly simple: the author is examining ideas, practices and methods that deal with human organizational conditions and not with any particular technical issue. Humans are slow to change and after decades of technological progress we still do business the good old way.

“The conflict between advanced technology and archaic mentality is, I believe, a major reason why the modern workplace is characterized by dissatisfaction, frustration, inflexibility, and stress. If only minds were as easy to change as machines. I’ll wager that it’s easier to invent a new generation of microchips than get a generation of middle managers to alter the routes they drive to work every day. Technology is transformed overnight; mentality takes generations to alter. Who can blame us for thinking technology will cure all that ails the workplace. It’s so much easier to acquire.”

In a nutshell:
+: Easy & fun read
+: Many great ideas, practices and methodologies
+: Based on real company and written by the CEO/Chairman
+: Great discussions and examples
+/-: Wound be great to have more details but not at the expense of abstract
=: I enjoyed the book. It contains lots of interesting, provocative and as years passed, very applicable ideas. I wish the author provided more details. Even if you have no interest in business, you might have lots of fun reading the book, at least I did.

Title: Maverick: The Success Story Behind the World’s Most Unusual Workplace
Author: Ricardo Semler
Cover:

Mastery

Ah mastery, who doesn’t want to be a master? A rhetorical question, yet an important one.

I’ll come back to the question later, but for now, how is the book? I like it, strange to say from the get-go but yeah… I enjoyed the story, examples & discussions. The book takes mystery of being a genius and breaks it down into concise, foundational sequences of events that each master had to go through in order to climb to the top of their respective field. Each event and a sequence is analyzed by the author and discussed. If you ever wanted a guide on “Mastery”, this might be it.

As I was going through the book, I couldn’t help but ask myself: “well, alright, but who is this book written for?”. Is it a recipe book? I’m not sure, some of the recipes are kinda long – start when you are 5 or 10 year old. Sure, mastery takes long time, you can’t be on the top of a field in just couple of years or by following few “easy” steps. I get it, but it doesn’t answer my question. If you got this book and comprehended it by the age of 17, perhaps you can make it, but for anyone over 30 there aren’t that many recipes in the book. To be fair, the book is fascinating and at any age you should take some ideas out of it, but let’s be real, in order to take full advantage, you should be at the very young age – perhaps you can prepare your children for the journey?

But do you want to be a master? Is it even a conscious choice? I don’t know, but overarching theme seems to be outliers. Those masters have a very different view of the world, some don’t even fit into society. It feels to me that the journey starts with a perceived defect in a person. Something deep inside drives those people forward, some get unlucky and go to live on mountains (figuratively speaking), others get lucky (timing, resources) and lunge forward through many years of hard work but in the end some become dazzling stars of our society, providing example and direction for others to follow.

In a nutshell:
+: Easy & fun read
+: History, analysis, discussions
+: Examples from different eras
+: Useful bits and pieces even if you are not planning on a mastery
-: Is mastery a choice?
=: I don’t know if mastery is a choice, but I can still learn quite a few things from the book. Perhaps if you are young, you should read the book early on. If you have children, perhaps you want to read it as well and set your child on a journey. But perhaps you want to explore minds of the masters for the fun of it, then please enjoy.

Title: Mastery
Author: Robert Greene
Cover:

Springboot test custom client, controllers and/or filters – a quick way

Recently I posted a question to the stackoverflow (please check it out first). Unfortunately I didn’t have time to explain – ‘why?’

Also I don’t think stackoverflow allows lengthy debate in the comment section. So I would like to make a quick explanation and hopefully have a debate in the comments.

Ok, so, why would you want to test service client and associated controller (springboot service) in the same unit test? I believe the case is fairly narrow and following conditions should apply:

  • Microservice must come with an associated client, which is capable of executing all available endpoints (in my case: internal microservice policy)
  • Client is complex!
    • Serialization and deserialization of objects
    • Uniform handling of errors (internal errors)
    • Custom security (internal use)
    • Custom compression
    • Logging
  • Controller is thin (just a delegation to a business layer)
  • Limited/Inflexible build pipeline OR time constraint on unit test execution (let’s say if test takes more than 4-5 seconds)

Now here is a list of ‘usual suspects’ to why NOT test client and controller together:

  • Service and client are separate ‘units’ therefore SRP and/or separation of concerns
  • Client is simple and can be tested separately
  • Controller can be tested separately
  • Fast/flexible build pipeline and/OR no time constraint

I would like to defend my approach:

  • Unit test is very flexible term – I believe developer/business can define what unit actually means. In my case, internal policy states that if I develop new endpoint and/or service I must provide a client, that will comply with company’s internal needs. So a unit of work in this case is client and associated endpoint/s, one can’t exist without the other – therefore one unit.
  • Client is not simple at all. Luckily most of the internal logic is abstracted away, so I can reuse abstraction and focus on immediate things like: path params, path variables, method and payload – which should be tested.
  • Controller in my case is thin one – meaning there isn’t much code there, typically one line – delegation to business layer. So I can test controller separately, but there isn’t much value. The value of the thin controller is in correct delegation and entry point (paths & params specified correctly).
  • Build pipeline is important tool, however if it is slow, constrained and inflexible, it becomes major source of headache (and sometime creativity). If your test brings up service and in process takes up a port and 10-18 seconds to start up, well the test will be ignored/removed in the name of performance – no value in that.

I hope this reasoning (along with stackoverflow solution) will be useful and helpful for those in need. Please share your thoughts.

Thank you!

Is DDD still relevant?

I heard someone mentioning Eric Evans and DDD (Domain Driven Design) a few times and so I decided to see what’s its all about. It took me a while to get through the book, partly because I’m a slow reader, partly because the book is long and partly because the read is dry. As I was working through the book, I often wondered to myself: “is this still relevant?”.

Lots of described techniques are common place in everyday software development, however some of them evolved, for example: Microservice. It represents a bounded-context and due to the nature of a microservice, it is separated and doesn’t share objects or internals. Translators, entities, value objects and aggregates are fairly standard on projects I’ve been in so far. Layered architecture, frameworks, team work, supplier-consumer team relations, managers, refactoring and ivory tower architects are fascinating subjects, but again been there and done that. I’m not a history buff but I do enjoy it and so I find myself smiling reading through some parts, lets not forget the book is almost 20 years old. I did find an answer to one lurking question I had for a while: “why less capable engineers tend to accumulate in a legacy but still important, core software systems?” and let me say, Eric nailed it.

So some techniques might be dated but in my mind still relevant, however all of it is just peripheral stuff. What about the core? What about domain? Well this is where things get muddy for me. As I read through examples and discussions, I understood the value of good design, born in ubiquitous language, with help of business specialists, capable fearless engineers with commitment to deep thinking and forever deepening understanding of a business model. In theory DDD is the best thing that can ever happen on a project, however in reality (and by some degree of the author’s own admissions and disclaimers), DDD is not always the best choice or even a possibility. In my mind too many things must align in order for DDD to happen and bare fruit. In any system with many moving parts, there are things that can and typically will go wrong, especially when we are talking about creative work and human operated system.

But is the book still relevant? I think so, I would not be putting it on the top of “must read before programming”, but it still be on the list. I’m sure that commitment to deep thinking and modelling will not be going away any time soon. On top of it, perhaps as an industry we are no long bounded by monolith, but bounded-context is here to stay in one form or another.

In a nutshell:
-: long, dry read
-/+: relevance of some ideas in present software development
+: methodology to design and implementation
+: covers lots of aspects of system development
+: plenty of discussions
=: the book is good, I think people aspiring to be or current architects will reap lots of benefits. Few things feel dated but lots is still very much applicable and valuable. There are lots of books and materials that hold (IMHO) more value for developers in early and middle stages of learning the craft. But at some point Domain Driven Design should be considered.

Title: Domain-Driven Design: Tackling Complexity in the Heart of Software
Author: Eric Evans
Cover:

Domain-Driven Design by Evans Eric

I took few notes during the read: