Table of Contents Previous Section
Changes to Java API
In Enterprise Objects Framework 3.0, the Java APIs have changed considerably. The changes to the Java APIs are summarized here:
- A two-letter prefix (EO) has been added to each Java class name. In almost all cases, the Java class name is now identical to its Objective-C counterpart.
- The Java package names have changed to the following:
- The basic classes (for arrays, dictionaries, and data) have become more like their Foundation counterparts than their Java counterparts. For example, ImmutableVector is now named NSArray and responds to count instead of size. MutableHashtable is now named NSMutableDictionary and responds to setObjectForKey instead of put.
- DecimalNumber is no longer available. Use java.math.BigDecimal instead.
- CalendarDate is now named NSGregorianDate.
- The root object is now com.apple.yellow.foundation.NSObject.
- Delegate interfaces are now declared as inner classes (within the appropriate class). For example, EditingContextDelegates is now EOEditingContext.Delegate.
com.apple.yellow.eoaccess
com.apple.yellow.eocontrol
com.apple.yellow.eointerface
com.apple.yellow.informixeoadaptor
com.apple.yellow.odbceoadaptor
com.apple.yellow.oracleeoadaptor
com.apple.yellow.sybaseeoadaptor
Note that the next.eo package has been split into two packages: eoaccess and eocontrol. Also note that Java APIs are now available for the EOInterface framework and the database-specific adaptor frameworks.
Note that for numbers and strings, you still use the classes java.lang.Number and java.lang.String.
Also note that changing to Foundation-style methods for the dictionary class introduces a subtle change. The Java Hashtable classes take the arguments in the key-value order. For example, the put method takes the key and then the value. NSDictionary takes the value and then the key. The conversion scripts change the order of the arguments for you.
Table of Contents Next Section