Smart
CODE
|
Your on-line guide to the generated code
|
Before we begin
- Smart Code is very straightforward. As well as the interface code generated
by X-Designer, and callback stubs, you can also choose to generate
extra Smart Code for
- Apart from a global header file, all the new code is generated into subdirectories.
These directories are
named according to their function and the language you chose. So, Motif
specific code generated in c will be in the subdirectory motif_c,
callouts (stubs that are intended for you to program) in java will be
in callouts_java.
- For C and C++, all the new code is glued together through the Makefile.
For java, the arrangement of packages is such that the command
$ javac *.java
will build everything (if you are using the right JDK and your CLASSPATH is
set up properly.
If you are generating code for the Java JDK 1.1, two shell scripts are generated:
For the 1.0 JDK, javac10.sh and java10.sh are generated.
- It helps to take Smart Code on a "need to know" basis.
For both Thin-Client and Internet Smart Code
you can configure your internet connection at runtime with routines
to use/change proxy settings, the URL itself and any extra data
sent as part of the URL.
If you are using Get/Set Smart Code
you will write your code in the callouts_* directory. Callout files
have the suffix _user. Thin-client and Internet stubs have
the suffix _cs so if you switch style, your original _user files
will not be touched, but will no longer be referenced in the Makefile.
If you are using Thin-Client Smart Code
You can just build the client application
$ make
without any coding,
and write your application entirely in the server, built with the command
$ make server
You can check the user's data, and/or the data returning from the server,
and abort the callback at either point.
You can control the data that is sent down to the server by making some
(or all) interface elements in your group private and using
extra data elements in the group to send (and receive) data in a
different form if that is more appropriate for your server.
You can override the internal data handling code by defining Send and
Receive handlers.
You can handle error conditions using the Out of Band Handler.
If you are using Internet Smart Code
You have to provide a Receive Handler to process the data.
You can process the incoming data as a stream, or you can use the Smart Code
InputData to load the data automatically so you can acces it through getData() and getSize()
methods.
If you want to POST data to a web server, you provide a Send handler.
If you want to process URLs in HTML, you don't need to
parse the HTML yourself. Smart Code allows you to express an interest
in particular features of the input stream (much like you set up callbacks
on the interface), and then "pick out" these features as they arrive.
You don't need to write or use a traditional parser to process
HTML.