Monday, July 21, 2003

Dare:
However since the entire point of object oriented programming is to tie together data and behavior, XML is actually a pretty dumb way to serialize objects in any programming language. It is a handy way to serialize the state of Java (or .NET Framework) objects though.
Amen, brother. I wish I'd had this quote handy when having this argument a couple weeks ago. At the time, I described a web service this way: "Conceptually, we have a black box that takes XML as input and output; i.e., a transform. The things we're dealing with are data, not objects - the objects produced by Castor have no behavior (aside from ordinary container type behavior), and no useful type and therefore fail the whole point of Object Orientation. What programmers want and need (whether they realize it or not) is a way to associate names with data, not to strongly type it." In a statically typed language, XML Serialization gives names to data, at the cost of introducing a whole lot of noise in the object model. It makes it easier to program in Java, but my opinion is that since the fundamental process is a transform, what would be better is a language to describe transformations.
4:37:57 PM  permalink Click here to send an email to the editor of this weblog. 


Stories
DateTitle
1/23/2003 Why XML?
8/13/2002 Resolution for IE and Windows problems
8/10/2002 Supporting VS.NET and NAnt
5/11/2002 When do you stop unit testing?
Contact
jabber: weakliem@jabber.org
YM: gweakliem
MSN: gweakliem@pcisys.net
email: Click here to send an email to the editor of this weblog.
Subscribe to "Gordon Weakliem's Weblog" in Radio UserLand.
Click to see the XML version of this web page.