I have a little problem to solve...trying to find an elegant solution that won't eat up a ton of memory. I do not have code to post for this as I'm looking for an approach at this point.
What I have is a menu - foreach section in the menu it will query the pages for the section. But, each section can have a different way of ordering the pages...via date...via page order...via tags...etc.
I would like to build this so that the code is portable and it's easy to add any new ways or organizing the pages down the road.
I could go the interface approach and implement via a class that pertains to the particular organizational method. But, it's certainly forseeable that sections could use the same org method...and this is where I'm getting confused.
It's not a bad practice to use interface or should I simply iterate through the section creating new instances of the org classes through each iteration? I feel like I'm missing something here but I'm not sure. Hope this is clear enough...maybe somebody has some advice for me.
Thanks