Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop Client applications


Develop client applications

A client application performs business logic and makes use of the framework provided by an underlying client. Developing the code for a client application depends on the objects and functions to exploit, and the programming model to use.

Install the software development resources needed to develop client applications for use with WAS. During code development, you do not need access to the WAS. However, to assemble some types of client applications install files for the client that provides the framework for the client application. Instead of installing WAS you can install the Application Client feature, which provides the same resources and clients to aid development of client applications. To use a client application to access a remote object on an application server, develop your client application code as described in the following steps and the related topics. These topics only describe the client-specific considerations; they do not describe general client programming models, which you should already be familiar with. Samples for different types of client applications are provided with the Application Client.


Procedure

  1. Choose the type of client to use as a framework for your client application. Decision factors for choosing a client include whether to run a client application on Java EE or J2SE; whether you want ease of use with a small installation footprint or full-function with medium-large footprint; and whether you need licence to copy or redistribute the client. For more information about choosing the type of client, see Choosing a type of client.
  2. Develop the client application code. The following substeps are a high-level general procedure. Information specific to a type of client is given in the related tasks.

    1. Create an instance of the object to access on the remote server. We can use full JNDI support to get a suitable reference to administered objects from the server's JNDI namespace. Alternatively, you can get suitable references to objects programmatically without using JNDI.

      Use the javax.naming.InitialContext class, the client application program uses the lookup operation to access the JNDI namespace. The InitialContext class provides the lookup method to locate resources.

      We can compare the use of JNDI and programmatic techniques by looking at the samples provided for the Java EE client and Java thin client in an Application Client installation (for example, in C:\wac70\samples\src\):

      • Java EE client use of JNDI for BasicCalculatorHome: TechnologySamplesJ2EEClient\BasicCalculator\com\ibm\websphere\samples\technologysamples\basiccalcclient\BasicCalculatorClientJ2EE.java
      • Java thin client programmatic retrieval of BasicCalculatorHome: TechnologySamplesThinClient\BasicCalculator\com\ibm\websphere\samples\technologysamples\basiccalcthinclient\BasicCalculatorClientThin.java

    2. Create a connection to the server. If the server runs with security enabled, you can configure secure connections.
    3. Work with the objects to perform your business requirements. For example, send and receive JMS messages, update database entries, handle error conditions, and close resources used.

  3. Compile or assemble the client application. This creates the JAR or EAR file that you can deploy to make the client application available for use.

    To compile your client application, include the JAR files needed in the CLASSPATH setting for the javac command; for example, any extra JAR files for the client application's own classes, JAR files for IBM Thin clients used, and JAR files for JDBC provider classes.

    Attention: IBM-provided clients are not packaged with JDBC provider classes. For example, the WAS v7.0 Java Thin application client is not packaged with Apache Derby 10.2 classes. If your client application needs to use a database class (such as through the JNDI lookup of a datasource), obtain the class files from the database provider and make them available when compiling and running the client application.


What to do next

After you develop a client application, deploy it into the environment you want it to run.


Related


Develop stand-alone thin client applications
Develop a Java EE client application
Develop a Java thin client application
Develop ActiveX client application code
Develop applet client code
Application Client for WAS
Types of client applications
Develop applications that use JNDI
Deploy client applications
Choosing a type of client
Deploy client applications
Install, updating, rolling back, and uninstalling the Application Client for IBM WAS


Related


Lookup names support in deployment descriptors and thin clients

+

Search Tips   |   Advanced Search