csc210 20110321 Notes

Posted in csc210 by bnmng on 2011 03/21

Lab a week from Wednesday.
Read 16.1 in Dale and read handouts.

Today: Discuss inheritance and program3
Time class
Ballsphere class

Remember all classes need constructors, transformers, observers. Classes also have destructor and iterators.

Inheritance as opposed to composition.
The pen has a ball: composition
A volyball is a ball: inheritance.

Conventional Programming: Data structures are global
OOP: Data structures are in the class.

Difference between composition constructor and inheritance constructor: composition uses the name of the instance of th eincluded class; inheritance uses the class name of hte base class.

The problem for which the keyword “virtual” is the solution usually comes up when a pointer to a base class is defined as an instance of a derived class.

Static Binding: THe formal parameter determines what’s called.
Dynamic Binding: The actual parameter determines what’s called.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: