Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > PERL TUTORIALS > THE ROAD TO BETTER PROGRAMMING: CHAPTER 5 MODULES AND OBJECTS


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

The road to better programming: Chapter 5 Modules and objects
By Teodor Zlatanov - 2004-03-01 Page:  1 2 3 4 5 6 7 8

Exercises and Resources

  1. What is the difference between OOP, PP, and FP?

  2. What are the essential OO programming language features? Give an example of how each might be used.

  3. When would you avoid OOP?

  4. Write a class with a new() method that, when instantiated into an object, stores the current object count into the object itself, as a sort of unique object identifier. Why is or isn't this a good idea?

  5. Draw a diagram of your immediate family. Why is this not the same sort of inheritance as the one we discussed regarding OOP? How would you express family relationships in OOP?

  6. If every object had to inherit from a single source, the base object of all objects, what kind of properties, methods, and attributes would you put in that base object? Would you make it have a unique identifier in all cases, for instance? Why is a base object for all objects not necessarily a good idea?

  7. Look carefully at the files that h2xs generates. What does Makefile.PL do when you run it with Perl? Check out the targets in the resulting Makefile. Use test.pl for a simple test in addition to the one specified by default.

Resources



View The road to better programming: Chapter 5 Modules and objects Discussion

Page:  1 2 3 4 5 6 7 8 Next Page: What is Object Oriented Programming (OOP)?

First published by IBM developerWorks


Copyright 2004-2017 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.