Switch to standard view 
  Sybase logo
 
 
 



Choosing an UltraLite Programming Interface


 

A whitepaper from iAnywhere Solutions, Inc., a subsidiary of Sybase, Inc.

Contents

UltraLite: a real database for small devices
UltraLite choices
Choosing which interface to use
Choosing between components and static interfaces
Next steps

^   UltraLite: a real database for small devices

Software version 
This paper was written for SQL Anywhere Studio version 9.0.0.

UltraLite is a database for small devices running Palm OS or Windows CE. It also runs on Windows XP. It is a part of SQL Anywhere Studio, the market-leading data management and synchronization system for mobile, embedded, and SMB computing.

As business applications move to smaller devices, developers need to pay the same attention to data storage as in more traditional business applications. UltraLite lets you develop business applications for small devices by providing the following features:

UltraLite provides a variety of programming interfaces, so that it can be used from whichever programming language or development tool is appropriate for your work. If you wish to build applications using UltraLite, you have to choose which programming interface to use. This paper outlines how to make that choice.

^  UltraLite choices

UltraLite provides a variety of programming interfaces and integrates into several popular programming tools. Each interface uses the same underlying UltraLite runtime library.

The interfaces fall into two categories: components and static interfaces. Each interface has its own strengths and has particular cases for which it is an appropriate choice. For tips on choosing a programming interface, see Choosing an UltraLite programming interface.

^  Choosing which interface to use

Choosing which UltraLite programming interface to use depends primarily on your answers to the following questions:

The availability of more than one interface for C/C++ developers, and for Java developers, provides further flexibility.

^  Cross platform development for Palm OS and Windows CE

Your options are as follows:

^  Development for Palm OS only

Your options are as follows:

^  Development for Windows CE only

Your options are as follows:

Adaptive Server Anywhere 

If you are developing applications for Windows CE, you also have the option of using Adaptive Server Anywhere. Adaptive Server Anywhere provides more features than UltraLite, at the cost of a larger footprint. For example, Adaptive Server Anywhere provides stored procedures and triggers, more extensive SQL, and more advanced query optimization than UltraLite.

If you use the embedded SQL programming interface, you can code applications to be moved easily between the two databases.

^   Development for other platforms

UltraLite Static Java provides a pure Java solution for any platform supporting JDK 1.1.4 or later.

^   Choosing between components and static interfaces

UltraLite applications are built using either an UltraLite component or a static interface.

The choice of which to use depends partly on the language you wish to use. If you are a C#, Visual Basic, or JavaScript programmer, you should choose an UltraLite component. If you are a C/C++ or Java programmer, you have a choice between using a component or a static interface. This section compares components and static interfaces.

Data access features 

UltraLite components can use either dynamic SQL or a table-based API to access data:

You can combine dynamic SQL and the table-based API in a single application.

Static interfaces (embedded SQL, the static C++ API, and the static Java API) use SQL to access data. A wider range of SQL is supported in the static interfaces than in the components, but all queries must be specified at compile time (query parameters can, however, be specified at runtime). For example, UNION and FULL OUTER JOIN queries are currently supported only from the static interfaces.

The static C++ API also provides a table-based API, which shares the simplicity and limitations (such as lack of multi-table access) of the component table-based API.

Application size 

The UltraLite components include code to parse, optimize, and execute arbitrary queries. In contrast, the static interfaces generate code that executes specified queries, but do not need to generate code to parse or optimize queries. For this reason, applications built using the static interfaces are typically much smaller than those built with UltraLite components.

As the number of queries and tables in the database increases, the size advantage of the static interfaces is lost. For complex applications using many queries and addressing databases that contain many tables, the components can be smaller as they do not need to contain code for each separate query.

Development model 

Each UltraLite component exposes an object-oriented API designed to be familiar to users of the language supported by that component. The development model is similar to that for many other kinds of applications.

The UltraLite static interfaces require a more complicated development model. You model your database in an Adaptive Server Anywhere reference database, which must contain all the tables and indexes (although not the data) that you wish to include in your UltraLite database. A preprocessing step generates application code from the reference database.

For many users, the UltraLite components are easier to learn than the static interfaces.

Performance 

Queries included as part of an application that uses a static interface are already parsed and optimized. Therefore they may perform better than queries in UltraLite components. The optimization of queries in the static interface depends on the distribution of data in the reference database. The closer the data in the reference database is to that in the UltraLite database, the better the performance will be.

Compatibility with Adaptive Server Anywhere 

Embedded SQL provides a common programming interface for UltraLite and Adaptive Server Anywhere databases. Maintaining a common interface may be particularly useful on platforms such as Windows CE, where both databases are available. If you need to move from UltraLite to the more powerful and full-featured Adaptive Server Anywhere database, using embedded SQL makes migrating the application more easy.

^   Next steps

Each UltraLite programming interface has its own book. To develop UltraLite applications, you should look at the UltraLite Database User's Guide and at the individual book for your interface. The version 9 books can be found here:

^  



Back to Top
© Copyright 2010, Sybase Inc.