Docsity

Understanding Object-Oriented Programming: Concepts, Evolution, and Implementation, Slides of Applications of Computer Sciences

Partial preview of the text

Download Understanding Object-Oriented Programming: Concepts, Evolution, and Implementation and more Slides Applications of Computer Sciences in PDF only on Docsity!

Modelling Objects

Chapters 3 & 10 Overview

Today’s Lesson Plan

  • Discuss labs, quizzes, and TDA topics (30 min)
    • Lackluster discussion/online participation by some
    • Importance of deadlines
    • Finish work on time – don’t fall behind!
  • Class Activities – covers Chapter 3 & 10 (95 min)
    • Visually show how to create UML class and object diagrams (using Visio, dia, etc.) and Java classeswith attributes, behaviours, etc. using an IDE. (25 min)
    • Show visually the syntax and structure of a Java method and discuss how to send messages. (25min)
    • Discuss method overloading and other method characteristics, like passing parameters, returning values, etc.
  • Conduct activities & break (25 min)
    • Create a GUI program that uses event handling methods. (25 min)
  • Coding Exercises (90 min)
    • Code Ex 1 – p 539 – # 10.3.
    • Code Ex 2 – p 540 – # 10.3.8 (a & b)
    • Code Ex 3 – p 560 – # 10.5.5 and 10.5.6 (a & b)
  • Wrap-up (20 min)
    • Review key learning outcomes (10 min)
    • Introduce week’s homework assignment and submission policy (5 min)
    • Introduce online topic for discussion and Threaded Discussion posting expectations (5 min)

Object Oriented Programming…

• Faced with this complexity, software

engineers developed

  • OOP as a new way of organizing code and data

• More programmers are starting to use

Object Oriented Programming (OOP).

Introduction to OOP…

  • OOP promises increased control over the complexity of the software development process.
  • The underlying concepts of OOP are,
    • Data Abstraction with Encapsulation
    • Inheritance
    • Polymorphism

Evolution of OOP Languages

Object Oriented Programming was first discussed in the late 1960’s by those working with the SIMULA language.

SIMULA67 was identified as the first ever OO programming language.

SIMULA67 was developed as an extension of Algol (ALGOrithmetic oriented Language)

Evolution…

  • SIMULA67 gave us the crucial Object oriented concepts of classes, dynamic objects, encapsulation and inheritance.
  • Smalltalk is another OOP Language and environment released in 1980.
  • C++ first version 1983
  • Eiffel in 1988 -not an extension of an existing procedural language syntax

Introduction to Java Contd....

 The language oak was developed by removing undesirable features of C++.

 Those features include:

 Multiple Inheritance  Automatic type conversions  Memory Management.

  • Use of pointers

 By 1994 the World Wide Web Emerged and Oak was Re- named as Java.

The World of Objects

• The World consists of Objects

• Objects are Nouns

• A System of Objects is usually

what we want to simulate or

implement with a program on

a computer

Anything we

can put a

thumb on

Another Example

• Graphical Drawing System

• Allow user to draw shapes and

manipulate them on the screen

• Objects include:

  • Circles
  • Rectangles
  • Lines
  • Polygons
  • Pens

Objects have a State —

Attributes

An attribute is

any

characteristic

of an object

Objects Can be Sent Messages

One object can ask

another object for a

service, by sending

it a message

One object asks

another to use a

particular method

Basic Objects

• Objects are the things in the world (Nouns)

  • Attributes
    • Properties each of those things have
  • Methods
    • Actions that each of those things can do
  • Message
    • Communication from one object to another, asking for a method to be used; the way methods are “triggered”

Let’s Consider Shapes

• Shapes can do things — methods

• Shapes have a state — attributes

  • Attributes of a shape:
    • Filled, line width, line color, fill color, location

• Methods of a shape:

  • Fill, Empty, Move, Grow

Fun with Shapes

Each Shape is an Object

Properties of a shape:

  • filled
  • line width
  • line color
  • fill color
  • locationMethods of a shape:
  • Fill
  • Empty
  • Move
  • Grow