| |||||||||||
| |||||||||||
Teaching Object Oriented Java with Students and Ice Cream
"I'm getting tired of students. Can we do something else". So said my delegates at Cardiff University today. So we did Ice Cream and other deserts!
Perhaps I had better explain. I'm running a Java Course there, and looking for examples of classes and objects to write about. At the start of the course, delegates know diddly squat about OO design, and how it works in Java, so the first sample programs they write are tentative steps and using only an edited selection of the facilities available. Then they extend the example and find that "I wish I had known before I started that I would be going this way" but the catch is that they couldn't have known - too much information before the first practical means a poor practical and some points missed. So after the first example has been written, stretched, overstretched and pulled apart nearly to the point of breaking we consolidate the knowledge gained into a fresh example which can be written, from the beginning with the end target in mind. I'm not doing to show you any of the "student" examples. They look horrid / they show things that are kludged together nastily and I would be ashamed of them. But I will show you the Dairy Queen class! public class DairyQueen {And how does that run? Dorothy:febjava grahamellis$ java DairyQueenNow - do you feel cheated that I've not shown you all the code? I'm glad you've noticed that I've not shown you everything but that's the very joy of Object Oriented programming. YOU write the bits that YOU know about, someone else writes all the detail that they know about, they hide it within a class of objects and you keep calling the class methods as you need too. This hiding stuff within is known as encapsulation! Full code? Oh - if you MUST ;-) Desert.java - basic object for a desert Insurable.java - how to define something that's insurable Icecream.java - an ice cream desert is a desert with other features Colddesert.java - a cold desert is another type of desert DairyQueen.java - the whole application (above) which pulls it together (written 2008-02-12 23:00:53) Associated topics are indexed under Q907 - Object Orientation and General technical topics - Object Orientation: Design TechniquesJ710 - Java - Extending Classes and More
Some other Articles
Are nasty programs looking for security holes on your server?Colour, Composition or Content Chinese New Year A forum is not always the best vehicle Teaching Object Oriented Java with Students and Ice Cream To Wales - where theres still a toll on the bridge A Weekend in Liverpool OO PHP demonstration - comparing objects and more Where in the world / country is my visitor from? Short and sweet and sticky - PHP form input 1696 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||