Having said that, it's my experience that the old adage about "don't optimize prematurely" still applies to mobile Java—just in a milder form: "don't get too carried away with early optimization". Not every optimization is an optimization that will matter to your user. It depends on the kind of application you are developing, the particular use case you are coding within the application, and how important it is to be able to run on low-end phones, which have the slowest processors and the smallest heaps.
Moreover, there are real costs of abandoning object-oriented design. Object orientation makes your code more maintainable, testable, and amenable to agile development processes that can help you cut your development time and stay competitive. These factors are especially important for vertical applications where there is enormous business value in rapid prototyping (using a toolkit of well-factored classes) and having a code base that can be quickly changed to meet constantly changing requirements. I find that selective use of traditional object-oriented techniques has made a big difference in my ability to spin off new software from old stuff, which has many times made the difference between winning or losing a contract, or between a happy or disgruntled customer. So use common sense, and don't throw the baby out with the bath water.
One thing I'm curious about and haven't had the chance to test: is performance and memory usage of the beefier CDC Java environments found (or available) on some high-end smartphones impacted as much by these optimization techniques as on the garden variety CLDC MIDP handsets? One thing I'm looking forward to in the coming year is the next major release of SuperWaba, which Guilherme Hazen promises will have a smarter compiler and register-based VM that obviate the need for many of these techniques. That will be another coup for SuperWaba, which seems on the whole to be staying one or two steps ahead of Java ME, at least on the mid- to high-end devices that support it. It's still my preferred smartphone and PDA SDK.
Posted by cervezas at 07:59:00. Filed under: Java development
Comments
Add Comment