1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
|
Revision history for Perl extension Class::Container:
0.13 Thu Nov 2 23:53:03 CDT 2017
- Fix tests failing on Perl 5.26 w/o '.' in @INC [Kent Fredric]
- A bit of Perl::Critic compliance
- Convert to Dist::Zilla
- Convert to git
0.12 Sun Jan 23 21:02:35 CST 2005
- Fixed a bug in the container() method, which was only returning
valid results for delayed objects, not auto-created ones. [Spotted
by Sebastian Willert]
0.11 Wed Mar 3 21:34:51 CST 2004
- Fixed a bug in the code that detects whether Scalar::Util is
loadable. [Spotted by Michael Alan Dorman]
0.10 Thu Mar 6 16:06:47 CST 2003
- The dump_parameters() method will now output the default values (if
any) of parameters that haven't been explicitly set.
0.09 Mon Feb 10 13:12:40 CST 2003
- Use Carp::croak() instead of die() in most places when throwing a
fatal error.
- Fixed a problem in dump_parameters() in which attributes from
superclasses weren't getting dumped.
- The valid_params() method now always returns a hashref, possibly
empty (when initialization hasn't happened yet), instead of
sometimes returning undef.
- Added experimental support for "decorator" classes, via the
decorates() method.
- Fixed the credits in the AUTHOR section to better reflect reality.
- Added a Module::Build-style Build.PL script for installation.
0.08 Thu Aug 29 17:11:20 EST 2002
- Added the dump_parameters() method, which returns a hash reference
containing a set of parameters that should be sufficient to
re-create the given object using its class's C<new()> method (under
normal/simple circumstances).
0.07 Tue Jul 23 00:34:34 PDT 2002
- Fix a bug in passing contained objects rather than using the
defaultly created one. [found by Ilya Martynov <ilya@martynov.org>]
- Calling container() when Scalar::Util is not installed now triggers
a fatal error instead of returning undef
- Get rid off the %ALLOWED_CACHE memoization, since it wasn't working
properly. It could be done, but not as easily, so maybe it's a
future project. [consistent prodding by Dave Rolsky]
- Replace guts of get_contained_object_spec() and validation_spec()
with an _iterate_ISA() internal method. This fixes a bug in
validation_spec() in which subclasses weren't overriding superclass
validation_spec()s.
- Make valid_params() a standard get/set accessor method.
- Document that valid_params() should only be called as a class
method, not object method.
- Improve the output of the show_containers() method.
- Calling contained_objects() twice on the same package wasn't
properly clearing previous entries.
0.06 Wed Jul 17 17:06:10 EST 2002
- Memoize the get_contained_object_spec(), validation_spec(), and
allowed_params() methods. This can give a big speed boost when
methods are called repeatedly, for example when using factory
methods. All memoization caches are cleared when valid_params() or
contained_objects() is called. The only known pitfall in the
caching is that a class that dynamically changes its @ISA will
probably mess things up. Idea by Dave Rolsky.
- Use 'scalar validate_with()' inside new(), which may be faster.
Idea by Dave Rolsky.
- short-circuit create_contained_objects() if there are no contained
objects to create. Idea by Dave Rolsky.
- return a reference from create_contained_objects() rather than a
list of key/value pairs. This lets us pass it directly to validation
routines.
- Use the qr// format for regexes in the all_specs() method.
- Improve the docs for allowed_params() - it's a class method (not an
instance method), and it accepts a list of arguments that can
affect the return value.
- Don't copy as many hashes internally. Pass by reference.
- Fixed some POD formatting problems.
- Now requires Params::Validate version 0.23
0.05 Thu Jun 27 16:53:41 EST 2002
- Fixed a problem in create_contained_objects() in which a 'foo_class'
parameter wouldn't get properly passsed to all the contained objects
that needed to see it.
- Added a documentation section "Scenario" explaining the main benefits
of using the module.
- Improved the output of show_containers(), notably the names of
delayed classes
- Merge $self->{container}{delayed} into $self->{container}{contained},
with a 'delayed' property. This allows simplification of the rest of
the code in several places, notably the show_containers() routine.
- Simplify show_containers() a little, and make it more accurate on
contained objects' classes
- Fixed a doc error in the first example
- Added a bit in the first doc paragraph, saying that any of the
Mason objects can be replaced by a subclass.
- Added an internal comment about the strategy inside the
allowed_params method.
- Simplified the allowed_params method internally.
- Got rid of special-casing to check for circular containment
relationships. This seemed to have been added for HTML::Mason, but
all Mason tests (as well as all Class::Container tests) still pass
when I remove it.
0.04 Wed Jun 26 19:15:26 EST 2002
- Add the show_containers() method, which should be a godsend during
debugging.
- Convert contained_objects() string specs to hashes upon input, rather
than checking them every time they're used later in the code.
- Change " if (%args)" to " if (keys %args)", which is more officially
correct (though both would work in this particular case).
0.03 Fri Jun 21 17:44:37 EST 2002
- Subclasses can now override contained_objects settings of their
superclass (previously it was backwards).
- Let call_method() accept arbitrary additional parameters, don't
force them into a hash.
- Added contained_class() method.
- Use new contained_class() method inside call_method().
- delayed_object_class() shouldn't be settable, it'll mess up the
parameters accepted.
- The 'container' parameter shouldn't be shared among containers the way
other parameters are.
- Made create_delayed_object() a little more efficient by not shifting
things off @_ - just pass @_ to the next new() method.
- Don't check for $contained_class->can('allowed_params'), check for
$contained_class->isa(__PACKAGE__).
- Clarified a few error messages.
- Clarified documentation and removed a couple of doc errors.
0.02 Wed Jun 19 10:52:48 AEST 2002
- Made Scalar::Util a little more optional - the container() method
is just a no-op if it's not around.
- Use Params::Validate 0.18 new validate_with() method to set a
meaningful subroutine name in error messages
- Added the delayed_object_class() method
- Documented how delayed objects are declared and created [Dave
Rolsky]
- Added some tests for the above stuff
- Various documentation spruce-ups
0.01_05 Fri May 10 15:29:46 AEST 2002
- If a container has two contained classes that both need to see a
parameter of the same name, it will now be passed to both. Previously
it was passed to one of them, randomly.
- Added 2 tests for the above.
- Added 4 tests to make sure class names can be properly overridden.
- Got rid of _make_contained_object() method.
- Changed the (undocumented) get_contained_objects() method to
get_contained_object_spec().
- Added the container() method, to get a reference to the thingy that
created you. Uses weak references if Scalar::Util is available.
- Consolidated all Container metadata in $self->{container} (subject to
change to {_container} or something).
- Added call_method() method.
0.01 Wed Mar 20 19:33:40 2002
- original version, based on HTML::Mason::Container
|