Lec 06-Modularisation

Lec 06-Modularisation - FIT1002 Computer Programming 2010...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
FIT1002 Computer Programming 2010 Module 6 - Methods www.monash.edu.au FIT1002 Computer Programming Semester 1, 2010 Module 6 – Modularisation COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University pursuant to Part VB of the Copyright Act 1968 (the Act). The material in this communication may be subject to copyright under the Act. Any further reproduction or communication of this material by you may be the subject of copyright protection under the Act. Do not remove this notice. The authors acknowledge that material in these modules has been adapted from slides produced by Lewis, DePasquale and Chase for Java Foundations: Introduction to Programming and Data Structures , Addison-Wesley, 2007 2 Assumed Knowledge Before the beginning of this lecture, students should be familiar with: – The key concepts of sequence, decision, and repetition control structures. – Declaring and using variables • Before the beginning of this lecture, students should have read over: – Notes in the Study Guide for Module 6 3 3 Objectives On completion of this session you should have a conceptual understanding of: • methods as groupings of statements • scope of local variables On completion of this session you should be able to: • use methods to decompose a large program into smaller modules; • call methods, to cause their statements to be performed; • declare and use local variables in methods.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
FIT1002 Computer Programming 2010 Module 6 - Methods 4 Modularisation • Real programs commonly thousands of lines long (or more) – Imagine trying to understand the code – Imagine trying to find where a bug was 5 Modularisation (cont.) •A module is any unit which is both small enough and large enough to be useful and self-contained • Breaking a program into smaller modules is called modularisation • Two levels: – Methods (this lecture) – Classes and objects (later lectures) 6 Method • In Java, a method is a group of code statements which are given a name – Intended to achieve some specific goal or task in the program – Can be used in various places in your program – Allows for a form of abstraction
Background image of page 2
FIT1002 Computer Programming 2010 Module 6 - Methods 7 Abstraction • Abstraction is: – the process of “identifying essential characteristics of a thing … and omitting details that are unimportant from a certain viewpoint” (J. Rumbaugh, et al.) – “The process of ignoring details irrelevant to the problem at hand and emphasizing essential ones. To abstract is to disregard certain differentiating details”
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 10

Lec 06-Modularisation - FIT1002 Computer Programming 2010...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online