Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

A different OO approach

by fruiture (Curate)
on Dec 13, 2002 at 19:55 UTC ( [id://219728]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package OO;
    use strict;
    use warnings;
    use Carp qw/croak/;
    
  2. or download this
    #--------------------------------------------------------------------
    #       The registry itself: storing all the data of your objects
    ...
    
    # Object => Class => Attribute
    
  3. or download this
    #--------------------------------------------------------------------
    #       inheritable constructor with generalized behaviour
    ...
    
            return $self;
    }
    
  4. or download this
    #--------------------------------------------------------------------
    #       Use these two methods to get and set members of your
    ...
    
            $Object{ $obj }{ $class }{ $field } = $value;
    }
    
  5. or download this
    #--------------------------------------------------------------------
    #       most important: DESTROY
    ...
    
            delete $Object{ $obj } #that's why the structure of the regist
    +ry was chosen like that
    }
    
  6. or download this
    #--------------------------------------------------------------------
    #       create_accessor class method to create simple accessor/mutator
    + methods
    ...
                    }
            }
    }
    
  7. or download this
    #--------------------------------------------------------------------
    #       debugging function/method (as you like it)
    ...
    }
    
    1;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://219728]
Approved by Tanalis
Front-paged by Tanalis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found