Beruflich Dokumente
Kultur Dokumente
Outline
Introduction:
Procedural Programming (Review / Overview)
Ideas and Problems
Object-Oriented Programming (Overview / Comparison)
Members and Methods
Properties
Visibility
Defining Objects: Classes
Console Applications
When to abandon a GUI-based Approach.
Problems:
Weak Coherence: Logical program sub-units not fully modular
Difficult to fully Re-use larger program elements, as a group.
Object-Oriented Programming
Strong Coherence: Objects should be similar to real-world things!
Real-world things appear as logically-related units, with:
Characteristics: Expected appearance
Behaviors: Expected input, output, and functionality
Idea: Let’s compartmentalize! Develop large projects in logical units
Proper behavior of each unit can be tested separately.
Properly working units can then all be added (like ‘snap-together’ blocks)
These logical units can easily be re-used, in later projects!
The Get and Set methods are both accessed via the DOT OPERATOR.
J-Train Ex.: JTrain Speed
J-Train Ex.: Expand and Test
Conclusion / Forward
In this lecture, we introduced Objects:
And discussed Object-Oriented Programming
Members, Methods, Properties, etc
Defining Objects: Classes