Lesson A5
Next: Designing A ClassLesson 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!
The concept of using high level tools to accomplish something without knowing the internal details. This is an important concept in programming that allows programmers to design complex systems that are flexible, re-usable and modular. A mark of effective use of abstraction is when a tool can change its internal workings without having any effect on the systems that use that tool.
Storing data without having to know exactly how the data is stored internally. For example, you can store "Hello World" in a String without having to know how a String stores its data internally. When you make a class that stores data in private fields, you are using data abstraction because a client can use your class to store data without knowing exactly how your class stores it.
Using methods without having to know exactly how they are implemented internally. For example, you can call System.out.println("Hello World") without having to know exactly how it prints to the console. When you add public methods to your classes, you are using procedural abstraction because those methods can then be used without having to know how they work internally.
(e.g. public, private) Keywords defining where a method or attribute can be accessed from.
a.k.a. fields, attributes are data stored within a class.
Definitions of things a class can do. Alternate term: method.
A method with the same name as the class, used during object creation to initialize the starting state of an object.
The practice of hiding data within a class (e.g. using the specifier private for attributes).
Stores the state of an object; while defined in a class, the data they contain belongs to individual objects.
The practice of giving a method multiple definitions (see Lesson 4D).
A watered-down representation of actual code, written by programmers to design and visualize classes and programs.
A pointer to a location in memory, such as one that stores the raw data of a variable.
The idea of starting with bigger, simpler ideas, and working down to details as progress is made.
A location in memory storing some kind of data, named by an identifier.