OOP Scenarios

icon picker
single class: Person

explore OOP constructs and behaviours
Last edited 158 days ago by System Writer

1 UML with single class: Person

class
properties and data types
encapsulation
access modifiers
methods
constructor
instantiation
object reference variable

UML (view model 1)

OOP concepts to explore

crowdfunding

Conceptual idea represented in UML (OOP)

Can we define expected understanding of foundational OPP concepts for SQA assessment? (core and extended options)
gears

OOP semantic represented in SQARL

Can we describe expected understanding of SQARL code behaviour for SQA assessment? (core and extended options)
google-code

OOP semantic represented in High Level Language and observed runtime behaviour

Can we identify related understanding of HLL code for SQA assessment? (candidates can use preferred language to answer questions)
knowledge-transfer

Symptoms of limitation in understanding for OOP

Can we shortlist the some characteristics of how limitations of candidate understanding manifests in SQA assessment? (What does it look like?)

OOP terms and limitations on understanding: evidence
OOP term
Concept (UML)
SQARL logical design
HLL implementation
evidence of challenge
1
class
representation of an entity in the problem domain
name of class
set of attributes or properties of the entity, data elements
identifies the data type for each attribute
methods or operations applicable to class attribute(s) including constructor, accessor (getter) and mutator (setter)
relationship(s) to other classes
UML is a standardised diagrammatic representation of the Class model
Computational construct for class
01 CLASS Person IS { STRING name, INTEGER age }

02 METHODS

03 END CLASS

// --------

11 DECLARE citizenKane INITIALLY Person("Orson Welles", 51)
properties become instance variables, a value must be available to assign to variables when object is instantiated
operations become callable methods, procedures or functions
can have implicit (as shown here) or explicit constructor (see constructor entry)
the class constructor is called to instantiate an object of the class when a new object is invoked and a pointer reference to the object is stored in a variable
Differences between
2
properties, data types, instance variables
3
encapsulation
Two concepts are involved:
information hiding: properties must be accessed using accessor and mutator methods rather then direct access
data attributes and related operations are bound together and can both be addressed using the object’s reference pointer
The UML typically has a single box for the class including a section for attributes / properties and another for methods / operations to convey the idea of them being part of the same construct
Access modifiers (typically private and public) are indicated in the diagram using - and + respectively. Attributes are normally private (information hiding) and (most) methods are public and present an interactive surface for other classes wishing to interact based on a relationship such as inheritance or association.
4
access modifiers
5
methods
6
constructor
7
instantiation
8
object reference variable
There are no rows in this table
What would a mind-map of these terms look like?
what would the key-term(s) be and why?
how would the terms be linked and why?
Can you rank or cluster the terms in regards how challenging they are for learners to develop a secure understanding? What insight or explanations might there be for the challenges?
FQ (codeHS)
An object is:
a template to make a program
a construct that has a set of property values and associated behaviours
a single block or module of code in a program
a variables with assigned values
classes and objects:
a class specifies the properties and methods of every object that will be made (for that class)
an object specifies the properties and methods of every class that will be made (for that object)
Each class specifies the properties and methods for a single object
Each object can be created from all or only selected properties and methods specified by the class
a class definition will include:
a name
a set of properties
a set of methods
all of the above

code (some of it wonky!)
1. SET person1 TO INTIALLY Person("Andy", "Murray", 35)
2. SEND person1.firstName to DISPLAY
3. SEND Person.firstName TO DISPLAY
4. SET person2 TO INITIALLY person1
5. SET person1 TO PERSON("Jamie", "Murray", 36)
6. SEND person1.getName() TO DISPLAY
7. SEND person2.getName() TO DISPLAY
8. SEND person2 TO DISPLAY
How many classes are there?
How many fields? How many methods?
How many objects has the code created?
Describe what each line will do.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.