View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

Interfaces - Teaching Tips

An interface is a specification of what methods an object must understand to be of a type but not a description of its class. Objects that are of a class that implements an interface will understand all the methods in an interface. Objects that are of a class that implements an interface are said to be of that type.

Uploaded Image: dec041s.jpg

This picture shows two devices a camera and a memory stick that both use the USB interface. My computer doesn't care what they are it just knows that it can communicate with them using the USB interface. Both the camera and memory stick are USB devices.

This is a topic that people have a real hard time with. Part of the problem is that we show interfaces but don't really show why they are needed. Start without an interface and work towards one. Show how using an interfaces lets you unplug one class and put in another.


Link to this Page