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 vertically or horizontally
  • 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() {}

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
  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 any progress better. Each commit reflects an improvement in srcFacts that you can show.
  • Can be performed in any order, and the order can change at any time.

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.
  • Do not learn as we go, and often have to rewrite what we have done.
  • Can only report progress at the very end.

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
  • 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