07-01-2011, 10:31 AM,
(This post was last modified: 07-01-2011, 11:27 AM by ashimo.)
|
|||||
|
|||||
Order Entry Sample Application
Order Entry Sample Application
NOTE: This version of the Order Entry Sample Application requires release 6.0 of the Curl RTE. Objective This document is intended to guide you through the process of evaluating the Curl technology, including the Curl language, runtime, and development tools. A sample application provides a concrete example that will help you appreciate various elements of the Curl platform. When you are done you will see why Curl is the best choice for developing rich, complex, data-intensive, web applications. Initialization In order to run the Order Entry Sample Application that serves as a medium for exploring and evaluating the Curl platform, please follow these simple, preliminary steps:
Exploration Integrated Development Environment Start by exploring the Curl development tools.
You might have noticed by now that the Curl RTE is running. That is because the Curl IDE, Documentation Viewer, and RTE are all Curl applications, that is, they are written in Curl! Take some time to look at the Curl Documentation Viewer. You will notice, in the table of contents, that there are 4 main sections.
NOTE: You can even install your own Curl applications' documentation in the Curl Documentation Viewer! The IDE & Visual Layout Editor (VLE) User's Guides provide detailed help on using the Curl development tools. The Curl Developer's Guide presents a narrative guide for learning about the Curl language and the libraries provided by the Curl RTE. The API Reference documents the classes, procedures, primitives, packages, etc. that make up the Curl language API. The Curl Developer's Guide is a good place to start learning all about Curl, beginning with a quick description of how to most productively use the Curl Documentation Viewer's features (contents, index, search). You will notice right away that the Curl Documentation Viewer is different than other documentation viewers. In particular, the Curl Developer's Guide and API Reference contain interactive examples. Since the documentation viewer is, itself, a Curl application, developers can write and test live Curl code in a Curl example box. This facilitates the learning of various Curl language concepts, and provides a convenient scratch pad for testing code snippets.
The Curl Developer's Guide presents material for a tremendous variety of Curl language elements, including:
The API Reference describes over 100 separate libraries built into the Curl RTE, including IO, graphics, GUI, data access, and charting libraries, even IDE-related libraries to help document your applications, and profile and monitor your applications' performance characteristics. Evaluation Sample Application Continue evaluating the Curl platform using the Order Entry Sample Application. You might have seen the Order Entry sample on the Curl website, or perhaps in an individual demonstration, but here is your chance to get your hands dirty, look at the code, play with the development tools, and get a feel for working with the Curl platform. The Order Entry sample application demonstrates:
You will be running the sample application from the filesystem. The Order Entry sample uses a special Curl technique for managing application resources - a manifest - so when running from the local filesystem, the applet requires privilege.
Running the Sample Application Now you may launch the Order Entry sample Curl application.
Take a look at the implementation. It highlights some important aspects of the Curl platform.
One of the most powerful attributes of Curl's rich Internet application platform is the ability to model and manipulate data on a client machine. Curl applications can obtain data from local or external resources using accepted web standards such as HTTP, SOAP, and TCP sockets. The applications can then consume data structured using well-known formats such as CSV or XML, as well as others, including proprietary formats. Once the data exists on the client, it can be modeled, analyzed, aggregated, or otherwise processed for use in the application. Here are some examples in the Order Entry sample implementation:
Take this opportunity to look at some documentation using the IDE's context-sensitive access to the Curl Documentation Viewer. While you are in the documentation viewer, do not be shy about poking around. The documentation is one of Curl's strengths, due in part to the volume, and in part because the live, interactive examples (executing right inside the viewer) provide a convenient place to try out code and facilitate the understanding of the Curl concepts they exemplify.
Presenting the Data Once the data is available to the Curl application, it can be presented to the user in a variety of ways. An example of some presentation source code can be found here:
{ct-totals-bar-chart} takes RecordView (a kind of RecordSet) data, manipulates the data for display, then creates and returns a chart. The presentation components in the Order Entry sample demonstrate several standard Curl features, including:
You can easily find chart documentation:
A variety of presentations is good because it is the mark of a truly rich user interface. Curl is good for this because Curl offers a wealth of built-in presentation classes:
Curl is extensible, so new presentations are only a {define-class } away! Styling the Application The presentation objects can be styled using Curl StyleSheets. Styling is implemented using a styling library provided by Curl. The library is included, in pcurl format, with the Order Entry Sample Application.
The library is incorporated into the sample as follows:
NOTE: The IDE has features that make it easy to start a project that uses the styling library. Stylability is good because you can customize the look of GUI controls, and provide themes or branding to your application. Curl is good for this because the Curl stylesheets are separate from application source code. This allows designers and developers to work independently. Coordinated Layout and Change Management The presentations have been connected to the data, so they can now be placed in a coordinated layout. Interactivity needs to be handled, and data changes need to be managed. The primary controller for the Order Entry application is ctBaseTrainingApplication. It is located in the controller package, in, predictably, the controller/ctBaseTrainingApplication.scurl file. This class handles layout management as well as data management.
The Order Entry sample's RecordForm demonstrates data binding using Curl's macro.
Check out the documentation for various features:
This facilitates declarative creation of user interface objects along with the handlers of events that might be fired at those objects. Proper change management is good because it allows different presentations to remain synchronized, so if data changes are made in one presentation (e.g., in the line item editor on the "Edit" tab) all the presentations (e.g., those on the "Data" tab) reflect the change. Toward that end, Curl has given significant attention to data binding making it a powerful, yet easy to use way of managing changes to your data. Some More IDE Features Now is a good time to take a look at some other IDE features and components. For example:
The next time the demo is run during this IDE session, the debugger will stop execution at this point. Refresh the browser containing the OrderEntry sample to see it in action. Deploying Curl Applications You have seen a sample Curl application, taken some time to explore the tools used to build such an application, and now you can take a look at how Curl addresses the matter of deploying your applications. Curl does not require any special kind of server; a typical web server, simply configured to server Curl content, is all you need.
Curl allows developers to compress and obfuscate their Curl source code in a pre-processed format called pcurl for fast delivery of applications to client machines in a format not easily read by humans. Illustrating the compression aspect of the pcurl format, ~115kB of source code in the Order Entry sample pcurls down to ~18kB.
NOTE: The pcurl feature in the IDE is considered a professional feature, thus is not immediately available in the free version of the IDE. The Curl IDE has many other features aimed at simplifying application deployment. For example:
Visual Development Using the Visual Layout Editor Curl provides a visual development environment called the Visual Layout Editor (VLE) which you can use to develop the user interfaces for your Curl applications. The VLE is integrated with the IDE, making it easy to switch between environments as appropriate for the code you are working on. This is particularly useful when adding behaviors (using, for example, event handlers) to your user interface. One of the great features of the VLE is its extensibility. The VLE supports a tremendous number of Curl objects by default, but imagine you have your own component that is not included in the default VLE palette. Is it possible to place such a component into the visual development environment? Yes. You can define your own objects and add them to the VLE palette, thereby extending the capabilities of the VLE. Curl even provides a tool, the VLE Extension Editor, to help you do exactly this. Once the extension is installed, the VLE will load it during startup, making your component available each time you launch the VLE. Refer to the Curl VLE User's Guide to learn more about how to use and extend the VLE. Summary The Order Entry sample application showed you that:
While the Order Entry sample application is relatively small in size, it is representative of a typical Curl application because
The Order Entry sample uses CSV data read from a local file for the sake of simplicity. Any structured data will do, and other web-standard formats and mechanisms such as XML, HTTP, SOAP, and TCP sockets can also be used to obtain data from external resources. Your applications will be different, but the approach will be largely the same. Order Entry Sample Application NOTE: This version of the Order Entry Sample Application requires release 6.0 of the Curl RTE. OrderEntry.zip |
|||||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
Curl Version 7 Sample Application: Sales Dashboard | ashimo | 0 | 6,004 |
07-01-2011, 10:00 AM Last Post: ashimo |
|
Curl Version 7 Sample Application: Timeline Viewer | ashimo | 0 | 5,191 |
07-01-2011, 09:59 AM Last Post: ashimo |
|
Curl Version 7 Sample Application: Curl eyeDecide | ashimo | 0 | 5,288 |
07-01-2011, 09:58 AM Last Post: ashimo |
Users browsing this thread:
1 Guest(s)
1 Guest(s)