Re: Defaults in flags()
Marius Feraru <[email protected]> Wed, 09 Aug 2006 18:28:47 +0300
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Organization | N0i.Net |
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David Wheeler wrote:
> On Aug 9, 2006, at 04:09, Marius Feraru wrote:
>>> Shouldn't the flags() method in Component.pm have a default value set
>>> for the inherit flag?
>> No, because it's automatically set by the "_determine_inheritance"
>> method (lib/HTML/Mason/Component.pm:109).
>
> Hrm. But that's a private method, and if it hasn't been called by
> Mason before I call flags(), it doesn't work properly.
Ah (good morning to myself) - now I see your point: there is a _public_
flag() method (and custom flags functionality, OFC).
>> "inherit" should define a component path.
> Flags are booleans, I believe. It seems kind of odd that inherit
> actually stores something other than a 1 or a 0.
Agree. But the current functionality of the "inherit" flag in one good
old Mason feature that many of us (me included) would miss if it would
cease to exist. ;-)
Now, what would you prefer flag('inherit') to return?
a) current approach:
exists $self->{flags}{inherit}
? $self->{flags}{inherit}
: undef;
b) boolean:
exists $self->{flags}{inherit} && defined $self->{flags}{inherit}
c) parent component:
$self->parent
d) ? ;-)
cheers
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----
iD8DBQFE2f8vtZHp/AYZiNkRAkJKAJ9M9gPlBZUL/2JFwvq75BktIOx3YgCcCDn7
d5OK6c4L8QQ37mjzs1P+Ac8=
=IM58
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642