Tino APCS

Designing and Using Classes

Lesson Overview: This lesson discusses how to design your own classes. This can be the most challenging part of programming. A truly good design can be the difference between hundreds of hours working with complex code and two hours working in an elegant system. A well thought out design can make the programming portion far easier. In fact, for many professional projects, more time is spent designing programs than actually typing in code. Imagine a million lines of code in a project with a design flaw. Redesigning that much code could be horrendous!

Lesson Vocab
ACCESS SPECIFIER

(e.g. public, private) Keywords defining where a method or attribute can be accessed from.

ATTRIBUTES

a.k.a. fields, attributes are data stored within a class.

BEHAVIORS

Definitions of things a class can do. Alternate term: method.

CONSTRUCTOR

A method with the same name as the class, used during object creation to initialize the starting state of an object.

ENCAPSULATION

The practice of hiding data within a class (e.g. using the specifier private for attributes).

INSTANCE VARIABLE

Stores the state of an object; while defined in a class, the data they contain belongs to individual objects.

OVERLOADING

The practice of giving a method multiple definitions (see Lesson 4D).

PSEUDOCODE

A watered-down representation of actual code, written by programmers to design and visualize classes and programs.

REFERENCE

A pointer to a location in memory, such as one that stores the raw data of a variable.

TOP-DOWN DESIGN

The idea of starting with bigger, simpler ideas, and working down to details as progress is made.

VARIABLE

A location in memory storing some kind of data, named by an identifier.