| «« Index for Mozilla Bug | Nice Quiet Day Off »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
Derek Lowe's (Ryan's older brother) words at Ryan's funeral
blog@ryanlowe.ca no more Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
Practical Use for DOM?
Andrew says about a project he's working on: The whole system is based around the notion of selective nodes that can have only certain types of children....The first thing I thought of when I read that was XML, DOM and a DTD. Did you look into using a DOM tree for the representation? If you use a DTD a good validating parser won't let you add XML nodes that violate the DTD. Then you can just use the DOM (model) to make the UI's the tree view (view) and then all you need is a controller (to complete the MVC pattern) -- in SWT the controller is the TreeContentProvider. The rules for the children types are in the DTD, separate from the implementations of the GUI and business logic. A group I worked with at Corel did the same thing. Ironically, they had us studying XML for a month solid beforehand. So when I saw the project with XML fresh in my mind I said "couldn't XML make this hierarchy?". They said "well we could but it's too complicated" ... classic NIH. After two months of battling and much distillation of requirements they finally agreed with me when our intermediate "tree" format ended up looking exactly like a DOM tree. I scrapped it and replaced it with DOM. My co-op term ended two weeks later ... and that team is no more -- let go this winter. Ah well, lesson learned. Posted at April 25, 2003 at 10:03 PM ESTLast updated April 25, 2003 at 10:03 PM EST Comments
1) I was not interested in a DTT or a Schema... we are slowly migrating our stuff to talk with UMI (the xml for uml i believe) used by ArgoUML to *draw* usecases.... so if anything we may adapt their memory object structure 2) I wanted domain specific methods without all the fluff and error handling and jdom (see my posts about exceptions) ... 3) I wanted something easily testable... it is nice that when you separate code and information about what the code should do (like using reflection) - but that can make the system more complex and less testable... 4) I do not know enough about DOM to know the difference between using it externally (aka as a data format and parsing it into memory) and internally (aka adding new sheeat into memory) or even about the various implemenations of DOM and SAX ... to know if it could handle the few simple things that i wanted like Good point "couldn't XML make this hierarchy" - i am still just a little skeptical about using it as an internal structure... once i get on a paid project to investigate this sheeat - hopefully i'll start using dom a little more internally too :) » Posted by: andrew at April 29, 2003 01:22 AMI don't blame you for being skeptical, XML et al is a lot of stuff. » Posted by: ryan at April 29, 2003 08:30 PM |