As开发者_如何学Go Blackberry developers we start the day with a much smaller toolbox than your everyday mobile developer. In addition the J2ME constraint means that we aren't able to take advantage of one of Java's core "features": an abundance of third-party frameworks including Guice.
That being the case, what are the best practices in app architecture for the Blackberry platform?
I'm looking for core frameworks and/or principles that answer perennial architecture questions like:
- How do we do dependency injection?
- How do we do test-driven development?
- How do we manage multiple API versions?
- How do we sneak in or emulate our favorite features from other Java versions?
Please highlight one principle or best practice per answer.
I gave a presentation where I touch on some of these topics at BlackBerry DevCon'10:
- Layout, Configure and Build Strategies for BlackBerry Apps
- Transcript of the talk
- Sample code
In this presentation, I touched on various techniques for managing multiple API versions using libraries and use of abstract factories that dynamically instantiate at runtime. I also offered some creative solutions to certain problems that arise when managing API versions across the inheritance hierarchy of BlackBerry Screen classes. In addition, I offered an example of how I do unit testing using J2MEUnit and a custom-written (and source-provided) test console GUI that runs in the simulator.
Retrotranslator has improved my development setup.
I got the idea from AtomicObject's Our Blackberry Development Environment.
I never got enums to work at all, and most Collections aren't usable, but generics and annotations save the day.
精彩评论