Monthly Archives: April 2014

Cache Project

The last project for my Computer Science 220 class at the University of Mary Washington was one that kept me on my toes. I created a project in C++ that used two classes, one to implement a list type variable and one to implement a web page type variable, in order to make and continuously update a cache that stored information on web pages. The list type class wasn’t too bad to code. I just had to create a type that could implement a list and had methods that would add to, sort, remove from, and search through the list. The web page type class was a little more difficult to create only because it took me a while to figure out which methods to write for it. I also had to decide which methods to use operator overriding for, which was definitely a learning experience. However, my main problem was figuring out how to combine two different classes into one main program, my cache. I believe the only thing that helped me not get too confused during this part was the fact that I actually knew what a cache was at the beginning of the project so I at least knew what the main program needed to accomplish and what it needed to do in order to accomplish its goal.

While completing this project I took it one piece at a time. The first element I worked on was completing the list type class I coded. I had to create both a header and an implementation file for the list type class. Once I finished that part I worked on the web page type class. I also had to create both a header and an implementation file for this class. The hardest parts of using classes in programs is having to make sure everything matches in each file and not being able to test anything until you create all of the necessary files for the program. However, once I finished both of my classes I worked on the makefile I needed to compile all of my files together so I can run them in jGRASP. I then moved on to coding the main program. This file was tricky because I first worked on the menu of options for my cache and then moved on to coding each menu option. Once I started each menu option I had to figure out which method to call from which class using which variable. This part got kind of confusing but I figured it out one step at a time. This project taught me to break up projects into parts because if I try to just think about everything all at once I will end up getting confused and having trouble figuring out how to actually code the program correctly.

The code for this project is available at: Project 4 E-portfolio Code