|
|
|
|
|
by jlujan
4488 days ago
|
|
What you are referring to is a design pattern called fluent interfaces[1]. They do make for very usable APIs when used to represent pipelines and filters. They are also used heavily in creating domain specific language features. In your SQL example it works very well such as in SQLAlchemy. But in that example, the chained methods are building a query as opposed to mutating the actual data. Splitting hairs. [1]http://en.m.wikipedia.org/wiki/Fluent_interface |
|
Severely, since what you're doing is mutating the actual state-data of the query object.