| [ directory ] |
|
2.3 Key Concepts of the J2ME ArchitectureWhile connected consumer devices such as cell phones, pagers, personal organizers, and TV set-top boxes have many things in common, they are also extremely diverse in form, function, and features. Information appliances tend to be special-purpose, limited-function devices. To address this diversity, an essential requirement for the J2ME architecture is not only small size but also modularity and customizability. In general, serving the information appliance market calls for a large measure of flexibility in how computing technology and applications are deployed. This flexibility is required because of
The J2ME architecture is intended to be modular and scalable so that it can support the kinds of flexible deployment demanded by the consumer and embedded markets. To enable this, the J2ME environment provides a range of Java Virtual Machine technologies, each optimized for the different processor types and memory footprints commonly found in the consumer and embedded marketplace. For low-end, resource-limited consumer products, the J2ME environment supports minimal configurations of the Java Virtual Machine and Java libraries that embody just the essential capabilities of each kind of device. As device manufacturers develop new features in their devices or service providers develop new and exciting applications, these minimal configurations can be expanded with additional libraries that address the needs of a particular market segment. To support this kind of customizability and extensibility, three essential concepts are defined by the J2ME architecture:
Configurations, profiles, and optional packages are discussed in more detail below. Configurations, profiles, and optional packages use the capabilities of the Java Virtual Machine (JVM), which is considered to be part of the configuration. The virtual machine usually runs on top of a host operating system that is part of the system software of the target device. The high-level relationship between the different software layers梩he JVM, configuration, profiles, optional packages, and the host operating system梚s illustrated in Figure 2.2. Figure 2.2. Software layers in a J2ME device
J2ME configurations, profiles, and optional packages are defined through industry collaboration using the Java Community Process (JCP). For further information on the Java Community Process, refer to the Java Community Process web site (http://jcp.org/). 2.3.1 ProfilesApplication portability is a key benefit of Java technology in the desktop and enterprise server markets. Portability is an equally critical element in the consumer device space. However, application portability requirements in the consumer space are very different from portability requirements demanded by the desktop and server markets. In most cases, consumer devices differ substantially in memory size, networking, and user interface capabilities, making it very difficult to support all devices with just one solution. In general, the consumer device market is not so homogeneous that end users can expect or require universal application portability. Rather, in the consumer space, applications should ideally be fully portable within the same device family. For example, consider the following types of consumer devices:
It seems clear that each of these represents a different market segment, device family, or application domain. As such, consumers would expect useful applications to be portable within a device family. For example:
On the other hand, consumers do not expect the stock trading application or an automobile service program to run on the washing machine or the toy robot. In other words, application portability across different device categories is not necessarily very important or even meaningful in the consumer device space. In addition, there are important economic reasons to keep these device families separate. Consumer devices compete heavily on cost and convenience, and these factors often translate directly into limitations on physical size and weight, processor power, memory size, and power consumption (in battery-powered devices). Consumers' wallets will usually favor devices that have the right functionality at the right price. In other words, the devices must perform the desired functions well, but they do not have added cost for unnecessary features. Thus, the J2ME framework provides the concept of a profile to make it possible to define Java platforms for specific vertical markets. A profile defines a Java platform for a specific vertical market segment or device category. Profiles can serve two distinct portability requirements:
It is possible for a single device to support several profiles. Some of these profiles are very device-specific, while others are more application-specific. Applications are written "for" a specific profile and are required to use only the features defined by that profile. Manufacturers choose which profile(s) to support on each of their devices, but are required to implement all features of the chosen profile(s). The value proposition to the consumer is that any application written for a particular profile will run on any device that supports that profile. In its simplest terms, a profile is a contract between an application and a vertical market segment. All the devices in the same market segment agree to implement all the features defined in the profile, and the application agrees to use only those features that are defined in the profile. Thus, portability is achieved between the applications and the devices served by that profile. New devices can take advantage of a large and familiar application base. Most importantly, new compelling applications (perhaps completely unforeseen by the original profile designers and device manufacturers) can be dynamically downloaded to existing devices. At the implementation level, a profile is defined simply as a collection of class libraries that reside on top of a specified configuration and that provide the additional domain-specific capabilities for devices in a specific market segment. In our example above, each of the three families of devices (cell phones, washing machines, and intercommunicating toys) could be addressed by a separate J2ME profile. The only one of these profiles in existence at the current time is the MIDP, designed for cell phones and other two-way communication devices. 2.3.2 ConfigurationsIn the J2ME environment, an application is written "for" a particular profile, and a profile is "based upon" or "extends" a particular configuration. Thus, all of the features of a configuration are automatically included in the profile and may be used by applications written for that profile. A configuration defines a Java platform for a "horizontal" category or grouping of devices with similar requirements on total memory budget and other hardware capabilities. More specifically, a configuration:
The J2ME environment is designed so that it can be deployed in more than one configuration. Each configuration specifies the Java language and virtual machine features and a set of libraries that the profile implementer (and the applications using that profile) can safely assume to be present on all devices when shipped from the factory. Profile implementers must design their code to stay within the bounds of the features and libraries specified by that configuration. In its simplest terms, a configuration defines a "lowest common denominator" platform or building block for device manufacturers and profile implementers. All the devices with approximately the same amount of memory and processing power agree to implement all the features defined in the configuration, and the profile implementers agree to use only those features defined in the configuration. Thus, portability is achieved between the profile and the devices served by that configuration. In our example above, each of the three profiles (for cell phones, washing machines, and electronic toys) would most likely be built upon the same configuration, the CLDC. This configuration provides all the basic functionality to serve the needs of each of these, and perhaps many more, profiles. To avoid fragmentation, there are a very limited number of J2ME configurations. As depicted in Figure 2.1, only two standard J2ME configurations are available:
Figure 2.3 illustrates the relationship between CLDC, CDC, and Java 2 Standard Edition (J2SE). As shown in the figure, the majority of functionality in CLDC and CDC has been inherited from Java 2 Platform, Standard Edition (J2SE). Each class inherited from the J2SE environment must be precisely the same or a subset of the corresponding class in the J2SE environment. In addition, CLDC and CDC may introduce a number of features, not drawn from the J2SE, designed specifically to fit the needs of small-footprint devices. Figure 2.3. Relationship between J2ME configurations and Java 2 Standard Edition
The most important reason for the configuration layer in the J2ME environment is that core Java libraries needed across a wide variety of Java platform implementations are usually intimately tied with the implementation of a Java Virtual Machine. Small differences in the specification of a configuration can require a number of significant modifications to the internal design of a Java Virtual Machine and can require a substantial amount of additional memory footprint. Such modifications would be very expensive and time-consuming to maintain. Having a small number of configurations means that a small number of virtual machine implementations can serve the needs of both a large number of profiles and a large number of different device hardware types. This economy of scale provided by the J2ME environment is very important to the success and cost-effectiveness of devices in the consumer and embedded industry. 2.3.3 Optional PackagesSoon after the introduction of the original CLDC and MIDP standards, it was realized that, in addition to configurations and profiles, there is a need for additional, general-purpose libraries that are not bound to a single device category or family. For instance, a location API that provides facilities for geographic positioning is potentially applicable to a broad number of devices and device families, and is not functionally limited only to a single profile. Similarly, a wireless messaging API could potentially be applied to a number of different types of devices and profiles. To address the need to create such broadly applicable, device family independent APIs, the concept of optional packages was added to the architecture of the J2ME platform. Generally speaking, a J2ME optional package is an API that can be used to extend a profile. An optional package exposes specific functionality independent of any profile and is naturally distinct from any profile. Optional packages provide APIs that are intended for reuse by profile design teams and vendors of J2ME environments. It is expected that optional packages may sometimes play an important role in the evolution of a profile. As APIs are developed for new technologies and features, the new APIs are initially developed as optional packages. However, as those APIs mature and new versions are created through the Java Community Process, optional packages may later be incorporated into a profile. A summary of J2ME optional packages created so far for the wireless market is provided in the next section. |
| [ directory ] |
|