Questions tagged [fluent-interface]

Refers to a practice of coding object-oriented APIs with the aim of improving readability of the interface, normally implemented using method chaining.

7 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
114 views

Instantiating an animal using fluent classes with inheritance

I've spent a couple of weeks implementing a simple text editor. The entire program uses only immutable objects and a functional, fluid programming style. After reading about ways to implement Fluent ...
3
votes
0answers
145 views

Extendable REST-Client - follow-up

My previous RestClient wasn't disposing a lot of resources. I've fixed it (hopefully without introducing new issues) and because a few new patterns emerged I did a ...
3
votes
0answers
56 views

Easily add Accessibility to your app as an afterthought. Yes, as an afterthought

Accessible apps allow more users to use your app; however, it is usually an afterthought for developers, and it makes your XML layout files messy whether Accessibility was a forethought or ...
2
votes
0answers
604 views

JObject Pattern Matching: Merging partial WEB API JSON payload

This library [GitHub] helps merging partial WEB API JSON payload with existing prepopulated DTO objects. Let's say that JSON is represented by JObject from JSON.NET package. Naïve implementation ...
2
votes
0answers
316 views

PHPSpec, testing code that uses fluent mock

I've just completed writing a spec for a Doctrine2 repository. The repo contains only one method so far, the spec for which takes in an OAuth Identity token object (that contains an ID that matches up ...
1
vote
0answers
129 views

Fluent method arguments validation

I've put together a small fluent utility class for argument validation. Part of the code looks as follows: ...
0
votes
1answer
80 views

Fluent interface for Logger

I was trying to wrap a Logback logger in order to provide some handy methods and already defined default keys of the logged json output and I came up with something like this. Do you spot any ...