Professional Documents
Culture Documents
PROGRAMMING I
PROF.
DR.RAFAEL
ADOLFORODRÍGUEZ PUENTE
DIAZ SARDINAS
COMPUTER SCIENCE
COMPUTER SCIENCEDEPARTMENT
DEPARTMENT
UNIVERSITY OFNAMIBIA
UNIVERSITY OF NAMIBIA
ADIAZ@UNAM.NA
RPUENTE@UNAM.NA
Lecture 1: Introduction
Topics
• Course Introduction.
• Brief overview about OOP.
• Conclusions.
Lecture 1: Introduction
Course Introduction
Lecture 1: Introduction
On completing the module students should
be able to:
• What is an algorithm?
• What this is Object Oriented Programming?
• Which is the main concept in OOP?
• What is a data structure and ADT?
• Which are the main authors related to OOP?
Lecture 1: Introduction
Concepts
Lecture 1: Introduction
Concepts
Lecture 1: Introduction
Concepts
Lecture 1: Introduction
ADT specification of stacks
TYPES
– STACK [G]
FUNCTIONS
– push: STACK [G] ´ G ® STACK [G]
– pop: STACK [G] STACK [G]
– top: STACK [G] G
– empty: STACK [G] ® BOOLEAN
Lecture 1: Introduction
ADT specification of stacks
AXIOMS
– For any x: G, s: STACK [G]
– A1 item (push (s, x)) = x
– A2 pop(push (s, x)) = s
– A3 empty (new)
– A4 not empty (push (s, x))
PRECONDITIONS
– pop (s: STACK [G]) require not empty (s)
– top(s: STACK [G]) require not empty (s)
Lecture 1: Introduction
Concepts
Data structure:
• Any method of organising a collection of data
to allow it to be manipulated effectively.
Lecture 1: Introduction
Concepts
Class
• A class is an abstract data type equipped with
a possibly partial implementation.
Lecture 1: Introduction
Concepts
Object:
• Instance of a class
Lecture 1: Introduction
OOP
Lecture 1: Introduction
An overview of OOSE development activities
and their products
problem statement
Requirements
elicitation
Analysis
Year Button
ChangeDate
Month
LCDDisplay
Day
<<Entity>> <<Boundary>>
Year <<Control>> Button
ChangeDate
<<Entitity>>
Month <<Boundary>>
<<Entity>> LCDDisplay
Day
suitable
An assistant helps him. The suitability of the
*Toy depends
game depends on the age of the child. His
toy
price daughter isage
only 3 years old. The assistant
buy()
buy()
like() recommends another type of toy, namely a
boardgame. The customer buy the game and
type ofthe
leaves toystore boardgame
videogame boardgame
Ways to find Objects
• Syntactical investigation with Abbot‘s technique:
– Flow of events in use cases
– Problem statement
Lecture 1: Introduction
QUESTIONS?