Silhouette
Ru | En
Silhouette helps the reader understand complex logic
If you ask me about the most remarkable feature of the DRAKON language, I will say "silhouette." With silhouette, long processes become easy to understand.
Flowcharts in Drakon.Tech have the type primitive by default. The "Silhouette/primitive" button on the toolbox toggles the diagram type between primitive and silhouette.
A silhouette contains several smaller flowcharts that are called "silhouette branches." Each silhouette branch has a header at the top, a body, and one or more Address icons at the bottom. The rightmost branch is the last branch. The last branch has an End icon at the bottom.
The purpose of a silhouette is to divide a large flowchart into manageable chunks.
Flow direction on a silhouette flowchart
The flow starts at the top of the leftmost branch. We go all the way to the bottom to an Address icon. The Address icon points to the next branch to run. We go through all the branches until we reach the End icon on the final branch.
The convention is to arrange the branches so that they follow from left to right.
The silhouette loop
It is possible to connect a path from a Question or a Case icon to an additional Address icon, thus grounding the flow on the "floor" of the silhouette. This way, a silhouette branch can get more than one Address icon. When an Address icon points to its own branch or a previous branch, we have a silhouette loop. Drakon.Tech marks silhouette loops with triangles to make cycles apparent.
The three questions of the king
One silhouette diagram is more convenient than many disconnected smaller flowcharts. A silhouette breaks up a complex algorithm into logical parts, and yet these parts remain on the same visual scene.
Silhouette diagrams give the reader a quick overview of the algorithm. The layout of a silhouette answers the three questions of the king:
- What is the name of the problem?
- How many parts does the problem have?
- What are the names of the parts?
The Header icon answers the first question. The branch headers answer the two other questions. And the answer comes without delay because the branch headers are always at the top of the diagram, and they are aligned on a horizontal line.