Interesting use of fluid interfaces?
I'm wondering where and when fluid interfaces are a good idea, so I'm looking for examples. So far I have only found 3 useful cases for example. Ruby collections like
unique_words = File.read("words.txt").downcase.split.sort.uniq.length
and Fest (Java) for unit testing:
assertThat(yoda).isInstanceOf(Jedi.class)
.isEqualTo(foundJedi)
.isNotEqualTo(foundSith);
and JMock . Do you know of other good examples that use a fluent interface?
+1
source to share
4 answers
- Ninject: http://www.ninject.org
-
For an example that doesn't come from general purpose libraries, I've created an auto regression set for the tuning wizard. I created a state machine that fills in the values on the wizard page, checks that the values are acceptable, and then proceeds to the next page. The code for each step in the target machine looks like this:
step.Filler () Fill () Check () GoForward (); ...
0
source to share