Glossary Flashcards
wrapping
The process of converting a primitive value to an object equivalent, using a wrapper class.
state
The values of the attributes of an object constitute its state. The state of an object can vary over time as the values of its attributes change.
A behaviour of an object in response to a message may be dependent on its state.
Example: sending an HoverFrog instance the message upBy()
message
A message is a request for an object to do something. The only way to make an object do something is to send it a message. For example, the position of a Frog object changes when it is sent the message left() or right(); to obtain information on the value of a Frog object’s colour attribute, you send it the message getColour().
A message must be in the protocol of the receiver.
May return a message answer and/or change the state of the receiver
protocol
The set of messages an object understands.
public protocol
The part of the protocol of a class or object that is accessible from outside of the class itself.
private protocol
The part of the protocol of a class or object that is inaccessible from a context outside of the class itself.
message answer
When a message is sent to an object, then, depending on what the message is, a message answer may be returned. A message answer is a value or an object; it is not a message. Sometimes a message answer is used, sometimes it is ignored. A message answer may be used subsequently as the receiver or argument of another message. Getter messages return the value of an attribute, as with the message getColour(), which returns a value such as OUColour.GREEN.
message expression
A message-send that evaluates to some value, i.e. the message returns a message answer. We also say that it returns a value.
message name
The name of a message, including the following parentheses, but excluding any arguments. For example, the name of the message left() is left(), and the name of the message upBy(6) is upBy().
message-send
The code that sends a message to an object – for example, frog1.right(), which consists of the receiver followed by a full stop and then the message.
collaboration
The achievement of a software solution using two or more communicating objects.
receiver
The object to which a message is sent.
class
A class is like a blueprint for the creation of objects and ensures that all its instances have the same instance variables and behave in response to messages in an identical manner.
class header
The line in a class definition which gives its access modifier, name and, optionally, the name of a class it extends and the name(s) of any interface(s) it implements. Example usage: public class WeatherFrog extends Frog implements WeatherClient
class method
A class method is a method declared with the keyword static and is associated with a class rather than with any of its instances. Classes are not objects so code in a class method cannot use the expression this or the keyword super. Class methods are invoked directly on the name of the class, using static binding, and so do not exhibit polymorphism.
class variable
A class variable is a variable declared with the keyword static. A class variable is associated with a class rather than with any of its instances, although each instance of a class can access its own class’s class variables. A class only ever has one copy of each of its class variables.
qualified
The qualified name of a member is its simple name prefixed by the name of its enclosing class, as in OUDialog.request. The parts of such names are separated by dots. This means that different classes can have members with the same names – the qualified names allow them to be distinguished from one another.
superclass
If B is a subclass of A, then A is the superclass of B. In the Java programming language a subclass has only one direct superclass.
subclass
A subclass is any class which extends (inherits from) another class. In Java all classes except Object are subclasses of some other class.
subclassing
Defining a class as a subclass of an existing class.
instance
An object that belongs to a given class is described as an instance of that class.
instance method
Code that is executed as the result of a message being sent to an object.
instance variable
A variable whose identifier and type is common to all the instances of a class, but whose value is specific to each instance. Each instance variable either contains a reference to an object or contains a value of some primitive type. For example, Frog objects have the instance variables colour and position. The values of the instance variables of a particular object represent the state of that object.
invocation
Executing code in a method. Class (static) methods are invoked directly on a class, whereas instance methods are invoked by sending messages to objects. Also called method invocation.