Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Unlimited chaining (is there a way to detect this?)

by weierophinney (Pilgrim)
on Jan 06, 2008 at 20:11 UTC ( [id://660686]=note: print w/replies, xml ) Need Help??


in reply to Unlimited chaining (is there a way to detect this?)

Martin Fowler calls this a "fluent interface": http://martinfowler.com/bliki/FluentInterface.html

The idea behind it is that methods that are simply setting object state return the object instance; this can improve readability in many instances, particularly if you align the '->' pointers vertically, and can be used to build constructs that have a natural linguistic flow -- hardly 'dumb' code.

As for detecting it... simply don't write such constructs; the only way you'd be able to programmatically generate such a construct is to pass it to eval, and eval is rarely the right answer.

Replies are listed 'Best First'.
Re^2: Unlimited chaining (is there a way to detect this?)
by Burak (Chaplain) on Jan 06, 2008 at 20:56 UTC
    Interesting... I didn't hear that "fluent interface" before :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-19 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found