Object::LocalVars 0.16
Sponsored Links
Object::LocalVars 0.16 Ranking & Summary
File size:
0.040 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
854
Date added:
2007-06-22
Publisher:
David A Golden
Object::LocalVars 0.16 description
Object::LocalVars is a Perl module with outside-in objects with local aliasing of $self and object variables.
SYNOPSIS
package My::Object;
use strict;
use Object::LocalVars;
give_methods our $self; # this exact line is required
our $field1 : Prop;
our $field2 : Prop;
sub as_string : Method {
return "$self has properties $field1 and $field2";
}
This is a development release. The API may change slightly. Do not use for production purposes. Comments appreciated.
This module helps developers create "outside-in" objects. Properties (and $self) are declared as package globals. Method calls are wrapped such that these globals take on a local value that is correct for the specific calling object and the duration of the method call. I.e. $self is locally aliased to the calling object and properties are locally aliased to the values of the properties for that object. The package globals themselves only declare properties in the package and hold no data themselves. Data are stored in a separate namespace for each property, keyed off the reference memory addresses of the objects.
Outside-in objects are similar to "inside-out" objects, which store data in a single lexical hash (or closure) for each property, which is keyed off the reference memory addresses of the objects. Both differ from classic Perl objects, which hold data for the object directly using a blessed reference or closure to a data structure, typically a hash. For both outside-in and inside-out objects, data are stored centrally and the blessed reference is simply a key to look up the right data in the central data store.
The use of package variables for outside-in objects allows for the use of dynamic symbol table manipulation and aliasing. As a result, Object::LocalVars delivers a variety of features -- though with some corresponding drawbacks.
Main features:
- Provides $self automatically to methods without my $self = shift and the like
- Provides dynamic aliasing of properties within methods -- methods can access properties directly as variables without the overhead of calls to accessors or mutators, eliminating the overhead of these calls in methods
- Array and hash properties may be accessed via direct dereference of simple variables, allowing developers to push, pop, splice, etc. without the usual tortured syntax to dereference an accessor call
- Properties no longer require accessors to have compile time syntax checking under strictures (i.e. use strict); public properties have accessors automatically provided as needed
- Uses attributes to mark properties and methods, but only in the BEGIN phase so should be mod_perl friendly (though this has not been tested yet)
- Provides attributes for public, protected and private properties, class properties, and methods
- Orthogonality -- can subclass just about any other class, regardless of implementation.
- Multiple inheritance supported in initializers and destructors (though only one superclass can be of a special, orthogonal type)
- Minimally thread-safe under Perl 5.8 or greater -- objects are safely cloned across thread boundaries (or a pseudo-fork on Win32)
- Achieves these features without source filtering
SYNOPSIS
package My::Object;
use strict;
use Object::LocalVars;
give_methods our $self; # this exact line is required
our $field1 : Prop;
our $field2 : Prop;
sub as_string : Method {
return "$self has properties $field1 and $field2";
}
This is a development release. The API may change slightly. Do not use for production purposes. Comments appreciated.
This module helps developers create "outside-in" objects. Properties (and $self) are declared as package globals. Method calls are wrapped such that these globals take on a local value that is correct for the specific calling object and the duration of the method call. I.e. $self is locally aliased to the calling object and properties are locally aliased to the values of the properties for that object. The package globals themselves only declare properties in the package and hold no data themselves. Data are stored in a separate namespace for each property, keyed off the reference memory addresses of the objects.
Outside-in objects are similar to "inside-out" objects, which store data in a single lexical hash (or closure) for each property, which is keyed off the reference memory addresses of the objects. Both differ from classic Perl objects, which hold data for the object directly using a blessed reference or closure to a data structure, typically a hash. For both outside-in and inside-out objects, data are stored centrally and the blessed reference is simply a key to look up the right data in the central data store.
The use of package variables for outside-in objects allows for the use of dynamic symbol table manipulation and aliasing. As a result, Object::LocalVars delivers a variety of features -- though with some corresponding drawbacks.
Main features:
- Provides $self automatically to methods without my $self = shift and the like
- Provides dynamic aliasing of properties within methods -- methods can access properties directly as variables without the overhead of calls to accessors or mutators, eliminating the overhead of these calls in methods
- Array and hash properties may be accessed via direct dereference of simple variables, allowing developers to push, pop, splice, etc. without the usual tortured syntax to dereference an accessor call
- Properties no longer require accessors to have compile time syntax checking under strictures (i.e. use strict); public properties have accessors automatically provided as needed
- Uses attributes to mark properties and methods, but only in the BEGIN phase so should be mod_perl friendly (though this has not been tested yet)
- Provides attributes for public, protected and private properties, class properties, and methods
- Orthogonality -- can subclass just about any other class, regardless of implementation.
- Multiple inheritance supported in initializers and destructors (though only one superclass can be of a special, orthogonal type)
- Minimally thread-safe under Perl 5.8 or greater -- objects are safely cloned across thread boundaries (or a pseudo-fork on Win32)
- Achieves these features without source filtering
Object::LocalVars 0.16 Screenshot
Object::LocalVars 0.16 Keywords
LocalVars
LocalVars 0.16
Perl module
properties
objects
object
data
Perl
outside-in
Object::LocalVars
ObjectLocalVars
Object::LocalVars 0.16
Libraries
Programming
Bookmark Object::LocalVars 0.16
Object::LocalVars 0.16 Copyright
WareSeeker periodically updates pricing and software information of Object::LocalVars 0.16 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Object::LocalVars 0.16 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
myspace falling objects
business objects
objects in the rear view mirror may appear closer than they are
hidden objects games
sims 2 objects
falling objects
sims objects
properties for rent
objects that reflect light
object lessons
hidden object games
rental properties
objects in motion
objectives for resumes
properties unlimited
objective
properties of water
objects of my affection lyrics
Related Software
Object::Declare is a Perl module for declarative object constructor. Free Download
Object::Realize::Later is a Perl module with delayed creation of objects. Free Download
PObject is a base class for perl objects, takes the irritation out of creating properties for objects. Free Download
Games::Object is a Perl module to provide a base class for game objects. Free Download
Data::ICal is a Perl module that generates iCalendar (RFC 2445) calendar files. Free Download
ObjStore::Internals is a Perl module with a few notes on the implementation. Free Download
Alzabo is a Perl module with data modelling tool and RDBMS-OO mapper. Free Download
Ace::Object is a Perl module to manipulate Ace Data Objects. Free Download
Latest Software
Popular Software
Favourite Software