Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How would you simplify this code?

by chromatic (Archbishop)
on Apr 07, 2011 at 05:32 UTC ( [id://897933]=note: print w/replies, xml ) Need Help??


in reply to How would you simplify this code?

If this were my code, I'd make both attributes required so that it's impossible (or at least unlikely, if you follow the API documentation) to create a Remote object without a valid resource and username.

Replies are listed 'Best First'.
Re^2: How would you simplify this code?
by elTriberium (Friar) on Apr 07, 2011 at 05:46 UTC
    That's a good comment, however what if these 2 (or other) attributes are only required in this subroutine and not in all subroutines of the class?

      Some classes work out that way. It's not necessarily a design smell.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://897933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found