JAL Computing

C++COMProgramming .NET Mac Palm CPP/CLI Hobbies

 

Home
Up
OOP1
OOP2
OOP3
OOP4
OOP5
OOP6
OOP7
OOP8
OOP9
OOP10
OOP11
OOP12
OOP13
OOP14
OOP15
OOP16
OOP17
OOP18
OOP19
OOP20
OOP21
OOP22
OOP23
OOP24
OOP25
OOP26
OOP27
OOP28
OOP29
OOP30
OOP31
OOP32
OOP33
OOP34
OOP35
OOP36
OOP37
OOP38
OOP39
OOP40

A Twisted Look at Object Oriented Programming in C#

By Jeff Louie
Updated 08.13.2008
bulletChapter 1 “Classes, Objects, and Properties”
bulletChapter 2 "Where Is My Inheritance?"
bulletChapter 3 "Model--View/Controller"
bulletChapter 4 "Static Methods, Factories & Constructors"
bulletChapter 5 "C++ and Java Gumption Traps" 
bulletChapter 6 "Objects Have Class, References Have Type" 
bulletChapter 7 "To Inherit or Contain? That is the Question." 
bulletChapter 8 "Shadow Fields, Override Virtual Methods"
bulletChapter 9 "Interfaces"
bulletChapter 10 "Indirection and Loose Coupling"
bulletChapter 11 "User Defined Structures"
bulletChapter 12 "Unified Modeling Language"
bulletChapter 13 "Dynamic Loading and Reflection"
bulletChapter 14 "Exceptions and Exception Handling"
bulletChapter 15 "Using IComparer"
bulletChapter 16 "Designing Interfaces"
bulletChapter 17 "Designing Extendable Classes"
bulletChapter 18 "Dynamic Class Factories"
bulletChapter 19 "An Object Oriented Draw Program"
bulletChapter 20 "Loading a Class By Name"
bulletChapter 21 "Just Print It!"
bulletChapter 22 "Version Safe Object Serialization"
bulletChapter 23 "Backward Compatiblity"
bulletChapter 24 "A Windows Form Print Framework"
bulletChapter 25 "Multi-Threaded Programming"
bulletChapter 26 "RAII In C#"
bulletChapter 27 "Simulated Multiple Inheritance Using "PlugIns"
bulletChapter 28 "A Disposable Class"
bulletChapter 29 "A Determined Collection Using Generics"
bulletChapter 30 "Exceptional Construction"
bulletChapter 31 "C# Windows Form model-Controler-view with Events"
bulletChapter 32 "Add the IViewable  and IViewableEvents Interface"
bulletChapter 33 "Multiple Controllers"
bulletChapter 34 "A Refactored Calculator"
bulletChapter 35 "A More Efficient Class Factory"
bulletChapter 36 "Try, out"
bulletChapter 37 "Polymorphism"
bulletChapter 38 ""Type Safe Unit Libraries, A Temperature Class"
bulletChapter 39 "Unit Testing"
bulletChapter 40 "Subclassing a Singleton"

You can download the 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: [email protected]). 

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, 2004, 2005, 2006, 2007, 2008

 
Send mail to [email protected] with questions or comments about this web site. Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 © 
Last modified: 08/04/09
Hosted by www.Geocities.ws

1