This is a teaching material about object-oriented programming, illustrated with use of the programming language C#. The initial version was written i 2006.

It is assumed, as a prerequisite, that the readers have some knowledge about imperative programming, preferably knowledge about C. I believe that it is best to learn object-oriented programming after having learned and worked with imperative programming. Thus, we adhere to an "object later approach".

The starting point of of this teaching material is a number of slides. The slides are annotated with explanations and additional resources. The most comprehensive version of the material has the form of a traditional textbook. You can think of the textbook as grown on top of the slide material.

Almost all programs in this material have been developed together with the material. However, a few programs come from other sources. If the programs are not original, the source programmers are mentioned and acknowledged in an initial comment line of the program.

The current version of the material is complete up to (and including) the last chapter in lecture about Contracts (chapter 53). The final chapters - corresponding to the lectures about test and documentation - only contain slide material.

The teaching material is an online material represented in HTML. A PDF version of the textbook is also available. In order to limit the size of the PDF files some less important programs have been left out from the PDF edition. In the web edition (in HTML files) the full content is available.

We have used colors to emphasize aspects of the source programs in this material. It is therefore recommeded that you read the material from a color medium.

We would like to point out a couple of qualities of the web edition of the material. First, we have provided for extensive cross linking of the material. Whenever relevant, we have provided links from one part of the material to another. We have also provided a comprehensive subject index. Finally, there are separate indexes of source programs and exercises. The source program index provides links to complete, textual versions of the C# programs of the material, ready for you to compile and use.

In the spring of 2008 the material has been used in a course where the students have a background in imperative Visual Basic programming. We have therefore added a chapter that compares the fundamental (non-objected) parts of Visual Basic with the similar parts of C#. The chapter about Visual Basic is only available in the web-version.

Prior to the fall semester of 2008, selected aspects of C# 3.0 have been included in the material. This includes automatic properties, object initializers, extension methods, and lambda expressions.

The January 2009 edition includes a number of bug-fixes (as collected during the fall of 2008) and some new exercises targeted at the Aalborg University OOPA spring course 2009 at the BAIT education.

The February 2010 edition is a minor revision compared with the August 2009 edition. The February 2010 edition is the last, and final, version of the teaching material.

Kurt NÝrmark
Department of Computer Science
Alborg University
February 5, 2010