Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture #4 Agenda Cell phones off & name signs out Review Questions? Objects The birds-and-the-bees talk.

Similar presentations


Presentation on theme: "Lecture #4 Agenda Cell phones off & name signs out Review Questions? Objects The birds-and-the-bees talk."— Presentation transcript:

1 Lecture #4 Agenda Cell phones off & name signs out Review Questions? Objects The birds-and-the-bees talk

2 Review Software development is an iterative and incremental process. OO software systems are systems of interacting objects. Objects have –properties (think of the counting object last class) –Behaviors (think of the “jumping jack” object)

3 How do we create objects? –new chapter1.Terrarium() –There are three parts to this expression: new chapter1.Terrarium ()

4 Let’s try it! We use a tool called Eclipse… …and a plug-in for Eclipse called DrJava DrJava provides an interactions pane

5 Where do objects come from? (The “birds and bees” lecture) Programmer writes a program in a high-level language like Java: chapter1.Terrarium.java Computers don’t understand programs expressed in high-level languages  ?

6 Compilation Programmer writes a program in a high-level language like Java: chapter1.Terrarium.java A compiler translates program to an equivalent low-level form that a computer can understand chapter1.Terrarium.class Compiler translates

7 Runtime Compiler translates Runtime refers to the time during which a program is executing, or running.

8 Objects exist only at runtime Compiler translates Objects exist only at runtime Objects do not exist while the programmer writes the program, except in their minds.

9 Huh? If objects are the basic building blocks of object-oriented programs, and programmers don’t directly manipulate objects, what do programmers write? They write class definitions. Objects are instances of classes. Classes are instantiated only at runtime.

10 So what are class definitions? A class definition is a description of the properties and behaviors that instances of the class will have. Recall that we said a running OO program is a system of interacting objects. Possible relationships between objects are determined by relationships between classes.

11 UML class diagrams (1) UML = Unified Modeling Language We use only class diagrams, not other UML diagrams Purpose: –keep OO concepts separate from implementation language –operate at a more abstract level than programming language, to avoid making implementation decisions when designing code


Download ppt "Lecture #4 Agenda Cell phones off & name signs out Review Questions? Objects The birds-and-the-bees talk."

Similar presentations


Ads by Google