Business Programming
Fall, 2012 Lecture Notes
ISM 6259
©2012 by Dave Small, all rights reserved
This document and its contents may NOT be redistributed NOR posted online (in whole or in part) without Dave Small's specific written permission
-1-
Lecture 01
ISM 6259 — Lectures #1 — 201208.21
©2012 by Dave Small, all rights reserved
Welcome!
Hi, I’m Dave!
Characteristics of Object-Orientation Encapsulation grouping related ideas into a single unit that can be referred to by a single name ° Method (subroutine) encapsulates the steps of a process - saves human memory (chunking) - saves computer memory (don’t need to replicate code) ° Object-oriented encapsulation the packaging of operations and attributes (which represent state) into an object type so that an objects state will be accessed/modified only via the interface provided by the encapsulation.
Information/implementation hiding the use of encapsulation to restrict the visibility of certain information and implementation decision that are internal to the encapsulation structure. ° Methods - hide individual statements - hide local data ° Objects - private methods - instance variables Allows us to separate an abstraction from a(n internal) representation The type used for a method’s return value can differ from the type used to represent the value internally. ° ex: complex numbers - real & imaginary component (e.g., −23.4 + 4i) - rho (magnitude) & theta (angle) ← describe a vector As a ComplexNumber class client (i.e., user), I do not care which technique - 2 (1 / 5) it uses to represent the values internally, only that externally it appears to uses
- rho (magnitude) & theta (angle) ← describe a vector
Lecture 01
As a ComplexNumber class client (i.e., user), I do not care which technique it uses to represent the values internally, only that externally it appears to uses the technique I’m expecting. ° ex: a robot that moves orthogonally on the Cartesian