Recycle, Repair and ...err... Re-use.

Fox with Recycled Chook


Re-useability is the feature that both code and classes have being able to be inherited. On other words, classes and code are re-useable. Re-useability means that you can take code or a class and either integrate it directly in your program, or use it as the basis for a new class, that will inherit some or all of its features.

For example, say you created a the class 'Amphibians' which have a common feature of being born in water and having gills. From this you may derive a new class called 'Frog', which has the data for 'is born in water and has gills' already there. You are ready to roll and with no need to write for your specific froggy! Your subclass of 'Frog' can then become the superclass for a new subclass called 'tadpole', which also benefits from the same inheritance.

Much of the art of object oriented programming  is determining the best way to divide a program into an economical set of classes. Doing this results in fewer lines of code and therefore less chance of bugs, which translates to faster development time and lower maintenance costs.

Object-oriented programs rely on the possibility of incrementally modifying an existing piece of software. Therefore a 'good' object-oriented model should contain some kind of code reuse mechanisms. Examples of this are: the ability to construct new objects out of existing ones, but without modifying those existing objects; or the ability to define generic operations that can be used on a whole range of objects, not only on existing objects, but also on objects to be added later.


Back To Top


Technophile.City    The.Time.Machine     The.Tree.House    Lessons.Index      Assessment.Instruments     Maps     Power.Point     Proforma     Links     Gallery     Games     Humour      Prizes     WebRings     Soapbox     Search.Engines     Site.Map


             Search OzEdweb By Keyword