I threw something together that does dependency injection for this mobile project I’m working on. You see with mobile, you’re kinda limited with what you can do. There’s no reflection, no runtime dynamic class loading, not even a Url object. So this seemed like something of a challenge. But I got something… something that does dependency injection… something that wires the app together. It’s really crude right now using a properties file, but I’m looking to support a subset of the Springframework XML schema. I think I can have this working if I give a solid eight hours on it.What I’m dreaming up is the FallFramework. And how appropriate. It started in the fall and it’s similar to the Springframework.
How did I do it?
I did what any developer would do with no classloader, no reflection and one hand tied behind my back. I code generated. Why code generation? It stinks right? Code generation is soo last 2003 with the smell of anti-pattern engulfing it’s very name. Why would I go to such extremes, especially for a mobile app? I’ll tell you in one word, Test Driven Design. (Yeah that’s three words but I spell it as T.D.D. which makes me right and you dumb yet you continue to read after being intentionally insulted which makes you unbelievably stoopid while you still read past a second disrespectful and intentional remark which makes me unbelievably arrogant knowing I have your undivided attention this far leading to yet more clever ways to sneak derogatory insinuations across your faithfully reading pupils.) That’s right, Test Driven Design calls for some means of assmbling or putting togther the app which calls (collect) for dependency injection. Since I’ve sworn off writing even one package statement without a preceding test case of some sort I need a D/I solution so that I can be productive. With one no code would be written because I can’t write a test for a class that’s hardbound to another class. So now I have a temporary solution involving code generation.
So whatd’ya think? Is there something out there already that can wire a J2ME app together? Please tell me b/c I’d love to just drop it into my project and run with it. Does it sound feasible, what I’m attempting, I mean. Has anyone else tackled this problem? If so, what did you do? Spil your grey matter in the square below while I interrogate for any useful ideas. I may need you to sign a waiver indicating that any think meat, ideas, brainstorming sessions left on this site becomes property of yours truly. Drop the science on me…
(Dropping science is a term I first encountered in the early nineties among some of my hip-hop speaking bretheren. It refers to the processes of divulging knowledge which is considered “heavy”, revealing, or insightful in some way, knowledge which commands the respect of those who receive it.)