Object Oriented Perl
Synopsis
Object Oriented Perl is designed to provide anyone
who is familiar with the basics of regular Perl programming
with a complete introduction to the object-oriented
features of Perl, leading them from the very simplest
applications right up to advanced applications such as
generic programming, multiple dispatch, and object-oriented
persistence. Thus, it offers a much-needed resource for
persons new to Perl, as well as new and valuable insights
and techniques for even the most accomplished Perl
programmer.
Beyond explaining the syntax and semantics of Perl's
inbuilt object-oriented features, Object Oriented
Perl explains how to apply those features in a wide
range of programming techniques. Each technique is
illustrated with complete examples.
Object Oriented Perl also discusses the latest
relevant Perl modules, which are freely available and can
greatly simplify object-oriented development in Perl. In
particular, it examines the new standard "fields" module
and the associated pseudo-hash construct.
No other book covers the topic of object-oriented
software development in Perl in such breadth, to such
depth, or in such a readable manner. Complete source code
for Object Oriented Perl will be available
on-line.
Table of contents
- Introduction
- What is this book about?
- What is object-oriented Perl?
- Whom this book is for?
- Where to find what you're looking for?
- What You Need To Know First (An OO Primer)
- The essential elements of OO
- Abstraction
- Encapsulation
- Inheritance
- Polymorphism
- Other OO concepts
- Genericity
- Interface vs implementation
- Class vs type
- Persistence
- A few words about terminology
- Where to find out more
- What You Need To Know Second (A Perl Refresher)
- Essential Perl
- Scalars
- Arrays
- Hashes
- Subroutines
- References
- Packages
- Non-essential (but very useful) Perl
- Modules
- Autoloading
- Closures
- Typeglobs
- Where to find out more
- Books
- The Perl documentation
- The Perl Journal
- Perl on the WWW
- Newsgroups
- Simple Object-Oriented Perl
- Three little rules
- Rule 1: To create a class, build a package
- Rule 2: To create a method, write a subroutine
- Rule 3: To create an object, bless a referent
- A simple Perl class
- The code
- Using the CD::Music class
- Making life easier
- Class modules
- use strict and the -w flag
- Automating data member access
- Documenting a class
- Creation and destruction of objects
- The CD::Music class, compleat
- Blessing Variables
- What's wrong with a hash?
- Blessing an array
- Reimplementing CD::Music
- An array-specific example - iterators
- Where to find out more
- Blessing a pseudo-hash
- A pseudo-what???
- Limitations of a pseudo-hash
- Advantages of a pseudo-hash
- The worst of both worlds?
- Compile-time support for run-time performance
- Just how Perl knows at compile-time that a particular
variable is referring to a Transponder object, when the
variable isn't assigned a value until run-time
- Yet another version of CD::Music
- Where to find out more
- Blessing a scalar
- Why not bless a scalar?
- An object-oriented password
- A bit-string class
- Where to find out more
- Blessing Other Things
- Blessing a regular expression
- The qr operator
- Why an OO regular expression class?
- Designing a different regular expressions
mechanism
- A closer look at the two classes
- On the separation of Search and State
- Where to find out more
- Blessing a subroutine
- So how can a subroutine be an object?
- Why objectify a subroutine?
- A lexer object
- Example: A simple pretty-printer
- Where to find out more
- Blessing a typeglob
- Paging STDOUT
- A multiprocess pager class
- A threaded pager class
- Where to find out more
- Inheritance
- How Perl handles inheritance
- The @ISA array
- What inheritance means in Perl
- Where the call goes
- Constructors and inheritance
- Destructors and inheritance
- Tricks and Traps
- Naming attributes of derived classes
- The isa() subroutine
- The can() subroutine
- The UNIVERSAL package
- The SUPER pseudo-package
- Inheritance and pseudo-hashes
- Issues related to accessing class data
- Example: Inheriting the CD class
- Applied laziness
- Class attributes revisited
- An alternative solution
- Polymorphism
- Polymorphism in Perl
- Example: Polymorphic methods for the Lexer class
- The simple pretty-printer objectified
- Using interface polymorphism instead
- Automating class creation
- The Class::Struct module
- The Class::MethodMaker module
- Operator Overloading
- The problem
- Perl's operator overloading mechanism
- "Automagic" operators
- Fallback operations
- Specifying conversion operators
- Example: A Roman numerals class
- Creating class constants
- Circumventing undesired reference semantics
- The use and abuse of operators
- When to overload
- Where to find out more
- Ties
- Tie'ing a scalar
- Tie'ing an array
- Tie'ing a hash
- Tie'ing a filehandle
- Blessing and tie'ing to the same package
- Encapsulation
- The perils of trust
- Enforcing encapsulation via closures
- Enforcing encapsulation via scalars
- The Tie::SecureHash module
- A limited-access hash
- Constructing a securehash
- Declaring securehash entries
- Accessing securehash entries
- Iterating a securehash
- Ambiguous keys in a securehash
- The formal access rules
- Where to find out more
- Where to find out more
- Genericity
- Why Perl doesn't need special generic mechanisms
- Using special mechanisms anyway
- Implicit generics via polymorphism
- Multiple Dispatch
- What is multiple dispatch?
- Implementing multiple dispatch via single dispatch
- Implementing multiple disatch via a table
- The Class::Multimethods module
- The problem(s)
- Automating multimethods
- Finding the "nearest" multimethod
- Implications of the multimethod dispatch process
- Defining multimethods outside their classes
- Multimethods as regular subroutines
- Non-class types as parameters
- A final refinement - recursive multiple dispatch
- Where to find out more
- Where to find out more
- Persistent Objects
- The ingredients
- Identity
- Encoding/serialization
- Storage
- Coordination
- Object-oriented persistence
- Encoding objects
- Object-oriented encoding
- Coarse-grained persistence
- Class-specific persistence
- Some improvements
- Coarse-grained persistence for any data
- Summing up
- Fine-grained persistence
- Files as objects
- Memory-mapped files as objects
- Tied databases as objects
- Fine-grained persistence for any class
- Better persistence through genericity
- Summing up
- Where to find out more
Appendix B - What You Might Know Instead
- From Smalltalk to Perl
- From C++ to Perl
- From Java to Perl
- From Eiffel to Perl
Glossary Bibliography Index
Commander ce livre au
prix de
57,68
€
54,8
€
Classé sous : Object, Oriented, Perl, Class, Persistence
Livres en rapport
|
Derniers Blogs
ASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHEASYNC/AWAIT: COMPRENDRE COMMENT CA MARCHE par fathi
Tout le monde est unanime pour dire que la programmation multi-thread et asynchrone est en train de devenir un sujet incontournable. Beaucoup de choses sont arrivées avec le framework 4 pour le code parallèle (TPL, PLinq,.) et bientôt, on va avoir l...
Cliquez pour lire la suite de l'article par fathi PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS !PAS D'INTELLITRACE SUR MON SITE WEB DANS IIS ! par Etienne Margraff
J'ai récemment eu un problème pour obtenir l'intelliTrace sur un site web dans IIS. Il n'y avait pas de message d'erreur, rien dans le journal d'évènement Windows, et après 3 appels à une voyante, 2 visites chez un marabou, j'ai failli me résign...
Cliquez pour lire la suite de l'article par Etienne Margraff OFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONSOFFICE 365 - SHAREPOINT ONLINE, QUELQUES LIMITATIONS par junarnoalg
De nombreuses entreprises font le choix de SharePoint Online, service fourni au travers de l'offre de Microsoft Office 365. S'il est vrai que ce choix apporte un grand nombre d'avantages; rapidité de mise en œuvre, disponibilité, large couvertu...
Cliquez pour lire la suite de l'article par junarnoalg PRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGEPRéSENTATION DES API REST DE WINDOWS AZURE : LISTER LES COMPTES DE STORAGE par richardc
http://www.c2idotnet.com/articles/presentation-des-api-rest-de-windows-azure-lister-les-comptes-de-storage
Désolé pour "toto", mais c2i existait avant blogs.developpeur.org et c'est mon site "officiel" ;-) ...
Cliquez pour lire la suite de l'article par richardc
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|