Latest Source Changes - Move to Generics

Coordinator
Feb 26, 2010 at 12:40 PM

The latest source has undergone some very large changes. The reasons for these changes are numerous, but believe it or not it all started with the flickr.photos.getFavourites method.

Basically, this method returns some XML like this: <photo><person>person a</person><person>Person B</person></photos>

Using the previous method of the built in XML serialization this would have meant adding a Persons property to the PhotoInfo class (which is what 'handles' a root <photo> element). This seemed very wrong to me and I wasn't happy with the solution.

Also, the <photo> element can have page and total attributes, much like the results from a photo search, but I also though that the PhotoInfo class was definitely the wrong place to have these attributes.

 

So, I had to develop a mechanism to part this XML different from other XML. I'd been working on some 'futures' type code using Generic, which basically meant I could handle these scenarios well, I just need to back-port that code into the current codebase.

 

I've also split out the Flickr.cs file into a number of partial classes. This work isn't finished yet but hopefully this will get rid of the bloated 5000+ line file and make the code more manageable.

We support for some new methods, most notably flickr.panda.getList and flickr.panda.getPhotos. Many more are currently missing and I hope to add them in the near future.

 

Sam