Itemlists

This week I had intentions to implement a ton of features, but I got fairly stuck working on searching inside a channel.  It was easy enough to add a search to some of the views, but to make it work in the static tabs, the channels and the playlists at the same time without a lot of hacks was not very easy.  In general that code seemed very complicated and slightly convoluted, so I decided it was time to refactor.

I ended up splitting the module into 3 different ones, each one handling an aspect of MVC.  itemlist now only handles modeling the data — storing lists of items, filtering them by search terms, sorting them, etc.  itemlistwidgets was created that just had a bunch of “dumb” Widgets that would display things to the user, but only handled the presentation logic.  Finally itemlistcontroller had classes thta handled the rest of the logic, responding to user input, handling updates from the backend, etc.

All in all, I’m pretty happy with the new code.  It definitely made it much easier to implement searching, and I think sorting shouldn’t be much of a problem either.  I’m not all that happy that I took a week to implement a relativetly simple feature, but I guess that happens sometime.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment