From: Mark D. <mar...@zn...> - 2007-03-18 04:03:26
|
Eric Wilhelm wrote: > Hmm... I'm trying to make it *less* verbose and more concise. What's > good about verbose? XML? We're in different camps here. I view it as a Coke vs Pepsi thing. A matter of personal taste. And XML is a very good thing when used in an appropriate context. (Which, I'll admit, is quite infrequently.) I think parenthesis and more quoting is good and I also, as a general rule, think 'implicit' anything should only be allowed in an argument list. But there is no right or wrong here. Just different viewpoints. > What specifically makes it inaccessible? Or, is it just unfamiliar? I > understand the aversion to magic, but once you know the trick, it's not > magic anymore. Well, unfamiliar = inaccessible surely? Coke vs Pepsi again, I think. > Do you have a suggestion (even if you don't think it would compile, I > would like to see it.) I have no code. As noted in a prior mail, I'm presently stuck with ->MyGetControlMethod('controlname'); ->MyGetMenuMethod('menuname'); which, of course, works and is I think at least better than $self->{controlname} or $self->{menuitemisaved}. I'm undecided on the named accessor thing. On the one hand I think that any accessors in your classes should behave in a standard way vs inheritance whether hard coded or added at runtime and if you can't achieve that you should leave it alone. On the other hand, accessors for controls would be sooooo nice and you could always take the view that in practical terms, approach X does the job so lets go for it. Then again, would it be wise to implement your own scheme rather than the commonly used Class::Accessor with its known limitations / workarounds? I'm firmly on the fence today. I've spent some time staring at children( ctrl custom_bit => 'Thing::Control' => 'argument', 'argument', ctrl text_ctrl => -TextCtrl => "", style(te => 'MULTILINE|READONLY|DONTWRAP'), and I can't learn to love it. Perhaps I could learn to love what it does. Anyhow, if no-one comes up with what you consider a better accessor scheme it would be great if you actually implemented it. Its the accessor creation scheme that really matters and how it sits with use base qw( one two three four ); If I want a more verbose 'children()' that bit alone would be simple. I'm going to crack on with my pseudo designer template thing. After spending so much verbage talking about it, it would be shameful if I didn't produce at least something! If I stick with MyGetControlMethod('controlname') for now, I can defer deciding about named accessors until I fall off the fence one way or the other. Regards Mark |