The following module was proposed for inclusion in the Module List:
modid: OO::InsideOut
DSLIP: bdpO2
description: basic, simple inside-out construction kit.
userid: RIVOTTI (André Rivotti Casimiro)
chapterid: 23 (Miscellaneous_Modules)
communities:
http://www.perlmonks.org/
similar:
Class::Std, Class::InsideOut, Object::InsideOut,
Hash::Util::FieldHash
rationale:
This module intends to supply a more natural and easyer
implementation for object oriented with inside-out technique.
It shares the same motivation of Class::InsideOut but with these
diferences:
- simple and standard as possible; - no special methods (like
DEMOLISH); - no specials features (like public, private) just the
basics; - support for threads::shared; - faster constructor and
field access; - no id or refaddr, just use $$self; - the following
methods are only added if not defined: STORABLE_freeze,
STORABLE_thaw, CLONE and CLONE_SKIP;
Synopsis:
package My::OO::InsideOut; { use strict; use warnings;
use OO::InsideOut;
OO::InsideOut::register \my( %Name, %Surname );
sub name { my $self = shift; my $value = shift;
$Name{ $$self } = $value if $value;
return $Name{ $$self }; }
sub surname { my $self = shift; my $value = shift;
$Surname{ $$self } = $value if $value;
return $Surname{ $$self }; }
1; }
package main:
use threads; use threads::shared;
my $obj1 = My::OO::InsideOut->new(); my $obj2 =
My::OO::InsideOut->new();
$obj1->name('name1'); $obj1->surame('surname1');
$obj2->name('name1'); $obj2->surame('surname2');
share($obj2);
threads->new( sub { $obj1->surname('threads1');
$obj2->surname('threads2'); }, )->join();
print $obj1->surname, "\n"; # surname1 print $obj2->surname, "\n";
# threads2
1;
enteredby: RIVOTTI (André Rivotti Casimiro)
enteredon: Tue May 22 13:24:21 2012 GMT
The resulting entry would be:
OO::
::InsideOut bdpO2 basic, simple inside-out construction kit. RIVOTTI
Thanks for registering,
--
The PAUSE
PS: The following links are only valid for module list maintainers:
Registration form with editing capabilities:
https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=eca00000_24e67be80ee4059d&SUBMIT_pause99_add_mod_preview=1
Immediate (one click) registration:
https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=eca00000_24e67be80ee4059d&SUBMIT_pause99_add_mod_insertit=1
Peek at the current permissions:
https://pause.perl.org/pause/authenquery?pause99_peek_perms_by=me&pause99_peek_perms_query=OO%3A%3AInsideOut