CS 1723-001 Data Structures
Fall 2001 -- Lectures for Week 1
Course Orientation,
The Object-Oriented Approach, and
Initial Example: A List of Numbers
Week's Objectives:
- Go over administrative format of the course.
- Review the basic ideas of object-oriented programming.
- Work on and example (List of numbers) illustrating many
ideas from the course and providing an initial Java review.
Get a chance to fill in code for some of the methods.
- See a non-object-oriented solution to the same problem.
- Get to view the completed code for the methods in item 3 above.
- Administrative format:
- Course web page
Individual,
Uniform.
- Course objectives and how they relate to current technology.
- Prerequisite form
- Students who have taken CS 1713 in a language other than Java:
the course will present special difficulties for you.
- Lecture attendance: You are expected to attend all of the
lectures. An attendance sheet will be placed at the front of the room
each class. Be sure to check your name off, since good attendance can
positively influence borderline grades.
- Recitation mechanics and handouts:
- TA/Presenter format
- Attendance is mandatoroy for credit
- Lab policy statement (must sign)
- Tutors (see lab schedule)
- Where the course fits in the major - CS 1713 / CS 1711 /
CS 2213 as part of a
three-course programming sequence(Intro->Data Structures->Advanced
Programming).
- Object-oriented design (from Kay Robbins):
- An object can be thought of as a server, that is,
something that provides a service.
- Users of the object are clients, that is, they
make use of the services provided.
- Users ask the object to perform services by calling methods.
(These are very similar to the functions of other
programming methodologies. The main difference is that
methods are buried inside the server (the class).)
- In the most general setting, objects don't have to be on the same machine or written in the same language.
- Objects are easier to reuse and incorporate into other programs
than just library functions because they are more self-contained.
- When you write a program in an object-oriented language:
- Typically you have a main object (which is like your main program
in other languages)
- The main object creates (instantiates) objects and calls
their methods.
- The objects themselves have the following parts:
- Field - holds internal object data
- Constructor - the method used to initialize an object when it is created
- Method - action performed by the object (analagous to a function in other languages)
- Accessor method - a method that does not modify the internal state of the object.
- Modifier method - a method that changes the internal state of an object. (Usually we don't want to directly change the contents
of a field, but instead use a modifier method.)
(The Weiss book refers to this as a mutator.)
- Extended Example -- A List of Numbers
here.
- Non-Object-Oriented Version of the Same Example
here.
- Complete code for the List class from
item 3 above. (Available starting Friday, 31 Aug 2001.)
here.
Revision date: 2001-08-26.
(Please use ISO
8601, the International Standard.)