CompSci 307
Spring 2019
Software Design and Implementation

Using GIT in Teams

When working on a team project, you will need to develop a flow of working that minimizes potential conflict between each person's new code. The easiest way to do this is to give each person on the team their own "personal work space" to make changes and managing how these changes get integrated together. GIT provides branches to manage this kind of work. However, inevitably, conflicts occur where people need to think about how best to resolve distinct changes to the same piece of code.

Getting Started

For this lab exercise, you must work together with someone else in the class.

Experiment with Merge Conflicts

For this part, both students will be making a lot of small simple edits (e.g., in comments or by creating new text files) so it may help to set little "goals" to keep track of what exactly you are trying to accomplish with each set of changes.

Start within the single default master branch and make a series of tracked changes using the standard GIT commands (add and commit):

Once you have the basic idea of how to resolve a conflict, try creating separate branches (one for each person) and make more changes within your shared repository similar to these excellent online tutorials:

After each person is able to merge from their personal branch to master (and back) using the command line, take turns trying to do it again using a Merge Request:

The command line takes place on your local machine, the Merge Requests take place on the Gitlab server, and each offers a different experience with the process of integrating the changes. We think Merge Requests are very useful for adding your changes to the team's code, but understand that it may be less clear for bringing their changes to your branch. Regardless of which technology you use to manage your merges, we suggest this workflow in this course to minimize conflicts and maximize team involvement in the process of creating a combined codebase.

Decomposition: Extract a Class

Before starting the next part, work together within one person's copy of the code to refactor it to use a Bouncer class with the following methods:

You should be able to do most of this simply by moving the existing code to a new class and then calling the new methods in place of the old code with the appropriate parameters.

Before continuing, use the suggested workflow to integrate the new version of the code with the other person's copy of the code.

Working Together, Working Apart

Continue practicing using the suggested workflow to complete the following tasks to get used to OpenJFX by having each person take one set of tasks and integrate the changes after each one is complete.

You may make any changes to the code you think are warranted (functional, organizational, or creating new classes) and feel free to discuss the changes with each other (either for better understanding OpenJFX or to avoid conflicts):

Person 1
  1. Make the bouncer bounce off of all the walls, including the corners
  2. Make two bouncers (with random initial position and velocity) bounce off of all the walls
  3. Make a collection of many bouncers (with random initial position, size, and speed) bounce around
Person 2
  1. Create the bouncer with a random initial position and speed
  2. Create the bouncer with a random initial size
  3. Refactor the code to create a class that can rotate in a given direction and change to a different color when colliding with any Bouncer that would be used to replace both the Grower and Mover rectangles

Resources

Submission

At the end of class, use Gitlab's Merge Request to submit your group's code to the original organization repository (note, there is no discussion file for this lab). Make sure the NetIDs of everyone in the group are in the title of your Merge Request and in comments within the main class.