Monash University · FACULTY OF INFORMATION TECHNOLOGY

FIT9136 Chap.7 Object-Oriented Design

- one subject, every graph, every model, every mark
5 Chapters2-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 8 · FIT9136

Object-Oriented Design

Define class

The course material gives this chapter a concrete anchor: Weeks 8 and 9 progress from class and instance basics to richer object relationships. That class anchor controls how instance is explained and how encapsulation is tested in changed practice.

Object-Oriented Design turns class, instance and encapsulation into executable reasoning.

The chapter's practical target is to place related state and behaviour in classes with valid invariants, so every explanation should connect syntax to program state, control flow and observable output.

Treat class as a precise program object, not a loose label. Identify the value or responsibility of class before execution, then trace what can read it, change it or depend on it.

This makes state changes visible before they become debugging guesses.

Use instance to explain the program's next move. Work through one representative instance input by hand and name the branch, iteration or call that follows. If the instance trace cannot be stated, the code may run by accident rather than by understood design.

Bring in encapsulation as the test of structure.

Compare normal, boundary and invalid inputs for encapsulation; state the expected behaviour first; then use the mismatch between expectation and result to localise the defect.

For the application — place related state and behaviour in classes with valid invariants — write the smallest complete example that exposes the rule.

Explain why the encapsulation result works, what would break it and how the program should signal or recover from that failure.

Trace instance

Before running an example involving class, make a trace table with the important state before and after each operation. Include the value associated with class, the control decision governed by instance and the output or object affected by encapsulation.

The class table turns an unexplained result into a sequence that can be tested one transition at a time.

Test three inputs: an ordinary case, a boundary case and an invalid case. State the expected encapsulation result for each before execution, then compare it with what the program actually does.

A useful test of instance isolates one rule; changing several conditions at once cannot reveal which condition caused the failure.

Practise explaining the solution without reading the code. For fit9136, name the data representation, the control flow, the responsibility of each function or class and the reason the chosen design supports place related state and behaviour in classes with valid invariants.

This encapsulation rehearsal matters when a written test or interview asks why the program works rather than whether it produces one correct output.

A complete response should make the task visible before the detail: identify what must be decided, define the relevant terms, connect the evidence to instance, and use encapsulation to test the result.

The final sentence about encapsulation should answer the question actually asked rather than merely repeat the topic.

The controlling limit is specific: Using a class adds structure only when state and behaviour belong together.

Keep that encapsulation limit beside the worked example, because it separates a careful fit9136 answer from one that sounds confident but claims more than the task or evidence supports.

For revision, retrieve class, instance and encapsulation without notes, explain their relationship aloud, then complete a changed version of the application: place related state and behaviour in classes with valid invariants.

Record the first failed instance reasoning move and repair it before attempting another case.

In this chapter

What this chapter covers

  • 01

    class

  • 02

    instance

  • 03

    encapsulation

  • 04

    Applying class

  • 05

    Limits of instance and encapsulation

Worked example · free

Design a bank account class

Q [4 marks]. AskSia-authored practice. A simple account must prevent a withdrawal larger than its balance. Define the interface.
  • 1Store balance as instance state with a valid initial condition.
  • 1Provide deposit and withdraw methods rather than external balance edits.
  • 1Validate amount and available balance before mutation.
  • 1Return or raise a documented outcome and test two accounts independently.
A cohesive class owns balance validation and mutation, prevents overdraft under the stated rule and keeps each instance's state independent.
Sia tip — Put the invariant beside the state it protects.
Glossary

Key terms

class
Definition of the state and behaviours shared by a category of objects. This chapter uses the concept when students place related state and behaviour in classes with valid invariants. Use this definition when the task is to place related state and behaviour in classes with valid invariants.
instance
Concrete object created from a class with its own state. It helps explain the reasoning required to place related state and behaviour in classes with valid invariants. Use this definition when the task is to place related state and behaviour in classes with valid invariants.
encapsulation
Control of state through a coherent interface rather than arbitrary external mutation. Its limit matters because using a class adds structure only when state and behaviour belong together. Use this definition when the task is to place related state and behaviour in classes with valid invariants.
FAQ

Object-Oriented Design FAQ

What is the main task in Object-Oriented Design?

Place related state and behaviour in classes with valid invariants.

How do class and instance work together?

Use class to establish the object or condition, then use instance to explain how it changes the outcome being analysed.

What must a fit9136 answer qualify here?

Using a class adds structure only when state and behaviour belong together.

How should I revise Object-Oriented Design?

Retrieve class, instance and encapsulation, apply them to a changed case, and correct the first point where the evidence no longer supports the conclusion.

Study strategy

Assessment move

Reconstruct the relationship among class, instance and encapsulation; complete the chapter application without notes; then test the result against this limit: Using a class adds structure only when state and behaviour belong together.

Working through Object-Oriented Design in FIT9136? Sia is AskSia’s AI Information Technology tutor — ask any FIT9136 Object-Oriented Design question and get a clear, step-by-step explanation grounded in how FIT9136 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 69 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your FIT9136 tutor, unlimited, worked the way the exam marks it
The full 2-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
FIT9136 · Introduction to Python Programming - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities
Unlock the full FIT9136 Bible + 69 Monash University subjects
$0.99 Trial