Accidental Open University M255 Revision

I’m currently trying to do some revision for my upcoming Open University exam M257 “Putting Java to Work.” To avoid doing this in a doing it sort of way I started making an AtoZ glossary from the various PDF’s to aid my revision attempts. Problem is that half way through completing this I discovered I was using PDF’s for the wrong course, M255 instead of M257. Very annoying! I’ve posted the accidentally half completed M255 course glossary below, as it may help somebody else.

accessor messageAn accessor message is either a getter or a setter message. For example, the messages getPosition( ) and setPosition( ) are accessor messages for the instance variable position held by instances of the Frog class. The getter message getPosition( ) returns the value of the instance variable position, while the setter message setPosition( ) changes the value of position.
accessor message The general term for either a setter or a getter message.
accessor methodA method that implements an accessor message.See getter method and setter method.
argument Extra information supplied with a message. For example, when requesting a Frog object to change its colour to that of another Frog object, it is necessary to provide that other Frog object as an argument. This is seen in the message-send frog1.sameColourAs(frog2). A message can have zero, one or more arguments. There is no argument in the message getColour( ). The message setColour( OUColour.PURPLE) has one argument (namely OUColour.PURPLE) supplying information on which colour is to be chosen. Two arguments (yourAccount and 50) supply information in the message transfer(yourAccount, 50).
assignment statement A statement that tells Java to make a variable reference a particular object or to hold a particular primitive value.
assignment When using objects, assignment is the process which results in the variable on the left-hand side of the assignment operator referencing the object returned by the expression on the right-hand side (this is called assignment using reference semantics). When using values of primitive data types, assignment is the process that results in the variable on the left-hand side containing a copy of the value returned by the right-hand side (this is referred to as assignment using value semantics).
attribute Some property or characteristic of an object,suchas position for Frog objects, or balance for Account objects.
attribute value The current value of an attribute. For example, a Frog object has the attributes colour and position. The attribute colour of a particular object might have the value OUColour.BLUE and the attribute position might have the value 1.
behaviour This term is used to describe the way an object responds to the messages in its protocol.
bytecodeBytecode is the intermediate code produced by the Java compiler.In BlueJ, compilation is done when the Compile button is pressed. This will create a bytecode file, for example Frog.class, from the source code file Frog.java.The bytecode file is portable, because each computer that can run Java programs has a Java Virtual Machine – a program itself – that understands bytecode and converts it into the machine code required for that particular computer.
class A class is a template that serves to describe all instances (objects) of that class. It defines what attributes the objects should have and their protocol what messages they can respond to.
comment A comment is a piece of text in program code that is ignored when executing the code. In Java multi-line comments are delimited by /* and */. Single line comments are simply preceded by //. A comment can generally be placed anywhere in the code of a class, with the exception of method comments – method comments are placed between /** and */ and must appear immediately before the method header.

