This post originated from an RSS feed registered with .NET Buzz
by Udi Dahan.
Original Post: How should I pass data between tiers?
Feed Title: Udi Dahan - The Software Simplist
Feed URL: http://feeds.feedburner.com/UdiDahan-TheSoftwareSimplist
Feed Description: I am a software simplist. I make this beast of architecting, analysing, designing, developing, testing, managing, deploying software systems simple.
This blog is about how I do it.
In my opinion, email is definitely an option for getting data between machines. It's internet scale already. There are tons of implementations that interop just great.
Actually, there are tons of ways of getting a bunch of bytes from one machine to another. I think that it's a solved problem.
For some reason, its not a very popular answer to the asked question. In the following discourse, mention is made of how this is an architectural issue.
The most important understanding that can be gotten out of the above answer is that the question is not how to pass data between tiers, but rather how both sides understand the data that will be passed between them. This insight is really important because we no longer deal with the implementation details of the transport.
The next step is to realize that our intent needs to be passed inside those bytes.
Which means we're not just sending "data", but data and intent. Let's explicitly call this a message.
When your code wants to send that message, do you think that it needs to be tied to where that other machine is? The code that calls the infrastructure and asks it to send this message to that location; how in heck does it know where that location is, or will be tomorrow? The answer is, it can't.
So, what we want to tell our infrastructure is this: Send this message.
Where?
Well, wherever that message has been configured to be sent to. That's a transport level detail, application level code shouldn't see it.