Implementing Progressive Inner Closure Pattern in C#. 2. The closure

 
event

Before jumping to furious-coding-mode, we need to think about the problem in hand:
we have a bunch of methods that will allow us to write strings separated by some sort of token (being urls the subject being processed, the forward-slash “/” got the job). Those strings need to be non-empty and order matters.
This simple analysis tells us that we need to have some sort of context passed to each one of the implementations, and that context allows appending non-empty strings to a collection. When the user is done adding fragments to the url, that collection needs to be processes in order to be transformed into the string representing the url.

share
comment
  class ,

Implementing Progressive Inner Closure Pattern in C#. 2. Progressiveness

 
event

But before drilling the progressive interface an introduction to the closure “ingredient” is needed.

share
comment
  class ,

Implementing Progressive Inner Closure Pattern in C#. 1. The Problem

 
event

I like some fluent interfaces. Not that I’d like everything API to be this way, but in some situations, it certainly helps due to its expressiveness. The only problem is that, if not created properly, it is difficult to choose the next method in the chain. For that purpose a different type of fluent interface, the so called progressive interfaces, was ideated. The difference is that with the later, the user of the interface will only have available those methods that can be chained for the given link. In other words, progressive interfaces are fluent interfaces that are easy to explore.

share
comment
  class ,

Do Not Know Why I Keep Getting Surprised

 
event

I have already written about the “principle of least surprise” applied to API design and how Microsoft’s .Net Framework developers themselves ignore their own recommendations.
I would not care less if their violations did not waste my time, but they do.

share
comment
  class ,

Fun with Expressions

 
event

Weird enough that when weather does not invite one to go outdoors and I have some spare time to indulge myself, being on my own for some hours, I decided to relax and do some programming work. Weird as it is a task that takes most of my working week, but I still certainly enjoy some of it even outside working hours.

The task at hand was to improve my very own Range object after being “inspired” by this post and the very interesting link from it.

share
comment
  class