Normalizing

Now that there’s pulled data it should be normalized. What does that mean? For strings they shouldn’t look like they were formatted for a computer and instead of those pesky arrays full of links they should populate lists of what the links point to.

The names thing is pretty straightforward. I was going to have a unique if-statement for each kind of key so they look better but sweet peppered okra that’s way too many if-statements. They’re not particularly masked so instead I’ll do some simple String conversions.

The arrays of links is another thing entirely. All web requests are being done asynchronously so as not to tie up the UI thread so doing some more won’t be too bad. Another method called by the async thread isn’t a problem. Pulling all that data is going to get annoying but I’m trying to stay away from using a client-side database; cached files are the limit I’m willing to go (there’s no need for me and the API guy to hold the same info, that’s silly).

Fortunately the caching helps since the normalization process is happening with the data pull they’ll be stored normalized and can be retrieved normalized. The regular cache update rules (currently at 5 minutes but that does seem a tad aggressive) can be followed.