compilerA piece of software which first checks that text written in a high-level language is correctly formed. If the check is successful, then the source code is compiled into bytecode.
compound expression An expression built up using other sub-expressions; for example, the following is a compound expression: (3 + 2) * (6 -3)
concatenation The joining of two strings. In Java the string concatenation operator is + (the plus sign). For example, “Milton ” + “Keynes” evaluates to “Milton Keynes”.
constructor A special type of message used to initialise a newly created object.
data hiding This is where an object is treated as a black box, with access to the encapsulated data (the instance variables) being possible only through a limited set of methods, i.e. only an object’s own methods are allowed to access the value of an instance variable (either to change it or return it).
debugging The identification and removal of implementation errors (bugs) from a program.
encapsulation Objects allow you to encapsulate data by incorporating into a single entity (the object) both the data (instance variables) and the behaviour (methods) defined for that data. The concept of encapsulation is very powerful because it allows an efficient division of labour in large software projects. Each team member can work in isolation on one or more classes. The only things that team members need to know about other classes are the names and specifications of the methods.
expression Code that evaluates to a single value. Expressions are formed from variables, operators and messages.
formal argument An identifier used in a method to stand for a value that is passed into the method by a message.
garbage collection The process of destroying objects, which have become unreachable because they are no longer referenced by variables, in order to reclaim their space in memory. In certain programming languages, including Java, this process is automatic.
getter message A message that returns as its message answer the value of one of a receiver’s attributes. See setter message and accessor message.
getter methodAn accessor method whose purpose is to return the value of an instance variable as its message answer.
identifier The name of a variable.
initialisation The state of an object when it is first created depends on its initialisation.
inspector An inspector is a tool used in M255 to look at the internal state of objects in a system. It lists the attributes of an object and displays their current values.
instance An object that belongs to a given class is described as an instance of that class.
instance variable A variable that 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.
Instances of the same class have the same attributes, which are initialised in the same way. They have the same instance protocol and respond in the same way to each message.
integrated development environment (IDE)A software tool that supports the construction, compilation and execution of a program. BlueJ is an example of an IDE that supports the development of programs in Java and includes libraries of classes and facilities for debugging and program design.
JavadocA program that comes with Java. The Javadoc program picks up information from specially formatted comments and other parts of the class code such as the constructor and the method headers. These are all used to create an HTML file, which describes the class in a standard way. This description is aimed not at the Java compiler, but at human readers (and possibly the writer of the code at a later date, when he or she might well have forgotten what the methods do).
literal A comprehensible textual representation of a primitive value or object. For example, ‘X’ is a char literal, 4.237 is a double literal and “hello there!” is a String literal.
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( ).
message answer When a message is senttoan 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. Enquiry messages (getter messages) often return the value of an attribute, as with the message getColour( ), which returns a value such as OUColour.GREEN.
message expression A message-send which evaluates to a value, i.e. the message returns an answer.
message name The name of a message does not include 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.
method body That part of a method enclosed by braces that follows the method header.
method headerA method header consists of an access modifier (e.g. public), a return value (e.g. int or void) and a name (e.g. setPosition) followed by the formal argument names enclosed in parentheses (e.g. (int aNumber)). For example, the method header for a method whose name is setPosition( ) is public void setPosition(int aNumber).
method invocation At run-time, selecting and executing a method when an object receives a message.
method signatureThe name of the method together with the parentheses and the types of any arguments. For example, the signature for the setPosition( ) method in the Frog class is setPosition(int).
method The code that is invoked by the Java Virtual Machine at run-time when an object receives a message.
new An operator used to create an object – used in conjunction with a constructor.
object An object is a software component that has a unique identity and responds to messages. Each object has state and responds to a particular set of messages (its protocol). Thus a Frog object (which has little resemblance to a real-world frog) holds information on its position and colour as values of its attributes position and colour.
object-state diagram An object-state diagram represents an object. It shows the class of the object, its state in terms of attribute values, and its protocol.
parameter A synonym for argument.
polymorphism Any message to which objects of more than one class can respond is said to be polymorphic or to show polymorphism. For example, both Toad and Frog objects respond to the message left( ), but with different behaviours. They also respond to the message green( ), with identical behaviours.
primitive data typeA set of values together with operations that can be performed on them. The primitive data types in Java provide a set of basic building blocks from which all the more complex types of data can be built. There are three categories of primitive data type: numbers, characters and Booleans.
private An access modifier. It tells the Java compiler that the only objects that have access are the object to which it belongs and other objects of the same class.
protocol The set of messages an object can respond to (understands).
pseudo-variable A special undeclared variable, visible within a method or constructor, that cannot be changed by assignment. Java has two such variables – this and super.
public An access modifier. It tells the Java compiler that all objects have access.
receiver The object to which a message is sent.
reference semantics The situation whereby a variable holds the address of an object, rather than a value.A reference type variable on the left-hand side of an assignment statement always ends up referring to the object on the right-hand side (cf. value semantics).
reference type variable A variable declared to reference an object of the declared or compatible type.
sequence diagram A diagram that depicts the interactions between objects, in the form of messages and message answers.
setter message A message that sets the value of one of a receiver’s attributes. See getter message and accessor message.
setter methodAn accessor method whose purpose is to assign a new value to an instance variable. The new value is determined by the single argument of the method.
signature See method signature.
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.
statementA statement represents a single instruction for the compiler or interpreter to translate into bytecode. In Java a statement must always end with a semicolon.
subclass A subclass is a new class defined in terms of an existing class (its superclass). Instances of a subclass have all the attributes that instances of the superclass have, but may have additional attributes. The protocol of the subclass includes (has at least all the messages of) the protocol of the superclass, but may define additional messages. For example, HoverFrog is a subclass of Frog. The protocol of HoverFrog objects includes that of Frog objects and has, in addition, the messages upBy( ) and downBy( ) to which Frog objects cannot respond. HoverFrog objects have all the attributes of Frog objects (colour and position) and an additional attribute – height.
superclass If Bisa subclass of A, then A is the superclass of B.
syntax The structure of statements in a given language.
this A pseudo-variable used within a method to reference the receiver of the message that activated the method.
value semantics The situation in which a variable holds a value, of some primitive data type.A value type variable on the left-hand side of an assignment statement always ends up holding a copy of the value on the right-hand side (cf. reference semantics).
value type variable A variable declared to hold a value of the declared or compatible primitive type.
variable A named ‘chunk’ or block of the computer’s memory which can hold either a value of some primitive type or the address (reference) of an object.
variable reference diagram A diagram showing a reference type variable pointing to a representation of an object with the current values of its attributes.

1 Comment

    Thanks Chris,

    This will be a good read – for when I find the time.

Leave a Reply




Popular Topics: