I love fluent interfaces

I’m developing a little library that basically does these steps

  1. open a docx file
  2. Find a particular bookmark in the file
    3)Add some content at bookmark position
  3. Save the updated file.

This is a typical call

image

I like very much this kind of syntax, since we chain every method we always have intellisense that suggest us what to call, if you read the code you can easily check that we add two simple cell with text, then we add a cell with complex text, then another paragraph and finally another table, here is the result on the final document.

image

Fluent interfaces like these fully benefit from intellisense and are really simple to use.

alk.

Tags: fluent interface