User Tools

Site Tools


operation

Operation

Operations are functions containing only Logic. They do not call any functions from code under the control of their developer. Example:

public IEnumerable<string> Get_lines_in_file(string filename) {
    using (var file = new StreamReader(filename)) {
        while (!file.EndOfStream) {
            var line = file.ReadLine().Trim();
            yield return line;
        }
    }
}

Although technically an operator like ! is a function and ReadLine() or Trim() are functions too, Get_lines_in_file() is an operation because these functions do not belong to the scope of the program. They live outside, their implementation is provided by a third party in a library.

Connecting operations

A single operation won't be able to do all a software needs to do. So there need to be many, many operations. But since operations don't know each other by definition according to the Principle of Mutual Oblivion (PoMO) how can they work together? They are connected to form larger wholes by integrations according to the Integration Operation Segregation Principle (IOSP).

Testing

Automated testing of operations is important. Logic is very hard to get right. Flow-design favours a test-first approach to testing called TDD 2.0.

Testing operations is comparatively easy since they do not call other functions. No test doubles have to be injected.

operation.txt · Last modified: 2018/06/04 13:42 by fdadmin