OOP Icon


Object-oriented Programming
2 Stories
All Topics

Mihai A www.amihaiemil.com

Dolls and maquettes (a metaphor about why model objects are evil)

A visual explanation on why model objects are not a good practice in object-oriented software. It is explained that a developer's job should be the one of an engineer, instead of the one of a manual worker (I would say even the one of a puppeteer, but I don't like the rhyme); objects should be alive and have behaviour of their own rather than being mere models surrounded by tools, artificial ways of making them act as if they were alive.


Yegor Bugayenko www.yegor256.com

Fluent interfaces are bad for maintainability

Yegor Bugayenko: Fluent interface, first coined as a term by Martin Fowler, is a very convenient way of communicating with objects in OOP. It makes their facades easier to use and understand. However, it ruins their internal design, making them more difficult to maintain. A few words were said about that by Marco Pivetta in his blog post Fluent Interfaces are Evil; now I will add my few cents. Yegor uses his own HTTP library as an example where the interface designed is fluent (which looks nice and readable to use) and shows how that design goal made the internal code a mess. My gut tells me it's worth the trade-off to provide a better user experience, but Yegor's real-life experience punches me right in the gut: Fluent interfaces are perfect for their users... However, the damage they cause to object design is the price, which is too high. He suggests decorators and smart objects as an alternative. Lots to ponder here, and the conversation going on in the comments is lively as well. 👌

0:00 / 0:00