FIT1051 Chapter Notes - Chapter 1: Instance Variable, Racing Video Game

73 views3 pages
Week 1
Tuesday, 27 February 2018
9:29 AM
Real Objects and Concepts
Data about the object or concept
Behaviours that makes a change to this data or report on it
Examples:
A car (object) has a speed (data item) that changes if the car's break is applied. (behaviour)
A person (object) has a net worth (data item) which changes in a good way when they get paid
(behaviour) or changes dramatically in a bad way when they take a big OS trip. (behaviour)
A bank account (concept) has a balance (data item) that changes when deposits (behaviour) and
withdrawals (behaviour) are made to and from it.
Software Objects
Software objects represents real world objects or concepts.
Software objects consists of:
Data (one or more) about an object or concept
o Each data corresponds with a variable which is named storage location in the
computer's memory where the data item's value can be stored and retrieved.
Code that operates on that data
o Code is packaged into code containers called methods each of which implements a
behaviour of the software object
A software object doesn't need to implement all the data and behaviour of a real world object or
concept, just that the data and those behaviours sufficient to make it accurately simulate the real
world object or concept in the context of the application it's used in.
Ex. Colour of car may be essential for car data for a racing game, but quite irrelevant for a car
crash simulator.
The process of selecting the essential data and behaviour of an object for a particular application
context is called abstraction.
The current values of all of an objects variables is called the object's state.
When an object's methods execute it results in a change of the object's state or a report on
some part of the state.
Ex. The brake method of a car object should include code that results the value of its
speed variable appropriately.
Object Orientation - Java and Classes
Java is an object orientated language - meaning if offers features that both supports and encourages
Object Oriented Programming. (OOP)
Features: textual structure called a class.
This structure allows data items and the behaviours that change or report on this data to be bundled
together i.e. Allows everything about an object to be bundled together.
It contains:
Variables that hold an object's data
Methods that implement an object's behaviours
Java also allowed variables and methods in a class to be made inaccessible to code outside the class,
meaning it can public or private.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Real objects and concepts: data about the object or concept, behaviours that makes a change to this data or report on it. A car (object) has a speed (data item) that changes if the car"s break is applied. (behaviour) A person (object) has a net worth (data item) which changes in a good way when they get paid (behaviour) or changes dramatically in a bad way when they take a big os trip. (behaviour) A bank account (concept) has a balance (data item) that changes when deposits (behaviour) and withdrawals (behaviour) are made to and from it. Software objects represents real world objects or concepts. Colour of car may be essential for car data for a racing game, but quite irrelevant for a car crash simulator. The process of selecting the essential data and behaviour of an object for a particular application context is called abstraction. The current values of all of an objects variables is called the object"s state.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents