Personally, I don't see a need for calling the same method on a number of objects. If you need an aggregate, create an aggregate. This, to me, would be a red flag in a code review.
# make 8 random aliens @lifeforms = map { RandomSpaceTraveller->new(); } (0..8); # find out who is klingon @klingons = grep { $_->get_species() eq 'klingon' } @lifeforms; # blow the klingons away foreach (@klingons) { $kirk->shoot_at($_); };
As evidenced above, I disagree. There are those of the functional school (of which I am quickly becoming a convert), who would say mixing OO and functional concepts in the same program is extremely funky in a good way.
Another point -- What if you are implementing an aggregate? Well, you need to know how to dance in aggregate school.
In reply to Re: Re: Method Calls on multiple objects
by flyingmoose
in thread Method Calls on multiple objects
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |