Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: The Accessor Heresy

by itub (Priest)
on Nov 28, 2005 at 23:17 UTC ( #512429=note: print w/replies, xml ) Need Help??


in reply to Re: The Accessor Heresy
in thread The Accessor Heresy

Using a cascaded if/elsif/else instead of individual methods looks terribly awkward to me. I think that's part of what OO and methods (or even subroutines in general) are supposed to help us avoid!

Replies are listed 'Best First'.
Re^3: The Accessor Heresy
by radiantmatrix (Parson) on Nov 29, 2005 at 16:03 UTC

    Yes, the implementation is poor, but it is meant to be a simple demonstration. I tend to choose dispatch-table type patterns for such things, and if the normalization/etc. were more complex I might even have "private" subroutines to deal with the attributes.

    My post is more targetted toward interface than internal implementation; still, your point is a good one.

    <-radiant.matrix->
    A collection of thoughts and links from the minds of geeks
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://512429]
help
Chatterbox?
[choroba]: three
[choroba]: I mean I haven't used DBIx::Class nor M:S, only Moo
[1nickt]: Haha, I was learning about Linux filesystem trees trying to understand how Moo fits.
[1nickt]: I just got my feet wet with some DBIC coding this last week. I feel "meh" about it so far. It was pretty easy to add a sub to the DBIC class to filter search results ...
[1nickt]: ... in the calling code ... $rs = $rs->maturity(" stable");. But I don;t enjoy feeling that far away from the SQL and the DB, really.
[1nickt]: The same project (CPAN Testers API) is using experimental signatures (and therefore 5.024) ... which is what replaced Method::Signatures , afaict.
[1nickt]: But the new $job is on an older Perl and therefore using M::S, the syntax of which looks clunky to me, so far.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-11-24 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?