COMP 310
Spring 2010

Lec11: Source Control and Ball Initializations

Home  Info  Owlspace  Resources

Using Subversion Source Control with the Subclipse Plug-in -- the Basics

What is Source Control?

Source control is a centralized repository for the code and other files associated with a software project.   Source control allows a developer to manage these files in a safe manner, especially when multiple developers are working on the same codebase.   Source control has a number of very useful features, of which these are the basics:

In addition, the source control system may contain or be supplemented by various ancillary functions such as

Two Styles of Source Control:

  1. Commit-and-merge:   In this style, anyone can work on any file at any time, but when they commit the file back to the repository, the system attempts to merge its code with any other changes to the same file that have already been committed.    These sorts of systems are easy to manage but can present some difficult merging issues.   Subversion is a commit-and-merge style source control system.

  2. Check-out/Check-in:   In this style, only one person can work on any given file at a time.   That person checks the file out to work on it, gaining an exclusive lock on that file that prevents other people from modifying it while it is checked out.   When the person is done, they check the file back in, creating a new version and releasing it for modification by other people.   the advantage of this style is that it avoids the potentially messy merge process.   The down side is that it requires greater levels of synchronization between the user's local files and the repository plus excessively long check-out periods by other people can be frustrating.    Microsoft's Team Foundation Server which Visual Studio, is a check-out/check-in style of source control.

A word of advice:

One of the more difficult tasks of source control involves keeping the local files system properly synchronized with the repository.  In such, it is generally very dangerous to manipulate files that are under source control from outside of the source control system, e.g. renaming, moving or deleting files using Windows Explorer.  

Always manage files under source control from inside the source control system, e.g. from within Eclipse+Subclipse.  

Popular Source Control Systems and Ancillary Systems

Using Source Control

 

 

Ball Initialization

 Consider processes such as setting the intial velocity, radius and color of a ball.   Is this a variant or invariant process?  

Strategies may need to initialize their host ("context") ball, doing tasks such as

This all comes down to the addition of another method on the update strategy to initialize the host ball.  There are a few issues to be addressed however:

  1. For dynamically composed, compound strategies, how does one insure that all initializations have been performed?   (Consider the effect on both the MultiStrategy and the SwitcherStrategy.)

  2. Since strategies can be dynamically changed in a ball, e.g. with a Switcher strategy, how does one insure that the ball gets properly re-initialized?   What are the implications on the code of the ball's constructor so as not to duplicate code?

 

 


© 2010 by Stephen Wong