Stage 2 (w/s 8-11-15)


stage2

As well as the more basic master branch of the repository, you will also find there is an improved stage 2 branch posted to Github. This has improvements to the solution including:

  • using ObservableCollection<> instead of ArrayList of Animals
  • using ItemsSource to tie the items displayed in the Listbox to a particular collection
  • employing RadioButtons to allow filtering of the collection of Animals by sex
  • using RadioButtons and GroupBox in XAML

These changes make for a more robust and scalable solution to the problem. Using branches is common practice to gather together enhancements or fixes to a repository. In this instance:

  • the master branch has a simple array-based solution to the problem
  • the improved branch has a better approach introducing the items listed above

To get a copy of the master branch, you can git clone as before and a full copy is cloned to your computer. To switch to another branch, you need to issue a couple further commands. Here’s a ‘video’ of how to do it:

And here are the commands you just saw:

git clone https://github.com/itsligo/sample_repo.git;
# above clones **sample_repo** into new folder called **sample_repo** 
# ... and sets to **master** branch
git checkout improved
# above changes focus to the **improved** swapping out files 
#  ... for those of the other branch (improved)

Alternatively, you can use the zip file download. To get a zip of the master branch ensure you’re looking at the master branch and click the Download Zip button as follows:

dl branch