Topic outline
General
An introduction
The first topic is focused on where Java fits in the world of programming and what exactly is meant by the term object orientated. It aims to explore a little of the history of the course but more importantly look at how the real world can be modelled as a collection of objects which interact with each other. You will have a chance to see your first bit of Java code and interact with some of the tools you will become familiar with. These early tasks are curtasy of the open university, as the course progresses they will move away from the ou material.
Task 1 - Interpreters, compilers and java
Whilst learning about the fundementals of computer systems you have categorised programming languages into either interpreted or compiled languages, Java is a bit of both. Read pages 15 and 16 of the task 1 book to learn more.
Task 2- Objects, attributes and states
Pages 17 to 21 explain how things can be described as objects which contain attributes and behaviours. An attribute has a value, the values of all the attributes of an object are called it's state. Behaviour referes to how the object can change it's attributes values or send messages to other objects based on it's state.
The task - working in your web design groups try and define the people in a school as a collection of objects and give them some attributes and behaviours
Task 3 - Attributes in word
To help you get to grips with the idea of objects and attributes you will now look at how attributes
Topic 1
Objects, variables, attributes and a pair of frogs
The first lesson on java looked at objects and described them as having attributes, the text is bold or red, etc. The purpose of this lesson is to introduce you to a pair of objects in a simulated world written in java. You should get the opertunity to get your head around the idea of objects, variables, attributes and even touch on classes by playing with the frogs.
6.1 Sending Messages to Objects
At the bottom of book 1 page 38 the topic begins, read the whole topic (end of page 39) and return for a discussion
Activity 5
Working in your webdesign groups go to the Amphibian worlds and launch the microworld two frogs
In your groups work your way through the activity and try and answer the questions without looking at the answers! you should discuss within your groups to ensure everyone has grasped the concept. It is very important to get the terminology straight in your heads at this stage, you shouldn't rush to the next task.
Activity 6
Working in your webdesign groups go to the Amphibian worlds and launch the microworld two frogs
As before working in your groups work your way through the activity and try and answer the questions without looking at the answers! you should discuss within your groups to ensure everyone has grasped the concept.
Topic 2
Code Pane, Grouping classes, and Messages
So far in the amphibian world you have been using a GUI (Graphical User Interface) to interact with the two instances of frogs, frog1 and frog2. In this lesson you will use the task pane to directly send messages to the frogs and observe their responses.
Activity 7 - Page 43
Working in your webdesign groups go to the Amphibian worlds and launch the microworld two frogs
As before working in your groups work your way through the activity and try and answer the questions without looking at the answers! you should discuss within your groups to ensure everyone has grasped the concept.
Grouping objects into a Class
Frog1 and Frog2 are variables refering to two instances of the same class
One of the main points of object orientated programming is the use of classes to be economical with code. By reffering to instances of the same class both frog1 and frog2 do not need their own code to tell them how to behave. It also means that if you update the frog class you will be updating the behaviour of both frogs at once.
Page 44, 45 has a very brief discussion of this and asks a question to test your understanding.
Messages and Protocols
Read the brief section on page 45 and answer SAQ5
Topic 3
Topic 4
Unit 2
The virtual server has been delivered and is being installed so you will have a chance to access this soon. In the mean time I have installed a virtual machine on a number of computers in room 12, you will need to log on as student to gain access.
- <
Classes and Subclasses
<Next we will look at the relationship between, frogs, toads and hoverfrogs.
This is preliminarily covered in pages 6-9 of the unit t2 book
Topic 5
Topic 6
Topic 7
Topic 8
Topic 9
Topic 10
Topic 11
Topic 12
Topic 13
Topic 14
Topic 15