The amazing adventures of Doug Hughes

Model-Glue event-hander?

Has anybody ever heard of a Model Glue “event-hander”? (Notice the misspelling of the word “handler) Apparently Model Glue 1.1 has. For a bit of background, I was recently working with an old Model Glue 1.1 application and we decided it was time to upgrade it to Model Glue Unity. Upon doing so, several of the events quit working and started giving the standard “There is no known event handler for …” error message.

For the life of me, I could not figure out why only a few events in this application “vanished”. I spent several hours tracing things, dumping errors, view states, and everything in between trying to figure out what was wrong. Finally in desperation, I started over – at least as much as I could. I create a new “test” event handler which worked just fine. Then, I started moving functionality out of one of the broken event handlers into the test one and everything still worked just fine. I even changed the name of the test event handler to match the broken event handler – and it worked.

At that point, I happened to notice the lines were different lengths between the original event handler tag and the new one I had just created. The new one looked like this:

<event-handler name="AssignCase">

and, the old one looked like this:

<event-hander name="AssignCase">

Anybody see the difference?

After finding this, I still cannot figure out how the application has been running all of this time. I went back and checked out Subversion logs and this typo had been in place for more than a year and the whole time the application worked just fine under Model Glue 1.1. I think Joe has some explaining to do here …..

Comments on: "Model-Glue event-hander?" (8)

  1. Brian Kotek said:

    Not having the MG 1.1 source (since it’s two years old) I can’t point out why, but I can imagine any number of possibilities. How about looking for XMLChildren of the event-handlers node since the only valid children had to be event-handler tag sets? Or looking for nodes using XPath in the event-handlers node and knowing that the only thing close to a match starts with “event-“? I’d guess it’s probably just a simple bug along those lines.

    Like

  2. Joe Rinehart said:

    Hey Jeff,

    “I think Joe has some explaining to do here …..” sounds kinda snarky. You work with the guy who wrote the DTD, which you’ve got in /ModelGlue/modelglue.dtd. Using it would’ve found the error pretty quickly.

    Tech explanation:

    MG 1.1 would accept any child of as an event handler.

    Like

  3. Jeff Chastain said:

    Sorry Joe, no offense meant.

    It was just one of those really bizarre issues and was fairly hard to track down due to the fact that a single letter typo is usually hard to see and not what I was expecting to find as the issue.

    Like

  4. Brian Ghidinelli said:

    I ran into a similar thing last week and talked about adding the DTD to your model-glue.xml file to validate on the fly and highlight any problems in Eclipse:

    http://www.ghidinelli.com/2008/01/23/validating-modelgluexml-against-dtd-in-eclipse/

    This has saved me a few hours of banging my head already in the past week!

    Like

  5. Sean Corfield said:

    I think this just shows the importance of using an XML editor with DTD (or XSD) validation.

    What you’ve shown is that your application was broken but just happened to work due to a bug in MG1.x. I think it’s extremely ingenuous of you to try to blame Joe Rinehart for your own shortcomings…

    Like

  6. Doug Hughes said:

    @Sean and @Joe – Hey guys, I think Jeff was trying to be light hearted about this. Sorry if you took offense, twasn’t the intent.

    Like

  7. I loved the way you exlpained things. Much better many here

    Regards
    Kristina

    Like

  8. Great info and hopefully I can walk thru this with my XML editor.

    Like

Comments are closed.

Tag Cloud