Life, Technology, and Meteorology

Last Minute Design Changes

It’s really quite amazing to me just how many semi-major design changes can come up when nearing the end of an initial development cycle. Seasonality, for instance, has had quite a list of things come up just in the past few days, even though I “froze” the features I would include over a week ago.

One of them is a URL Manager. For each weather location that Seasonality monitors, it makes 4 different network connections to download weather data. This is fine when you only have 1 or 2 locations, but when I use it with 5 locations Seasonality creates 20 background threads to download data, which is far from ideal. One of today’s tasks is to create a class to buffer the amount of connections that are active and give one more layer of abstraction from the classes trying to fetch data.

Another semi-major design change was for using an XML-RPC connection. Mac OS X has stuff built-in to create XML-RPC connections, but they don’t support a WSDL configuration. There is a way around this using a WSMakeStubs application included with the developer tools, where you point it to the WSDL file you want to use and it will create a couple of class files for you with an implementation. It takes awhile to adapt to your project, especially since there a few bugs in the code it creates. I got it working pretty well fairly early on in the development process. Unfortunately, now that 1.0 release is coming up and I’m starting to seal up memory leaks, I found a pretty major one in the code while exiting the run loop after getting the data. I fought with it for several hours, but ended up determining that the bug was somewhere in the CoreServices Framework that I didn’t have access to, so I couldn’t find a way to fix it.

So back to the drawing board. It was pretty frustrating having to re-implement a feature that I thought was already done, but I found some helpful stuff online to work through it. Brent has an example XML-RPC project that creates a connection through CURLHandle to retrieve information. I already use CURLHandle with my other connections, so it was very convenient to use it here as well. I wrote my own small parser to remove the SOAP wrapper around the XML response and everything works great. In fact, the implementation I have now is faster than the old “official” method of doing it, by a large margin.

Anyway, these and other issues are adding quite a bit of time to the completion of version 1.0. In the end I’m sure all of this will pay off, but in the mean time it’s a lot of work.

1 Comment

  1. Gus Mueller

    Yea, I’ve found the xml-rpc implementation that apple supplies to be kind of crashy and slow. So I wrote my own of course 🙂

    It’s actually a quick port of apache’s java version of xml-rpc, and it uses the webkit url classes (instead of curl) + NSXMLParser to do the parsing. And I ended up stealing part of Brent’s as well to make the request 🙂 It’s also asynchronous, which can be handy.

    So I guess that would make it a set of “FrankenXMLRPC” classes.

    If you’d ever like to use it for a future project, just let me know.

© 2022 *Coder Blog

Theme by Anders NorenUp ↑