... | ... | @@ -10,9 +10,12 @@ In order to work with TeeTime you need to make sure it is added to your project. |
|
|
|
|
|
### Segregate 'dat Logic
|
|
|
|
|
|
The Pipe&Filter architecture is well known for its capability to divide work into disjoint steps.
|
|
|
The Pipe&Filter architecture is well known for its property to divide work into disjoint steps.
|
|
|
As - for example - a car manufacturer which divides the assembly of a new car into different steps to increase efficiency and throughput, we will also follow this guideline in our work with TeeTime.
|
|
|
As a first step, we need to find out which steps are run by a "File Counter". // Can be expressed in a better way
|
|
|
So the first step is to analyze our program and divide it into different steps.
|
|
|
|
|
|
|
|
|
The steps of our "File Counter" can be summarised to:
|
|
|
|
|
|
|
|
|
At first, we look recursively for all nested directories, read each directory and pass all containing files one by one to the next processing step.
|
... | ... | @@ -21,12 +24,11 @@ The last stage will save or print the resulting number. |
|
|
|
|
|
|
|
|
Our mission is to implement those four stages as separate filter and connect them.
|
|
|
In the following we will learn how to implement a stage.
|
|
|
|
|
|
### Implement them Stages
|
|
|
|
|
|
This section will explain the implementation of those exact stages.
|
|
|
If you want to dig deeper into the implementation mechanisms of the TeeTime framework, we recommend to take a look at [INSERT LINK](#).
|
|
|
This section will explain the implementation of the stages we need for our "File Counter".
|
|
|
If you want to dig deeper into the implementation mechanisms of the TeeTime framework, we recommend to take a look at [this tutorial](Writing-your-own-Stage).
|
|
|
|
|
|
Our first stage will be the ```DirReader```. It visits all directories and sends all containing files to the next stage.
|
|
|
This is a perfect task to start working with TeeTime: implement this logic into a single stage.
|
... | ... | |