2009年3月14日星期六

Understanding J2ME Application Models

摘抄自:http://developers.sun.com/mobility/midp/articles/models/

The management of an application - how it's started and stopped, when it can access system resources, how it discovers its initialization parameters - is shared between the operating system (or other system-level software) and the application itself. The application model defines how an application is managed and how management responsibilities are divided between the application and the underlying system. The Java 2 Platform, Micro Edition (J2ME) currently supports four different application models. This article describes each of them.

The Traditional Application Model
The simplest is the traditional application model, as described in Chapter 12 of The Java Language Specification. The entry point to the application is a static method called main(), as in this example:

public class MyClass {
public static void main( String[] args ){
// application starts here
}
}

The class that defines this method is usually referred to as the main class. To start the application, the Java Virtual Machine loads the main class and invokes its main() method.