Any wellfunctioning code that I have written I pack into my content generator and give access to via the YAML. The whole thing has gotten really ugly and desperately needs refactoring (it's in Perl and I am rewriting it in Stringtemplate) but it does help me with:
- the changes in the model that cascade down the frontends
- fixing a bug in one application that needs fixing in several others
- the fact that multi-platform model really is stressful since the brain needs to switch rapidly between different languages and platform APIs and this allows me to write code once and perpetuate data model changes on to all platforms.
So I think, take code of yours that works and wrap a codegenerator around it. It's better than using a framework where you don't know what's underneath. All the code is something you know and built.