Object-Oriented Programming

Vertical Development

Michael L. Collard, Ph.D.

Department of Computer Science, The University of Akron

Workflow

  • When working on a project, you can work horizontally or vertically
  • On most projects, you should work vertically

Terminology

Layer f() g() h()
Function Call if (f()) if (g()) if (h())
Function Declaration bool f(); bool g(); bool h();
Function Definition bool f() {} bool g() {} bool h() {}

Horizontal Workflow

  1. Write the function declarations for multiple functions in xml_parser.hpp
  2. Commit to the repository
  3. Write the function definitions for those functions in xml_parser.cpp
  4. Commit to the repository
  5. Replace the code in srcfacts.cpp to call these new functions
  6. Commit to the repository

Horizontal Commits

  • Must be done in this order
  • Must know the complete list of functions to move before the start

Horizontal Workflow Disadvantages

  • There are no results (i.e., improvements in the file srcfacts.cpp) until we are all done
  • We do not learn as we go and often have to rewrite what we have done
  • Can only report progress at the very end

Vertical Workflow

  1. Write a function declaration for a single function in xml_parser.hpp
  2. Write the function definition for that function in xml_parser.cpp
  3. Call the new function in srcfacts.cpp
  4. Remove the old code in srcfacts.cpp
  5. Commit to the repository

Vertical Commits

  • Complete one function at a time
  • Can be in any order

Vertical Workflow Advantages

  • See results almost immediately. Each commit results in an improvement to the design of srcfacts.cpp
  • Learn as we go. As you start extracting functions, you will see whether it will work as you go along
  • Can report progress better. Each commit reflects an improvement in srcfacts.cpp that you can show
  • Can be performed in any order, which can change anytime
  • Scales to any number of functions or whatever the subject of our mass change

Similar Terms

Term Definition Characteristics Similarity
iterative Work in iterations Functionality/Improvement vertical
incremental Work in increments Often in layers horizontal

When to work horizontally

  • Very experienced with the procedure
  • Lots of practice
  • It is much more efficient to do all of something instead of as a separate step
  • Completion time of all horizontal steps is short and within a working session
  • None of these apply to the programming in this class

Summation

  • Work vertically
  • Get one thing done on srcfacts that shows improvement to srcfacts as fast as possible
  • Quit working horizontally