Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

Data Transfer Objects Are a Type of Message

Jeremy Miller posted a reply to my Intro to Web Services post/presentation entitled Pragmatic viewpoints on SOA, where he questions coding WSDL by hand, but agrees with my stance on decoupling the message contract from the business object.  A lot of the content from my talk isn’t embedded in the presentation, so some things may be a little vague.  No, I’d never, ever recommend coding WSDL by hand.  It screams for a tool to build it, and the WSCF tool I mentioned is a perfect for this.  But, I do promote spending as much time as possible on designing the actual message contract itself (i.e. the XML Schemas).

In the comments Jeremy talks about using XML serialization attributes to control the serialization of his Data Transfer Objects.  I did have a question on DTOs at the code camp, and my comment/opinion is that Data Transfer Objects are a type of message.  A message conveys only data and structure, and has no behaviors.  A business object has both data and behavior.  The example I gave in the class was that of writing a letter.  The letter contains a message, and it is up to the receiver of the message to read and comprehend the message.  If the letter isn’t written correctly, or uses words that reader doesn’t understand, there is no way for the sender to correct the problem.  The message has no control over how it is used.  I write blogs to help me practice my writing skills, since I’ve noticed that I can have problems getting my message across to readers that don’t know me (there is implicit information missing from my message which causes the reader to misinterpret it), thus the subtitle of the presentation “It’s All about the Message”.

The funny thing about Jeremy’s title, “Pragmatic Viewpoints on SOA” was that during the presentation I did bring up the Don Box Pramatics post, and said that I don’t care if you use Code First or Contract First, as long as you pay attention to the message, and ship a product.

Yes, Datasets are also a form of Data Transfer Objects, but unlike other DTOs, they abide by their own contract which is driven from their relational legacy (which is roughly two dimensional) and are only useful when the receiver of the message understands the Dataset contract.  So do not use Datasets as a replacement for messages sent via web services.

Published Sunday, February 26, 2006 8:35 PM by donxml
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems