7.6.17
Clean Code
Development

Flow design in practice

What is flow design?

Flow Design is a design method for software, which means that no object designs are known and only functional units are integrated. This is followed by implementation, in which the design is translated into a language (e.g. C#) using Flow Design.

Flow Design operates via data flow diagrams. Problems that arise are subdivided according to the divide and conquer principle and divided into sub-problems until simple functional units are created to solve them. Due to the graphical presentation, Flow Design offers an opportunity to design software together as a team and forces developers to formulate their ideas in the form of data flow drawings.

The functional units in flow design can be divided into two different tasks. In this case, the units can either execute logic or integrate several methods without, however, executing logic themselves. It should be noted that the functional units can only perform one of the two tasks at a time.

What is the logic here now?

Logic is code that creates behavior. That is, code that brings about changes in states. For this purpose, the following constructs are used to define logic: Expressions, as they convert values from input to output values, API calls and control statements such as if-then-else, for, while, etc. Logic in the context of flow design is created through branches in the program flow, loops and value assignments.

Integration methods, on the other hand, simply call other methods that execute logic or integrate methods themselves. During integration, methods are called in a specific order and thus manage the data flow.

Flow design in practice

The task

In the Coding Dojo, we edited a kata from the Clean Code Developer School. Function katas mean small tasks. The problem of katas is an algorithm, the solution in turn consists of a function. In addition, any refactorings must be considered (see Clean Code Developer School). The aim of the Coding Dojo is to observe and internalize the principles and practices of the CCD during development.

The specific task at our coding dojo was as follows:

Write a function that translates Roman numerals [1] into decimals.

examples:

“I” —> 1

“II” —> 2

“IV” —> 4

“V” —> 5

“IX” —> 9

“XLII” —> 42

“XCIX” —> 99

“MMXIII” —> 2013

The Roman numerals range from “I” to “MMM”.

Römische Ziffer I V X L C D M
Wert 1 5 10 50 100 500 1000

Assume that the Roman numerals are correct.

The approach

At the beginning of the task, you have one or the other idea of how to approach this problem and which solutions need to be tackled. However, as a first step, you should ask yourself the following questions:

  • How do I ensure that everyone on my development team has the same idea of how to implement the problem?
  • What do I have to consider before development?
  • What can cause problems here?

Flow Design is about modeling the solution to a problem itself and not about how it should be implemented technically. It is independent of a specific programming language, which is why no keywords or specific data types are used in the notation. If you consistently implement flow design and separate integration methods from operations, the IOSP (Integration Operation Segregation Principle) is automatically met.

The implementation

What exactly was the challenge of setting the task? It is about converting Roman numerals into decimals. In the flow, we have declared the method “int fromRomanNumerals (string romanNumber)” for this. At this level, the problem resulted in the 3 points “Translating Roman numerals into decimal digits”, “Signing selected digits” and “summing the digits”, which were implemented in appropriate methods. As is usual in a team, disagreements and different solutions or ideas arise again and again. Therefore, where necessary, the methods were designed and discussed again in detail.

Flow Design - Conclusion

Flow design is a very good tool for a team to develop a common understanding of a problem and to derive tasks from it. These can then be processed in parallel by the team. By consistently implementing the IOSP principle, you have methods that are easy to test by design. In this way, the implementation can also be implemented according to TDD (Test Driven Development).


About the author:

Julian is a software developer specialized in web and .net technologies. In order to actually develop Clean Code, communication with the entire team is particularly important to him, in addition to purely technical decisions. Clean Code Development is a team sport for him and cannot be mastered alone.

No items found.

Weitere Artikel

Clean Code
7.9.21

Clean Code Development: The values

The value system of Clean Code Development comprises the values of evolvability, correctness, production efficiency and continuous improvement.

Clean Code
9.9.21

Clean Code Development: The Grades

Clean code development is divided into different grades, which you as a developer climb one by one and repeat in an eternal cycle

Clean Code
9.9.21

Clean Code Development: The Virtues

To become a Clean Code Developer, you need to internalize a number of virtues: Appreciate variation, only do the bare minimum, isolate aspects etc.

Clean Code
Development
Digitization
30.11.22

Sustainable software development: What is meant by it and how to develop sustainably

How to develop software that can be flexibly and adapted to new market and customer requirements in the long term

How can we advise you?
telephone
Online consultation
Contact request
telephone
We are looking forward to your call
+49 (0) 721-619096-0
+49 (0) 721-619096-19
Available for you from
Monday to Friday 8:00 a.m. to 4:00 p.m.
Online consultation
Book an appointment that's right for you online
We are looking forward to your message
If you would like to know which data we process and how long we store it, you can find further information in our Privacy statement.
Thank you so much! We have received your contact request!
Oh no! Something went wrong. Please try again!
contact