Java Reference
In-Depth Information
The purpose of this discussion is not to give a list of all the differences
between Symbian smartphones. A more realistic approach is to handle a
few cases and learn how to apply a similar pattern to a similar problem.
We first outline some general approaches to handling diversity and then
examine diversity in specific areas to act as a reference.
4.1 General Approaches to Handling Diversity
We have a range of possible options for handling diversity. At opposite
ends of the scale, we have the multiple-implementations approach and
the feature-drop approach. Both are quite extreme when it comes to Java
ME on Symbian OS, which has much in common across the various
devices.
The multiple-implementations approach implies fundamentally differ-
ent implementations of the same functionality and the need to maintain
multiple JARs. Taking this approach further means that, for each device
model, you need to maintain a JAR file. The multiple-implementations
approach usually starts with being uneconomical and ends up as being
impractical. It should therefore be avoided.
The feature-drop approach implies that you totally remove a feature
from the application, which is very harsh, unless it is a case of a JSR that
is not supported. That might happen on Symbian OS but, generally, JSR
support on Symbian smartphones is very predictable.
The multiple-implementation and feature-drop approaches are more
suitable for handling fragmentation than diversity. Between these two
extremes, there are a few more moderate approaches that can be com-
bined to produce the fewest variants to cover most Symbian smartphones.
These are techniques such as:
Detection: The Java ME capabilities can be detected at various stages,
each involving different types of required action. We utilized detection
with the Java ME Detectors suite (see Section 3.1) and we use similar
techniques.
Adaptive code: Code that can handle variants in a simple way, without
major refactoring or code instrumentation is termed 'adaptive code'.
The same simple code can handle differences that may occur on
devices coming from different Symbian OS UI platforms.
Flexible and modular design: There are endless options when you
take this route. For example, you can create abstraction layers, apply
design patterns, or decouple functionality into modular subsystems.
Now we look at various areas in which diversity appears and examine
how to handle it in simple ways that combine those three approaches.
Search WWH ::




Custom Search