Read time 2 min
The second keynote of this year’s Dev Day takes the crowd back to the roots of object-oriented design.
Gary Bernhardt, who runs Destroy All Software, starts off by introducing the advantages and problems of both popular contemporary design ideas and traditional, object-oriented design principles.
In short: pop cultural ideas, such as testability, readability and elegance, are easy to follow but hard to communicate across observers.
Then again, object-oriented design principles tend to be easy to communicate, but hard to follow. This causes different problems depending on whether the developer externalizes or internalizes the reason for failure. Internalizing the reason for failure easily drives them into a vicious loop of self-blame: “this should work, I’ve been told that SOLID/GRASP is a great idea, so it must be my fault that I don’t see how and why this still fails.”
– If both pop cultural design ideas and traditional design principles cause problems, can we say that there are any fundamental laws to design? Yes, I would say that there are. And we’ve known them since the 70s: think Structured Design, 1974, by Wayne Stevens.
With that, Bernhardt introduces the three most fundamental design ideas. The first one is coupling. The second one is cohesion – that is to say, code should actually represent the idea it names.
– These two go together very nicely: eight letters, start with the letter C. Easy to remember, right? The third one, point of highest abstraction, doesn’t quite fit in…which is why we don’t really talk about it. Point of highest abstraction is about dealing with ideas. In this sense, the word “abstract” means being detached from irrelevant ideas.
Bernhardt applies the three ideas to a couple of current, emerging trends in design: wrap third parties, separate state, separate logic and microservices. It all seems to add up.
– The way to break that loop of self-blame is to always keep the fundamentals in mind: how does the SRP relate to them? Most good design ideas, ideas that stand the test of time, descend from cohesion, coupling and sometimes point of highest abstraction.
Coupling. Cohesion. Point of highest abstraction. Got those? You’re good to go