Effective OO Programming


The intention of this course is to help you improve your abilities in programming in object-oriented langauges. You should have a basic knowlege of both C++ and Java coming into this course and this course will extend that to give you more details of how to do things well in those langauges. If you don't feel you have a good basic knowledge of either or both of these languages, you should read up on them before the class begins because I will not spend significant time in class teaching either language.

Basics: CSCI3394-2 for Fall 2007 is being taught by Dr. Mark Lewis. My office is HAS 201K and my office phone is 999-7022. The best way to reach me is via e-mail at mlewis@trinity.edu. The course meets 2:30-5:00 W in HAS 228.

Office Hours - 9:30am-11:30am TR, 1:30pm-5:30pm R, 3:30pm-5:30pm M, or by appointment. I'm in my office a lot so you should free to drop by. If you are coming from lower campus you can always call or write a short e-mail to see if I'm in and available at that time. Monday and Thursday from 3:30-5:30 will be "open lab" times where I will be in the lab to help work you through questions.

Course Description: This course is basically broken into three parts. Those parts are largely disjoint, but the hope is that the students will see the links between them by the end of the semester. The first part will be readings and quizzes on the main texts for the class ("Effective C++" and "Effective Java"). These books are where the class name came from and help to develop your abilities to do the right things at fairly low levels in C++ and Java. The material will be discussed slightly in class as prompted by the students, but failure to read the material outside of class will cause significant problems.

The second part will be lecture on design patterns. There are two optional texts that cover this that students can buy for reference or as supplement if they wish. I will spend the larger part of one hour of each class discussing various design patterns and how they can be used in different software contexts. These patterns are intended to make you more effective in your programming at a high level. They deal more with design and how you fit larger pieces of software together.

The third part of the assignment is the one that will really consume your time as a student in the class, but it is also supposed to turn into something that you do because you want to. I strongly believe that experience is absolutely critical for becoming a capable programmer. You can read about how to do things and we can discuss good approaches, but until you have used them yourself (or done things the wrong way yourself), you won't fully understand. For that reason each student will be participating in the development of a large software project. There will be two projects under development in parallel with roughly half the class working on each one. One will be implemented in C++ and the other in Java. Both will be based roughly on the idea of developing a large scale, algorithmically generated, virtual world. The project itself is described in more detail below.

Roughly half of the class time each week will be devoted to work on the project. During that time students will communicate design information and try to formalize interfaces and the like to make time spent working apart more productive. We will also have times where various members of the class present what they are working on to the rest of the class. This can and will be done for many reasons, but two of them are so that students can explain what they have done when they come up with a strong design and also so that students can request input from the rest of the class on parts of the design that are causing problems.

Schedule

Texts: This course has two required texts and a long list of recommended reading books. The recommended readings vary in intent as described below.

Required texts - "Effective C++" by Meyers and "Effecitve Java" by Bloch. Both of these are absolutely required and they are in the book store.

Design patterns texts - You must buy "Design Patterns" by Gamma, Helm, Johnson, and Vlissides. This is the definitive text on design patterns which means it is complete, but not the most readable source. You could also consider getting or "Head First Design Patterns" by Freeman & Freeman. It is much more readable, but doesn't have quite the same breadth.

Optional Texts - "Design Patterns Explained" by Shalloway and Trott; this is much less inclusive, but readable and it gives practical examples. "More Effective C++" by Meyers; even more suggestions when programming in C++. "Effective STL" by Meyers; yet another book for the C++ user, but covering the details of using the STL.

Reference books - If you are going to be a true computer scientist, your bookshelf needs some good reference books for the languages you typically write in. For C++ the definitive book is "The C++ Programming Language" by Stroustrup (I'd go with the Special Edition). Definitive isn't always easy to read though so you can also look at "C++ in a Nutshell" by Lischner. I haven't yet had the time to read this book, but it looks like it covers the topics well and it also has a quick reference for the libraries which is very helpful for C++. For Java I don't have a standard book that I recommend. The web had many good sources, but if I had to pick one I'd go with "Learning Java" by Niemeyer and Knudsen. I pick that just because I'm partial towards O'Reilly. For Java though when I buy books they are typically more advanced books on different libraries. Make sure whatever you buy is valid for version 5.0 which has some significant changes to the language. The last time that happened was the move from 1.0 to 1.1 around 1996-1997.

Grading: The grading of this class incorporates all three portions in roughly equal parts. I will give daily evaluation of your reading of the "Effective" books and this will count for 36% of your final grade. There will be 13 of these. One will be dropped and they can't be made up. There will be a final exam on the design patterns that will count for another 24% of your grade. The last 40% of your grade will come from your contribution to the project and an oral presentation that you will make on it.

Project Description: As mentioned above, the largest component of this course is a software development project where students will work together on a large-scale, algorithmically generated, dynamically loaded, virtual world. To see what this means we should break it down. By large-scale, I mean that I want something arbitrarily large. Earth sized would work. I don't expect you to actually hand build something the size of the Earth though. In fact, I want to take the human aspect of building this world out as much as possible. That is what is implied by algorithmically generated. The entire world should be able to come from a seed number and algorithms, without any human intervention. You could choose to put in some aspects that are human configurable to make the system more usable, but the real key is algorithmic generation. Algorithmic generation allows the world to be extremely large, but also contain details at small levels. For example, you can have a forest full of trees and if you go to one tree it can have individual leaves on it.

Obviously you can't keep something the size of the Earth down to the level of leaves on trees in memory on any existing computer (algorithmic generation would allow details even smaller than the leaves too). That is where dynamic loading comes in. Only the parts of the world close to where the observer(s) is(are) will have full detail. As you get further away from the observer, the detail that is kept goes down. Again, algorithmic generation plays a major role, but the dynamic loading also imposes some restrictions on the algorithms that are used for generation. When the observer moves, areas that they are moving toward must be "filled in" by the algorithms. In the same vein, regions that the observer is moving away from must be collapsed so they don't continue to consume memory and other resources.

My requirements are that you do all of this with terrain and basic vegetation. Each of you can decide how you want to take it beyond that. There are many options. There will actually be two big groups working on separate implementations of this project. One will be written in C++ and the other will be written in Java. You get to pick which one you want though I'm hoping that the groups will be somewhat close to balanced and if people don't have strong opinions I'll move them to the group with the smaller number of people.

One or two members of each group will have to take charge of graphical rendering of the world. This will need to be done early, and those working on it should probably be able to switch to a second aspect of the project that interests them if they want. You, as developers, can decide on the objectives of your world and what you put into it will reflect this. Different team members might work on static or dynamic aspects of the world. Rivers, cities, geo-political boundaries and the like are mostly static aspects that some people might want to add. Adding animals or people would constitute dynamic elements that could be added in. Obviously people would be connected to things like cities or geo-political aspects. I don't have any strong opinions on what the project turns into as long as it meets the minimum requirements.

You should think about what part of this project might interest you before the beginning of the semester. If you have questions, feel free to come talk to me about them.

More detailed project description

Links and Other Resources:

Survey of City Generation Techniques

Steering Behaviors for Autonomous Characters

Books I have that you can come and look at for this class

Algorithmic Beauty of Plants (in the library)
Infinite Game Universe (two books)
Algorithmic Beauty of Nature
Swarm Intelligence (two books on this topic)
Other books on graphics, gaming, etc.

StatCVS page