A day of deliberate practice and learning.
📆 Saturday, 2022-11-05
☑️ Mandatory registration
🧩 More details next slide
Looking forward to seeing you soon!
The Vienna software crafting community invites you to participate in our local event for the Global Day of Coderetreat.
On this day, we come together to learn from each other, practice pair programming & test-driven development and focus on design aspects related to decoupling.
If that sounds interesting to you, we are thrilled to have you join us!
Welcome to a day of deliberate practice and learning!
🛒🧾🛍️ 💡🤝🤓 🪢✂️🧵
Spricht jemand nur Deutsch? Bitte melden.
Does anyone speak only English? Please report.
Thank you very much for hosting us!
Who wants to join dinner?
Please raise your hand.
Please raise your hand.
A day of deliberate practice and learning.
Practice - reflect - improve! 🥳
Time | Topic |
---|---|
08:20 | Arrival & Breakfast |
09:00 | Welcome at Nagarro |
09:10 | Intro Coderetreat 👈 |
Session 1 by Peter Kofler | |
Session 2 by Patrick Scheibert & Katrin Heiderer | |
Session 3 by Adam Zielinski | |
13:10 | Lunch Break |
Session 4 by Claus Aichinger | |
Session 5 by Roland Germ | |
Final Retrospective | |
17:00 | Closing |
Facilitators in order of appearance.
Let’s get to know each other:
Form groups of three (with people you don’t know).
Be mindful of your peers.
Be respectful.
For a collection of items in the shopping cart
More about the assignment in the first session.
Roles:
Procedure:
Improve code but don’t change behavior
Don’t break interfaces
If you write new code, write a test first
If you change code, is it covered by tests?
What is design?
Why does it matter?
Today’s practice: strategies to decouple design!
Revisit same problem repeatedly
Try different strategies to improve design
Focus: Familiarize yourself with the problem.
Facilitator: Peter Kofler @codecopkofler
Before we start coding, let’s think:
Only work on requirements listed above!
And be back in time.
Focus: Familiarize yourself with the code (and face reality).
Facilitator: Patrick Scheibert, Katrin Heiderer
The code is there, we want to improve it.
Each method cannot contain statements that require more than one level of indentation (conditional statements, loops, etc)
Limit the number of statements permitted for a function to 5 lines.
Which refactorings did you do?
Which class or method names did you change?
What was your experience in the pairs with different languages?
And be back in time.
Focus: Separation of concerns
Facilitator: Adam Zielinski @adam0x5A
“the only available technique for effective ordering of one’s thoughts, that I know of” (Dijkstra, 1974)
Reduce complex problems into a series of manageable layers and components.
More degrees of freedom (to introduce changes, reuse, deployment, …)
Reduce Coupling: Separate things that are different into separate classes.
Coupling is measured by the number of relations between the classes. That is, the coupling increases as the number of calls between classes increase or the amount of shared data is large.
Improve Cohesion: Put things that do the same thing together.
Functional, Sequential, Communicational, Procedural, Temporal, Logical, …
Identify “who is responsible for what?”
Hints:
Teller
and ShoppingCart
.ReceiptPrinter
? (“only talk to friends”)for navigation and refactoring
Visualize the coupling (e.g. Control / Data Coupling)
Focus: Improve class design by applying principles
Facilitator: Claus Aichinger @clausaichinger
Feature requests:
Yes, decouplings sounds good. But… 🤔
How? 🤷
I’m not a great programmer; I’m just a good programmer with great habits.
Kent Beck in Refactoring: Improving the Design of Existing Code
Apply so called SOLID principles:
The Single Responsibility Principle (SRP)
A class should have one, and only one, reason to change.
or
A module [class] should be responsible to one, and only one, actor.
The Open Closed Principle (OCP)
You should be able to extend a classes behavior, without modifying it.
The Liskov Substitution Principle (LSP)
Derived classes must be substitutable for their base classes.
The Interface Segregation Principle (ISP)
Make fine grained interfaces that are client specific.
The Dependency Inversion Principle (DIP)
Depend on abstractions, not on concretions.
For example:
And pave the way for new features…
ShoppingCart
Relates to previous session.
ShoppingCart.handleOffers()
Relates to feature request.
SupermarketCatalog
Relates to feature request.
ReceiptPrinter
Relates to feature request.
And be back in time.
Focus: Separating a Domain into Bounded Contexts
Facilitator: Roland Germ @rolgerm
The Product is somehow a shared model. But in future the Product could be enhanced and each domain needs its own view or selected data of a Product.
A day of deliberate practice and learning!
🛒🧾🛍️ 💡🤝🤓 🪢✂️🧵 🥳
Thank you for joining! Your feedback is greatly appreciated.
Global Day of Codereatreat 2022 by Softwerkskammer Wien at Nagarro