Object Oriented Mobile App Development Exam 2

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/66

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:49 AM on 5/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

67 Terms

1
New cards

Which company pioneered the “personal” computer in the early 1970s?

Xerox

2
New cards

Smalltalk has only two reserved words. What are they?

Self and Super

3
New cards

Smalltalk has three non-class globals. What are they?

true, false, nil

4
New cards

Instead of using commands (reserved words like if-then-else, do, while, for), Smalltalk uses what syntax to handle branching and looping?

Message sending / blocks (closures)

5
New cards

Although Smalltalk is often described as object-oriented, what feature makes it close to a functional paradigm?

Blocks / closures as first-class objects

6
New cards

What is image-based persistence?

The whole system state is saved as an image and resumed later. All coding is done inside the live environment

7
New cards

Modern commercial implementation of Smalltalk?

Cincom VisualWorks

8
New cards

Modern open-source implementation of Smalltalk

Pharo

9
New cards

Describe implementation of not without if-then

Boolean class with two subclasses for True and False that have a not method. The not method for each returns false if true and true if false.

10
New cards

Describe implementation of or without if-then.

False and true each have their own or method. In false or returns what was passed in. in true it returns true.

11
New cards

Describe implementation of and without if-then.

False and true each have their own method. The and method for false returns false. The and method for true returns whatever was passed in.

12
New cards

Alan Kay’s analogy for objects?

Biological cells

13
New cards

Sending a message is ________?

Making a choice

14
New cards

“Do not ask, tell” means?

Tell objects what to do instead of asking for data and deciding externally.

15
New cards

Two general categories defined by a class?

state and behavior

16
New cards

what does it mean that “A subclass expresses a delta”

A subclass represents only the differences from its superclass.

17
New cards

Two steps in sending a message?

1.   Look up the method

2.   Execute the method

18
New cards

When using self/this, where does method lookup start?

In the receiver’s class

19
New cards

When using super, where does method lookup start?

In the superclass

20
New cards

Tests verify that what worked before _____.

Still works

21
New cards

Tests reduce the fear _____.

Of change

22
New cards

A test that is not _______ does not exist!

Automated

23
New cards

A test: In this , this produces this __.

Context, input, output

24
New cards

Three possible outcomes of a test?

Success, Fail, Error

25
New cards

Method run before each test?

setUp

26
New cards

Method run after each test?

tearDown

27
New cards

At a minimum, you should write a test for ___.

Every bug

28
New cards

What is test-driven development?

Write tests before writing implementation code.

29
New cards

Testing like documentation?

Tests show how code should behave.

30
New cards

Testing better than memory because?

Tests are executable and repeatable.

31
New cards

How do tests help software evolve?

They catch regressions during changes.

32
New cards

Design patterns are _________ solutions to design problems.

Reusable

33
New cards

How do design patterns assist communication?

Shared vocabulary among developers

34
New cards

Five elements of a design pattern?

Name, intent, problem description, solution description, consequences

35
New cards

Three categories of design patterns?

Creational, structural, behavioral

36
New cards

What is the template method pattern?

A superclass defines an algorithm structure while subclasses fill in steps/hooks.

37
New cards

Difference between a data structure and an object?

Data structures expose data; objects hold data and behavior.

38
New cards

Presence of if-then-else or switch-case should be examined for replacement with what?

self-send (hook) to be implemented in subclasses

39
New cards

Intent of singleton pattern?

Ensure only one instance exists.

40
New cards

Solution for singleton pattern?

Private constructor + static/shared instance accessor

41
New cards

A composite allows us to compose objects into tree structures to represent what?

Part-whole hierarchies

42
New cards

A composite allows clients to treat _______ objects and _________ objects uniformly.

Individual, composite

43
New cards

Example of composite pattern?

File systems

44
New cards

Example of composite pattern in Flutter?

Widget trees

45
New cards

Advantage of state pattern?

Eliminates large conditionals by delegating behavior to state objects. Each state implements only its operations, and it implements its transitions.

46
New cards

How many concrete classes needed for rock-paper-scissors?

4

47
New cards

What methods implemented in each concrete class?

A vs method, playAgainstRock, playAgainstPaper, and playAgainstScissors

48
New cards

Meaning of the double in double dispatch?

There are two messages passed.

49
New cards

How are conditionals handled?

Through polymorphic method calls instead of if-then-else.

50
New cards

Without explicit initialization, what is in temporary variables in C++?

undefined values

51
New cards

Without explicit initialization in Smalltalk, Python, or Dart?

nil / None / null

52
New cards

If a function can return null, what burden is on clients?

They must check for null.

53
New cards

What is a null object?

An object with neutral/do-nothing behavior replacing null.

54
New cards

What is lazy initialization?

Delaying object creation until first use.

55
New cards

Duration of a variable?

When a variable is deallocated

56
New cards

Scope of a variable?

Where a variable is visible

57
New cards

What should you do instead of placing a literal in a large method?

Instance variable with setter or separate hook methods

58
New cards

What is the flyweight pattern?

Shared object, but also allow for classes to have their own modified version

59
New cards

Using flyweight for Date objects?

Reuse shared Date instances instead of creating duplicates.

60
New cards

What is coupling?

Degree of interdependence between software modules

61
New cards

What is cohesion?

How closely related a class’s responsibilities are

62
New cards

What message sends are preferred by the Law of Demeter?

Sends to:

  • An argument passed to you

  • Instance variables

  • An object you create

  • Self, super, and your class

63
New cards

Who are the clients of a class?

Code/classes that use it

64
New cards

Purpose of inheritance?

Reuse and specialization

65
New cards

In subclassing, classes share ______________ and ___________.

Interface and implementation

66
New cards

In subtyping, classes share ______________ but not ___________.

Interface, implementation

67
New cards

What is duck typing?

If an object behaves correctly, its actual type does not matter (“if it walks like a duck and quacks like a duck, it must be a duck”).