in Search
Welcome to Neopoleon - Sign in | Join | Help
Navigation: Home | Forums | Galleries

Steve explains

Steve Maine put his ginormous brain to use in whipping up a late-night answer to my troubles in "getting" Prothon.

Thanks, Steve :) Good stuff.

After reading Steve's article, I've decided that for my own uses, Prothon would be:

1) Fun at home

2) Dangerous at work

One quote from Steve's post that has me thinking a bit, though, is the following:

The inherent extensibility and open content model of XML makes coming up with a statically typed representation that fully expresses all possible instance documents impossible. Thus, it would be cool if the object representation could expand itself to add new properties as it parsed the incoming stream.

I can see how this would be cool in a "Hey, that's cool" sense, but I don't see how it would help me at work. I fully admit that I might just be stupid, but I'm honestly having a hard time seeing the benefit. Right now, I'm grabbing XML in the traditional fashion of providing the name of the node that I want as a string key, and it seems to be working just fine.

However, there's more that I don't get.

If properties are being dynamically added to an object at runtime, then how are those properties accessed? Do you also have to modify the consumer? Otherwise, how would it know that new properties had been added to an object and that they could be called?

Or, would the properties be tagged with some sort of metadata that tells the caller how to handle the new properties? If that has to happen, then I'm really not seeing the benefit. It sounds like more work would have to be done just to know that your code is making use of properties instead of string keys to deal with XML.

It sounds like the benefits would really just be in automation of a process. If that's the case, then why should we care how it's done? From my point of view, properties are a design-time convenience for coders. At runtime, I don't care how data is being accessed.

Am I just really thick? I want to get this, but I feel like I'm missing something big.

Published Saturday, March 27, 2004 5:02 PM by Rory

Filed Under:

Comments

 

Iain said:

You could definitely use this as something like .net's xml serialization
March 28, 2004 4:11 AM
 

Jason Bunting said:

When I consume XML, I usually have an xsd file telling me what can be there, so I know how to handle it, and the business rules usually dictate what I do with what comes in . . . So I too am ignorant of its practical use (emphasis on the word practical, I am sure someone could do something crazy with it, but I wonder what useful things can be done with it. I will do more reading . . .)
March 28, 2004 7:11 AM
 

Kim Gräsman said:

"If properties are being dynamically added to an object at runtime, then how are those properties accessed? Do you also have to modify the consumer? Otherwise, how would it know that new properties had been added to an object and that they could be called?"

It's no different from providing the name of the node, is it? The XML structure (schema, if you will), dictates the structure of the object model.

Caveat: I didn't read the article you referred to, and I generally agree with your sentiment.
March 28, 2004 5:48 PM
 

Larry O'Brien said:

"I don't see how it would help me at work...."
Remember that in decent dynamic languages you have an interactive workspace -- you try something out, it doesn't work, you can refactor something "up" the inheritance chain, highlight your code, run it again, it works a little better...

F'rinstance, last week I wrote something that spiders Amazon's similarity rankings (to try to see if there were _any_ books that both Java and C# programmers read: the answer is no). Doing the search and display layout algorithm was where the fun was, but spidering Amazon could take, oh, half an hour per run. In a dynamic language, my spidering results would hang out in the workspace. In C#, I had to realize that spidering was taking a long time and make a note to myself to serialize the results, and now I'll have to write that code, introduce "Load graph from disk..." as an option, etc.
March 28, 2004 5:58 PM
 

Rory said:

Larry -

"In C#, I had to realize that spidering was taking a long time"

DUH. I think the obvious solution is to write your app in assembly.

Seriously, though, that sounds interesting. I think I'm going to have to see this stuff in action, though.

You going to be at Tech Ed?
March 28, 2004 6:01 PM
 

http://www.NhipCauNhaDat.com said:

March 4, 2006 11:00 PM
 

http://www.IndochinaQuest.com said:

May 10, 2006 1:32 PM
 

TrackBack said:

The Holy Grail in XML
March 28, 2004 7:00 PM
 

TrackBack said:

Dare's Holy Grail vs. Rory's
March 29, 2004 5:02 PM
 

TrackBack said:

Dare's Holy Grail vs. Rory's
March 29, 2004 5:03 PM
 

TrackBack said:

The Holy Grail in XML
March 29, 2004 6:17 PM
New Comments to this post are disabled

About Rory

I *own* this site, you loser.