A Curious Mind
#tastic

Data Services

Friday, November 21, 2008 11:38 AM

"Can I get a CustomerService with that?"

"No."

Why do we always gravitate towards the data centric services? I honestly believe its because its just easier to do. Data is always defined, whether its in DDL (CREATE TABLE ( Name char(4));) or in C# (private string _name;) we have solid ways to define data. These names and definitions make it easier for me to work with it. On top of this, it seems to me that the English language is good at describing nouns (really?), but for some reason when it comes to verbs I begin to falter (That is a brown, female, purebreed horse vs that horse can run like the wind, jump 20 feet high and dance the macarena) there is just something different in the feel of a noun being described versus a verb. I mean I am describing the noun still. Running (the thing) is an empowering experience. A workflow is a thing, the process is a thing. What is a verb? To Run, is moves me from point a to point b. Hmmmm...where was I going with this? anyways...

I ran into this naming problem last night when Chris and I were working on MassTransit. We were working on cleaning up the pipeline structure for incoming messages and we were trying a more functional approach, and I was tagged in to take the next step in the code, and I hit a big brick wall when I went to name a list of functions that returned a message consumer after doing a boolean check. What the hell do I call these things. My mind was so jarred by the lack of an object (no object here, just the function) that I couldn't come up with it (again showing my noun focus). I think I will get there, and as we worked the code a bit more I came up with better still ideas (I was starting to treat the function as a first class citizen). By the time it roles into the mainline I should have it nailed, but it served as a smack in the face that I have a ways to go.

So where is our DDL for functions (Func<TMessage, bool> check) is not the same. Its not the same because for data that's where it stops, but for a function the question is still, what is it, or rather what does it do? I think this is where we can learn alot about functional programming. Because maybe the real function definition is m=>m.InvoiceId == 2; which just happens to be a Func<TMessage, bool>...I can answer both what it is and what it does. But this is trivially simple. What if it were more complicated, like in real life?


Feedback

# re: Data Services

Formatting was a little off... :D 11/21/2008 11:33 PM | Robz

Comments have been closed on this topic.