• Aucun résultat trouvé

W HERE TO FIND OUT MORE

Dans le document Object Oriented Perl (Page 38-41)

What you need to know first

1.4 W HERE TO FIND OUT MORE

The world is awash with textbooks, tutorials, and other resources dedicated to object-oriented programming. Your local bookstore probably stocks several dozen titles, and your local

techni-12 It’s older than quantum computing, but not as old as quantum physics.

Table 1.1 Other names for standard object oriented concepts

Concept… Also known as…

object class instance, instance variable

class user-defined type, object template, meta-object, package, module object attribute field, slot, instance variable, member object, data member

class attribute class variable, class field, static field, static data member, shared attribute, class datum

object method instance method, selector, handler, message handler, feature, member func-tion, operafunc-tion, package operation

class method static method, static member function, shared method method invocation method call, method activation, message, event interface protocol, feature set

inheritance subclassing, class specialization, derivation encapsulation data hiding, data privacy

generic class template, parameterized class, generic package, generic module polymorphic method virtual function, generic method, overridden operation, method abstract method pure virtual function, deferred feature

superclass parent class, base class subclass child class, derived class

cal bookstore, several hundred. In early 1999, a naive search of the web on the term “object-oriented” returned 840,000 matches. This section distils that bounty to four books, two web-sites, and two newsgroups.

1.4.1 Books

Most books on the subject are linked to a particular language—most often C++ or Java, but sometimes Eiffel, Smalltalk, Ada, or Visual Basic. That connection isn’t necessarily a bad thing, provided you’re careful not to let your first object-oriented language warp your view of object orientation in general.

The classic text on object orientation is Object-Oriented Software Construction by Bertrand Meyer. Although its concepts and examples are slanted toward Meyer’s own programming lan-guage, Eiffel, the explanation of object-oriented concepts is sufficiently general that the text forms a useful introduction to the entire field.13

Another excellent introductory text is Object-Oriented Design with Applications by Grady Booch. The first edition introduced object orientation by taking examples from five different languages: Smalltalk, Object Pascal, C++, CLOS, and Ada.14 The second edition, retitled Ob-ject-Oriented Analysis and Design with Applications, confines itself to C++.

For a practical and highly detailed guide to actually doing object-oriented software devel-opment, Trygve Reenskaug’s Working With Objects offers the fruits of more than twenty years of experience by one of the pioneers of object orientation.

If you find these references too technical or too caught-up in specific languages, you might like to consider Object Technology: A Manager’s Guide by David A. Taylor. Don’t let the title put you off; this is an excellent language-independent introduction to the fundamental concepts of object orientation.

See the bibliography for full details of each of these books and others mentioned in later chapters.

1.4.2 Websites

While it’s not surprising that object-oriented programming is so profusely represented on the web, it’s also no surprise that much of the material available is of dubious value at best. Rather than attempt to pick the most suitable sites, this section lists two that provide broad entry points into the vast array of on-line resources.

Cetus Links, at http://www.cetus-links.org/, is probably the most extensive list of resourc-es and links related to object orientation and the related area of component-based program-ming. Currently, it offers over 13,000 links, categorized in every way imaginable. The page http://www.cetus-links.org/oo_infos.html is a good place to start.

The other exceptionally comprehensive starting point is the Object FAQ site at http://

www.cyberdyne-object-sys.com/oofaq2/. It provides a somewhat smaller and more technically oriented resource than Cetus Links, but is exceptionally accurate and conveniently arranged.

13 If you are familiar with Eiffel you may find it useful to consult appendix B, which presents a compar-ison of object-oriented Perl with that language.

14 Appendix B also provides a comparison of Perl with Smalltalk and C++.

1.4.3 Newsgroups

The principal newsgroups for discussions of object-oriented programming are comp.object and comp.object.moderated. As usual, the unmoderated group has much greater level of traf-fic and more noise, while the moderated group drifts into deep and theoretical discussions at times. However, both groups have high signal-to-noise ratios and are relatively novice-friendly.

1.5 S UMMARY

• Objects are mechanisms that provide controlled access to collections of data (attributes) and allow them to be manipulated in predefined ways.

• This access and manipulation is provided by methods, which are subroutines specifically associated with a particular class of objects.

• A class defines the attributes and methods that a certain type of object provides.

• Inheritance allows new classes of objects to be created by extending or altering the behav-ior of an existing class. A derived class has all the attributes and methods of the classes it inherits and typically adds new ones as well.

• The way an object responds to a standard method call often depends on the kind of object it is. This is known as polymorphism.

• The main advantage of object orientation is that it separates the interface to data from the implementation of that data and of the operations defined on it.

• Object attributes may also be objects of simpler classes. Building larger objects by joining together smaller ones is known as aggregation.

• Sometimes it’s useful to generalize the syntactic structure of a set of similar classes, rather than their semantics. Such structural generalizations produce generic classes or methods.

C H A P T E R 2

Dans le document Object Oriented Perl (Page 38-41)