DSL vs what?

July 17th, 2007

Last week there were some topics on the DSL vs Fluent interfaces. I’d like to share my thoughts on this.

DSL

This is a DSL.

Fluent interfaces

Now what a fluent interface is? It’s easy. A fluent interface is another re-engineered term that Mr Fowler likes to introduce to the community when he’s bored, or when he wants to test how much influence he still has on the software development field. “Fluent interfaces” and “dependency injection” goes hand in hand doing their best to confuse and often mislead you from the original point of the underlying subject.

Kudos to those that think that Mr Fowler is some kind of authority on some kind of field, just because he was clever enough to publish books that summarize well know practices, patterns and you name it before someone did it. Often renaming terms so he gets the references and is confused as the author/creator/inventor of something.

Categories: wtf? | Top Of Page | 14 Comments » |

14 Responses to “DSL vs what?”

Nick Parker Says:

Great post hammett!

Aaron Jensen Says:

What was the original term Fluent interfaces is renaming? I know DI is another name for Inversion of Control… and it’s a name that I think is much more accurate and descriptive. I think there’s a lot of value in giving vocabulary to our profession. Without we’d all have no idea what each other are talking about. I have no idea how many patterns Martin actually invented rather than named and standardized… but I think the real question is did Martin kill your kitten?

hammett Says:

Aaron, DI is not another name for IoC, at least not on my brain. If you think so, you dont get what IoC’s main purpose is, and that’s what I meant when I said “to confuse and often mislead you from the original point of the underlying subject”

And about Fluent interfaces, what about OOP? What about method chaining? Does it need, for god’s sake, a new name?

If you go beyond that, a truly descriptive object model that does not fit on Martin’s description can be found at domaindrivendesign.org Another one is the Money object model created by Kent Beck on the TDD book. Is that a fluent interface or simply OOP?

And btw, I’m a dog person :-)

And btw * 2, thanks for you Mingle review.

Aaron Jensen Says:

You’re right, IoC and DI are not the same thing. DI is a pattern, an IoC container is something that enables that pattern to work “magically”. Sure that’s a bit confusing, but I certainly find it much easier to explain dependency injection first before trying to introduce someone to a container that performs that injection.

I don’t think OOP == Fluent interfaces by any stretch… but Fluent interfaces is definitely similar to method chaining. Or rather, it is method chaining, but in a more complicated way. I understand it as method chaining with a grammar. Perhaps fluent interfaces isn’t the best name for it, but it’s a name, and it’s stuck so I don’t see any problem living with it. Regardless, it describes a specific pattern and I don’t think simply calling it OOP or method chaining is descriptive enough.

I will take a look at the object models you mentioned.

hammett Says:

Ok, I will try to do it myself. :-)

I invented a new constructor pattern that receives three arguments. I call it Triad Constructor. Let’s see if that sticks ;-)

Mike Says:

Um…why not Trinity Constructor? :)

Jeremy Gray Says:

I do think you’re ragging on Fowler a bit unnecessarily here. He’s the first to point out in each of his books that he isn’t inventing these things, he’s capturing them from the experiences of his clients and associates. Sometimes they all agree on names for things, sometimes they don’t, and he’s usually quite good about pointing out those occasions and even times when he regrets having pushed the wrong name for something.

It is also worth pointing out that he didn’t invent the “fluent interfaces” term out of thin air. The funny part of your post is that the term came from a discussion he had with Evans, whose web site you were more than happy to tout as containing a good example.

What I find interesting about the whole fluent interfaces meme that has been going around in the last couple of years is that no one seems to be talking about how this has been tried before (apparently by the Smalltalk camp) and abandoned in all but a very few scenarios. Now _that_ might make for a more interesting series of posts.

Casey Says:

Calm down Hammett!!! Take a deep breath …

I agree that there are just too many buzzwords these days, and we probably don’t need another, but at least everyone understands the term Fluent Interface – even if it isn’t brilliantly named.

DI and IoC I agree wholeheartedly on though :)

hammett Says:

Jeremy, I’m completely aware of that. He does point out that he’s not inventing anything, but can you say that’s the perception of the majority of developers that skip the introduction of small lines on his books?

That man wrote about IoC/DI and it was a complete disaster. He didn’t get it. Why venturing on fields with only a cursory look on IoC containers projects web sites?

But yes, as usual I agree with you.

hammett Says:

Casey, I’m not angry/mad or anything like that. I was just trying to point out that we should never accept things without critic, without a pinch of skepticism. That’s healthy. We’re not software developers fundamentalists :-)

Patric Says:

Hi

Im one of those that often says DI = IOC. Can somebody point to some site which describes the difference between those concepts.

Steve Freeman Says:

I’ve responded on Ayende’s blog, but just wanted to emphasise that Fluent Interfaces (a name that came after the fact for me) are not just about method chaining. Writing a good one takes a lot of effort and the implementation style of the “language” layer is completely different from the OO model below it or the client code above.

For more gory detail you might like to read our OOPLSA paper.

http://www.mockobjects.com/files/evolving_an_edsl.ooplsa2006.pdf

Eber Irigoyen Says:

and then there’s method chaining… and we complain that new developers don’t know how to use patterns… sigh…

Ricardo Stuven Says:

Piers Cawley made a good point on DSLs: “What characterises [them] isn’t their readability, it’s their narrow focus on their domain”.

On the other hand, “fluent interfaces” are all about readability. But, of course, one can find beautiful fluent DSLs…

Leave a Reply