A Few New Concepts - Architectonic Mantra, Design Retrospective, Shared Context, Natural Order of Refactoring

Table of Contents

Recently, several named concepts have evolved in my mind, or maybe I just understood them well. Here are a few notes that I consider an alpha draft ;-)

Architectonic Mantra

What happens practically in every project is the drifting of architecture. After several months, few team members can clearly define which operations should be performed by controllers, domain objects, facades, or services. Over time, the responsibilities of these classes get mixed, making it increasingly difficult to develop the system. The only option in this case is the so-called architectonic mantra, a variation on the broken record technique known from communication psychology. It involves continuously reminding the team of the main blocks in the architecture and their responsibilities. I also suggest that teams introduce regular meetings (once a month or once per sprint) called Design Retrospective, where the team:

  • Reminds the architectonic mantra;
  • Analyzes situations where it’s unclear where specific classes, operations, or fields should be located based on recent project activities;
  • Collects cases of architectural drift and creates a “repair program”;
  • Makes decisions about conscious restructuring of the architecture (though this happens less frequently).

Shared Context

This isn’t about design or architectural patterns, but about communication. As Kent Beck once said, “Most problems in projects arise because someone didn’t tell someone else something.” Agile advocates see the source of problems in relay race, or passing work between people. The issue is that when passing products (documentation, code, requirements, etc.) from one person (or group) to another, the context that led to the product creation is often not transferred, mistakenly deemed irrelevant. I assert that it is crucial.

Recently, I was in such a situation. One person conducted a preliminary analysis of requirements and created a basic system model (domain model). We were to analyze this model, but without the context (certain reflections, conclusions, information, micro-decisions) formed in the mind of the person who created it, it was difficult to evaluate its correctness beyond UML correctness. I call such cases a lack of shared context.

We eventually started to jointly analyze project requirements (User Stories) and build the model from scratch together. We arrived at a similar model (with subtle differences), but during the “joint work,” a shared context emerged (i.e., a unified understanding and insights). Shared context enables more accurate decision-making and more effective continuation of work, which is why close collaboration is emphasized heavily in Agile.

One warning: Do not overwhelm anyone with the product of your work, expecting them to understand it well. At the very least, review and explain it with them. Better yet, develop it together. It will save you and them a lot of work, especially avoiding many communication distortions that generate unnecessary work.

Natural Order of Refactoring

This topic warrants a separate article, but here is a brief description.

The concept of systematizing the refactoring process from the lowest level of abstraction to the highest has been crystallizing in my mind—a natural way of evolutionary design development. The idea is to start with the simplest solution, refactoring if needed at various abstraction levels in a certain order. Here’s the hierarchy of transformations (beginning with low-level ones):

  • 0. Transformations (triangulations - if using TDD)
  • 1. Compose method refactoring - breaking a complex method into a series of calls to component methods at the same abstraction level, transforming one block of code into several methods.
  • 2. Extract class, Extract interface, Move method, Move field refactoring based on class responsibility analysis.
  • 3. Refactoring to design patterns - introducing design patterns for variability in projects.
  • 4. Refactoring to architectural patterns - adapting architectural assumptions as required by changing system requirements.

Agile System Modeling Heuristics

How to reach an initial model that allows starting implementation while avoiding basic mistakes of unthought architecture? When and how to plan architecture? Here’s a proposal for an agile “path,” a mix of Scrum/Agile practices, ICONIX, and our BNS experiences:

  1. Define (if not yet done) User Stories/Epics, covering about 80% of the system.
  2. Analyze interactions with external systems for additional requirements.
  3. Determine priorities and what will enter the Release (deployment version).
  4. During User Stories analysis, build the domain model focusing on class names and relationships.
  5. Extract system services (operations) from User Stories, phrasing them in business language.
  6. Determine the complexity of operations.
  7. Choose the architecture direction based on the domain model.
  8. Select complex and risky services for analysis.
  9. Integrate architecture into technology, partition services accordingly.
  10. Analyze 1-2 User Stories (implementation concept) to verify concept assumptions.
  11. Implement selected 1-2 User Stories to verify concepts.
  12. Define the Architectonic Mantra.
  13. Continue incremental project realization.

“Architecture is not about drawings, diagrams, or system connections, but a deep understanding of the domain and context you’re working with. Forget about UML, forget about super-tools supporting your design, engage thinking. Put most of your energy into understanding the domain, which will lead you to appropriate design constructs.”

Consider exploring Domain Driven Design and Lean Architecture concepts.

(Text translated and moved from original old blog automatically by AI. May contain inaccuracies.)

Related Posts

Don't Be Fooled by What Others Say...

Don’t Be Fooled by What Others Say…

A few days ago, as a conscientious citizen concerned about my health, I decided to have some preventive tests to determine my current health status. Initially, I chose a doctor funded by the NFZ (National Health Fund), as I wanted to maximize the value of the 250 PLN the state collects for my healthcare (I won’t delve into discussions on the efficiency of fund management in state institutions). Of course, I had done some research on which tests might make sense at my age, printed a list of potential tests, and presented it to my doctor.

Read More

Perspective of the Other Side

Common Leadership Challenges

While working with leaders, I often encounter a recurring issue—they want someone else to change their behavior. For example:

Read More

The Hacker Way

A few days ago, Paweł Wrzeszcz sent me Erik Meijer’s talk “One Hacker Way” (watch here) from the GOTO Conference in Copenhagen. It is a very provocative talk, which is great. It questions the Scrum method and challenges the status quo in Agile. Given that Scrum is a dominant framework in software development, a critical view is healthy, especially as Agile has become a significant business machine over the past 20 years. When implementing Agile at Scale, core ideas can easily become distorted. (Check out Dave Thomas’ “Agile is Dead” talk here).

Read More