# JAL Computing

|  | ## A Twisted Look at Object Oriented Programming in C# By Jeff Louie Updated 03.25.07
| Chapter 1 “Classes, Objects, and Properties”
| Chapter 2 "Where Is My Inheritance?"
| Chapter 3 "Model--View/Controller"
| Chapter 4 "Static Methods, Factories & Constructors"
| Chapter 5 "C++ and Java Gumption Traps"
| Chapter 6 "Objects Have Class, References Have Type"
| Chapter 7 "To Inherit or Contain? That is the Question."
| Chapter 8 "Shadow Fields, Override Virtual Methods"
| Chapter 9 "Interfaces"
| Chapter 10 "Indirection and Loose Coupling"
| Chapter 11 "User Defined Structures"
| Chapter 12 "Unified Modeling Language"
| Chapter 13 "Dynamic Loading and Reflection"
| Chapter 14 "Exceptions and Exception Handling"
| Chapter 15 "Using IComparer"
| Chapter 16 "Designing Interfaces"
| Chapter 17 "Designing Extendable Classes"
| Chapter 18 "Dynamic Class Factories"
| Chapter 19 "An Object Oriented Draw Program"
| Chapter 20 "Loading a Class By Name"
| Chapter 21 "Just Print It!"
| Chapter 22 "Version Safe Object Serialization"
| Chapter 23 "Backward Compatiblity"
| Chapter 24 "A Windows Form Print Framework"
| Chapter 25 "Multi-Threaded Programming"
| Chapter 26 "RAII In C#"
| Chapter 27 "Simulated Multiple Inheritance Using "PlugIns"
| Chapter 28 "A Disposable Class"
| Chapter 29 "A Determined Collection Using Generics"
| Chapter 30 "Exceptional Construction"
| Chapter 31 "C# Windows Form model-Controler-view with Events"
| Chapter 32 "Add the IViewable and IViewableEvents Interface"
| Chapter 33 "Multiple Controllers"
| Chapter 34 "A Refactored Calculator"
| Chapter 35 "A More Efficient Class Factory"
| Chapter 36 "Try, out"
| Chapter 37 "Polymorphism"
| Chapter 38 "Type Safe Unit Libraries, A Temperature Class"
| Chapter 39 "Unit Testing"
You can download the current tutorial by clicking --> TwistedTutorial.zip The following are zip files containing some of the sample projects from this tutorial. Twisted.zip ObjectOrientedDraw.zip Printing. zip Serialization.zip MCV36.zip Note: Most recently I have decided to add graphical views of the sample classes presented in this tutorial. I have decided to embed these views directly into each chapter and then collectively in Chapter 12. If you find the embedded graphics distracting, my apologies. Hopefully, the graphical views will be helpful to those who learn visually. I must admit that my first exposure to object oriented programming (OOP) was frustrating and difficult. As a hobbyist I have struggled through Z80 assembly and EPROM burners, BASIC, Turbo Pascal, Java, C++ COM and now C#. The move to event driven programming and then to object oriented programming presented major conceptual hurdles to my function driven sequential programming mindset. The “aha” moment when OOP made sense was most gratifying, but did not come quickly or easily. It has been a few years since I “got” the OOP mindset and I feel comfortable enough now to try to help fellow travelers with this journey. If OOP comes easily to you, feel free to skip this tutorial. If you are having problems getting your mind around objects and inheritance I hope this tutorial can help you. This tutorial does not represent a conventional teaching method. It assumes a passing knowledge of the C# language and familiarity with the Visual Studio .NET IDE. This is a work in progress and may require correction or revisions. Comments are actively requested (email: jeff_louie@yahoo.com). ### Useful Texts I highly recommend the following books. Much of my understanding of OOP has been gleamed from these “classic” texts and then reinforced from coding database projects in Java, C++ and C#. At all times I willfully try to avoid plagiarizing these authors, but my understanding of OOP is so closely tied to these texts that I must cite them as sources of knowledge right from the start! Object-Oriented Analysis and Design with Applications Grady Booch, Second Edition, Addison-Wesley, 1994, 589pp. Design Patterns Elements of Reusable Object-Oriented Software Gamma Helm, Johnson and Vlissides, Addison-Wesley, 1994, 395pp. Object-Oriented Software Construction Second Edition Bertrand Meyer, Prentice Hall, 1997, 1254pp. Effective Java Programming Language Guide Joshua Bloch, Addison Wesley, 2001, 252pp. Of course, some of this material is a descendent of my writing from our now out of print book: Visual Café for Java Explorer Database Development Edition Brogden Louie and Tittle, Coriolis, 1998, 595pp. All Rights Reserved Jeff Louie 2002, 2003, 2005, 2005, 2006

##### Send mail to jeff_louie@yahoo.com with questions or comments about this web site. Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007 © Last modified: 11/22/07