Patent Publication Number: US-8527943-B1

Title: System and method of application development

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application is a continuation-in-part application of Ser. No. 11/465,511, filed Aug. 18, 2006 now granted U.S. Pat. No. 7,840,937, which is a divisional application of Ser. No. 10/951,066, filed Sep. 27, 2004, now granted U.S. Pat. No. 7,827,527, which claims priority from Provisional Patent Application Ser. No. 60/544,212, filed Feb. 12, 2004; this application also claims priority from Provisional Patent Application Ser. No. 61/082,477, filed Jul. 21, 2008, the entire contents of all of which are hereby incorporated herein by reference in their entireties. 
    
    
     COMPACT-DISC APPENDIX 
     Two (2) identical Compact Disc-Recordables (Copy 1 and Copy 2), containing computer program listings, pursuant to 37 C.F.R. 1.77 and 1.96, constitute a part of the specification of this invention and is incorporated by reference herein for all purposes. The CD discs were created on Jun. 24, 2009, with ASCII Carriage-Return/Line-Feed as line terminators, conform to the ISO 9660 standard, include two identical files: Appendices_c_file1.txt and Appendices_c_file2.txt, each of which is of 91821 bytes, and contains the code for the following programs. 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 A. 
                 Application code (SVG) of RotateBanner; 
               
               
                   
                 B. 
                 Application code (SVG) of Show_layer; 
               
               
                   
                 C. 
                 Application code (SVG) of Service_Registration_Class; 
               
               
                   
                 D. 
                 Source code of AgileTemplate class; 
               
               
                   
                 E. 
                 Source code of Rotate_banner in Java; 
               
               
                   
                 F. 
                 Source code of Rotate_banner2 in Java; 
               
               
                   
                 G. 
                 Source code of Show_layer in Java; 
               
               
                   
                 H. 
                 Source code of RB_DDL_IntTemp in Java 
               
               
                   
                 I. 
                 Source code of rb_ddl_it for Stock-info in JSP 
               
               
                   
                 J. 
                 Source code of rb_ddl_it for Weather-info in JSP 
               
               
                   
                 K. 
                 Source code of RadioButtons in Java; 
               
               
                   
                 L. 
                 Source code of CheckBoxes in Java; 
               
               
                   
                 M. 
                 Source code of RadioButtons2 in Java; 
               
               
                   
                 N. 
                 Source code of RB_RB_IntTemp in Java; 
               
               
                   
                 O. 
                 Source code of RB_RB_IntTemp2 in Java; 
               
               
                   
                 P. 
                 Source code of subcomponents.jsp include file for test; 
               
               
                   
                 Q. 
                 Source code of SL_CB_IntTemp in Java; 
               
               
                   
                 R. 
                 Source code of rb_rb_test.jsp in JSP; 
               
               
                   
                 S. 
                 Source code of rb_rb_test3.jsp in JSP; 
               
               
                   
                 T. 
                 Source code of DrawingArea in java; 
               
               
                   
                 U. 
                 Source code of canvas_test.jsp in JSP; and 
               
               
                   
                 V. 
                 Sample pseudo code of implementing methods of Service 
               
               
                   
                   
                 Registration Object and methods of replaceable 
               
               
                   
                   
                 components 
               
               
                   
                   
               
            
           
         
       
     
     COPYRIGHT NOTICE AND USE PERMISSION 
     A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the U.S. Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. The following notice applies to the software and data as described below and in the drawings hereto: Copyright 2009, Raju Chiluvuri, All Rights Reserved. 
     FIELD OF THE INVENTION 
     This invention relates to application development and particularly to software development method for generating platform-compatible code of web components. 
     BACKGROUND OF THE INVENTION 
     The world-wide-web (WWW) interface protocol over Internet provides a convenient mechanism for distributing information from web servers to web users on the client computers which are connected to the web servers through Internet or private networks. 
     When a web server receives a request from a client computer for a dynamic web page, it runs the CGI (e.g., Java Server Pages “JSP” or Servlet) associated with the URL and passes the browser information and other parameters to the CGI. This CGI executable may access and retrieve data stored on the web server or other connected computers to generate a web page (which comprises application code to render the web page). When the data in the real world is changed or updated, the image view of the web page necessarily changes in some aspects. 
     Computer applications often use graphics to present information and use Graphic User Interface (GUI) as the interface between computers and their users. While text interface is still in use, it is not favored. GUI is characterized by use of menus selection lists, popup-windows and visual-presentation components such as interactive charts, dials, trees, graphs and maps. Because of the intensive use of graphics, it may require considerable effort to develop and modify the contents of web pages. 
     Commercially available web browsers support many presentation technologies such as Dynamic Hypertext Markup Language (DHTML), Extensible Hypertext Markup Language (XHTML) Document Object Model (DOM), JavaScript, Cascading Style Sheets (CSS), eXtensible Stylesheet Language (XSL), three-dimensional modeling language (e.g., X3D), Silverlight/XAML (eXtensible Application Markup Language), MXML/Flash and Scalable Vector Graphics (SVG), Synchronized Multimedia Integration Language (SMIL), and XForms. The use of such a combination of programming languages makes programming more complex. To present a component on a web page, the JSP/Servlet must create the code to present the component and include the code in the file of the web page. Programming for Internet applications requires experience in both Java (or equivalent languages) for the server and DHTML/JavaScript and SVG/XAML (or equivalent languages) for the client computer. It might be necessary to create and debug several hundreds to thousands of lines of code to present a web page. 
     In addition, different browsers require slightly different DHTML/JavaScript code instructions to present a component, and, therefore, different application code must be developed for different browsers and devices to present the same component. Each browser supports a few unique HTML tags or inbuilt JavaScript functions, which are not understood by browsers from other vendors or browser of older versions. To develop a more complicated web application, application developers often need to write code in appropriate languages and presentation technologies such as DHTML, DOM, JavaScript, CSS, XML, XSL, SVG and XAML for each specific browser (or plug-in viewer). 
     A web page or web application may comprise graphical user interface (‘GUI’) subcomponents such as interactive charts, graphs, maps, dials, menus, check boxes and dropdown lists. The web page requires many lines of markup code (e.g. SVG, MXML/FXG or XAML) and programming code (e.g. JavaScript, ActionScript or C#) for presenting each of the GUI subcomponents. This type of web pages are referred to as Rich Internet Applications (RIA) because code for web pages is in many ways similar to the desktop GUI applications developed in programming languages such as Visual Basic. 
     To present a GUI component in a web page, the web page must include necessary application code for the GUI component. The application code corresponding to each GUI component comprises markup code such as SVG elements and JavaScript code. SVG elements such as circle, ellipse, rect, line, text, polyline, polygon and path can be used in web page to draw two-dimensional or three-dimensional visual shapes such as charts, check boxes or maps. JavaScript code is implemented to manipulate and redraw SVG elements, and, thus, update GUI components reflecting a change in data for the GUI components or the state of the GUI components. In some implementations, JavaScript code is used to draw visual elements in lieu of SVG markup language instructions. So it is possible to present a visual component without using markup language. 
     Furthermore, it is necessary for subcomponents to communicate with the container component and with each other. Therefore, the container component must have additional communication code, which allows the subcomponents to exchange data with the container component and with each other. 
     Finally, information critical to business decisions constantly changes in real-time, and, therefore, updating web pages by rewriting presentation code of the web page by conventional methods is neither realistic nor economical. Also it may be desirable to customize a few components according to the preferences or profile of each of requesting users. Various attempts are made to speed up the process of application development and maintenance in this and other similar environments for same or similar reasons. 
     A method of reuse of image data is described in U.S. Pat. No. 6,539,420 B1, filed Mar. 25, 2003, titled “Distribution Mechanism for Reuse of Web Based Image Data”, granted to Fields et al. This method describes a technology of reuse of image data in a distributed computer network at a web server in response to a request from a client browser for a web page. A template defining a composite image is retrieved and at least one image object identified by the template is retrieved from another location to the web server followed by a given image transform and the transformed image object being mapped into the composite image according to the template. The method is limited to web-based image data. 
     A method for creating graphical programs is described in U.S. Pat. No. 6,053,951, filed on Apr. 25, 2000, titled “Man/Machine Interface Graphical Code Generation Wizard for Automatically Creating MMI Graphical Programs”, granted to McDonald et al. This application describes a computer-implemented system and method for automatically generating graphical code in a graphical programming system. The graphical code generation wizard selects a graphical code template stored in the computer memory in response to the control arranged by the user and configures the graphical code template with the parameter values selected by the user, and then creates an association, which is able to be unlocked by the user, between the control and the configured graphical code. 
     A method for automatic web page creation of an organizational directory for use in an Internet and Intranet environment is disclosed in U.S. Pat. No. 5,940,834, filed on Aug. 17, 1999, titled “Automatic Web Page Generator”, and granted to Debbie Pinard and Richard Deadman. The web page directory is created from data stored in the directory application component of the web page generator and, after being placed on a web server, allows any individual who has network access to the web server offering the web page to view the directory information in a web page format. This method is not intended to create any web component. 
     A method for building templates is disclosed in U.S. Pat. No. 6,093,215, filed on Jul. 25, 2000, titled “Method and Apparatus for Building Templates in a Component System”, and granted to Jeffrey J. Buxton and Eric S. Portner. A component customization and distribution system in an object oriented environment provides a template builder utility which enables selection of a base component, modification to the state of persistent data of the base component, storing of the modification to the persistent data of the base component into a template format, and user-password locking of the template. The template builder utility further enables the generation of user-defined instructions as part of the template and generation of a template distribution pack, for which the generation methods are also disclosed. 
     There is still a need for a system and method for developing components efficiently and a method for using pre-built components to build larger components or applications. 
     SUMMARY OF THE INVENTION 
     The present invention discloses a method, system and computer program product to create application code of an application component using code-generating programs: component code generator (CCG), reusable CCG for GUI components (GUI-CCG), and application component code generator (ACCG). When a code-generating program built for a component is run on the first platform (the server), it generates proper component code and sends the code to a second platform for rendering. The first platform and the second platform (the client) may reside on same computer hardware or connected through LAN, WAN or Internet. 
     A CCG of a component, upon being executed, generates the code of the component. The CCG is preferably implemented in Java class derived from an abstract base class AgileTemplate, which comprises an abstract code-generating method (CGM). In the alternative, the CCG is implemented in its own class. A CCG is pre-built for any of the commonly useful basic components such as GUI controls, dials, trees, maps, and charts (e.g., A GUI CCG class for pie chart and a GUI CCG class for line chart). When a class object of a GUI CCG is instantiated and initialized on the first platform, and the CGM of the instantiated object is called, the CGM generates the component code. Therefore, by using a reusable GUI CCG, it is unnecessary to write the presentation code for a basic component line by line. Reusable GUI CCGs are pre-built and their objects are used in a container CCG for generating the presentation code of subcomponents. 
     An ACCG is also a special CCG except that the ACCG also contains code to implement application logic (also known as business logic). The ACCG may also comprise code for accessing data from data sources such as Relational Database Management System (“RDBMS”). The ACCG is preferably derived from an abstract base class AgileTemplate. Alternatively, the ACCG is implemented in its own class or in non-class. Like a CCG, when the CGM of an instantiated ACCG object is called, the ACCG generates the presentation code of the component. When the ACCG is implemented in class, it is used by a container CCG to build a subcomponent. 
     The code of application logic in an ACCG may implement plural variables and a method for retrieving application data from suitable data sources or remote data servers by using a protocol such as Service Oriented Architecture (SOA). The ACCG may comprise necessary code or method for retrieving application data from data sources for processing in real time. The method is called before the calling of the CGM of the ACCG. The method is called from within the CGM. After the application data is updated, the CGM of the ACCG then generates its component code using updated application data. If the ACCG uses reusable GUI CCG objects as its subcomponents, updated application data can be used directly to initialize reusable GUI CCG objects. The CGM of the ACCG then generates its component code using the GUI CCG objects. Therefore, the presentation code of the component always reflects the application data at the time of running the ACCG. 
     If an application contains plural GUI components, it is often desirable that the components collaborate or exchange data with each other. Each communication link is normally in the form that, upon occurrence of an event such as mouse-click or state-change in a first component, the first component calls a target service method of a second component. The application must contain what we call communication code that allows the two components to collaborate and exchange data. 
     Since both components in the application code are generated by respective CCGs on server, the CCGs must be programmed, in the development stage, with a mechanism for generating the necessary communication code. Therefore, a first CCG not only implements CGM for generating the code of its component but also implements one or more coupling service methods, each of which is called for inputting a name of a callback function to be invoked by its component upon an event. Second component not only implements CGM for generating the code of its component but also implements one or more coupling service methods, each which is called to get the name of a target service function implemented in the code of its component. Both of the coupling service methods run only on a server and are implemented to “integrate” two application components because they are implemented to generate inter-component communication code in resultant application. The resultant communication code allows two components or subcomponents to collaborate with each other on the second platform. 
     When a container CCG uses two subcomponent CCGs to generate application code, the CCG also implements (i) the code for importing or inputting CCGs as subcomponents, (ii) the code for instantiating or initializing CCG objects of the subcomponents, (iii) the code for calling the coupling service method of one CCG object for getting the name of the target service method, (iv) the code for calling the coupling service method of the other CCG object for setting the callback name, and (v) the code for calling the CGM of the CCG objects. When the container CCG is run, it calls the CGMs of the CCG objects to generate the code for each of the subcomponents, places the code in proper location in the resultant application and creates necessary communication code. 
     Some special code referred to as code of integration logic in the container CCG is responsible for generating the communication code, which is used by the application component to establish communication between the component and subcomponents or between two subcomponents. The code of integration logic includes one or more of the following in any order (1) the code for calling the coupling service method of the CCG object of a subcomponent to get information such as the name of the target service method and an event trigger for the target service method, (2) the code for choosing a callback name and inputting the callback name to the subcomponent&#39;s CCG for generating part of communication code in the application code, (3) code for calling a coupling service method which gets information such as the name of a target service method implemented in an external application component and code for use in writing the communication code, and (4) code for calling a coupling service method of a CGG object for inputting information such as the name of the service method of an external application component into a CCG object for use in generating communication code. The communication code allows container component, subcomponents and external components in the resultant application to exchange data and work collaboratively on the client. 
     If it is required to create code for a web page (a container component) that presents two GUI components (e.g. a line chart and pie chart), respective GUI CCG classes, a reusable GUI CCG for line chart and a reusable GUI CCG for pie chart, is used to instantiate and initialize a CCG object for each of the GUI components. Each of the CCG objects is used to generate application code to present each of the components 
     For example, the method for presenting a pie chart by using a reusable GUI CCG can be developed in two phases. First, a reusable GUI CCG class is designed which can accept data as input at run time and uses the data to generate application code for presenting a pie chart. The reusable GUI CCG class comprises (1) a method for generating component code including the code for presenting the chart image, and (2) one or more coupling service methods, which run on the server, for setting name of a callback method for the component to call upon an event or getting name of the service method of the component, which is generated by the reusable GUI CCG and sent to the client. Second, a CCG or JSP for a container component is designed, which comprises (1) code for instantiating and initializing an object of the reusable GUI CCG, (2) code for calling the reusable GUI CCG&#39;s method for generating component code, and (3) code of integration logic, which calls the coupling service methods of the reusable GUI CCG for setting a name of callback method to be invoked by GUI component upon an event or getting name of a service method of the GUI component and uses the name for generating necessary communication code. Upon the running of the container CCG, the container CCG calls GUI CCG object to generate component code for a pie chart and generates communication code which allows the pie-chart component to collaborate or exchange data with the container component. 
     The CCGs is used in a container component (which would be another CCG) to generate application code. Each of the CCGs generates (1) application code comprising of markup elements (e.g., elements for HTML browser include table, img, input, span or label) for drawing various elements or parts of an image of a component and (2) application code implemented in a programming language supported on client platform such as JavaScript, which comprises (a) code for manipulating elements in response to events such as mouse move, keyboard stroke or callbacks, and (b) a few lines of special application code (known as communication code or integration code) to allow inter-component communications between the component and other components. 
     A container CCG can also use alternative methods such as a publish-and-subscribe method to facilitate communication between subcomponents generated by plural CCGs. When this method is used in a container CCG with two subcomponents, the CCGs for the subcomponents are designed to generate the subcomponents so that one subcomponent publishes its service in a shared global object or directory, and the other subcomponent looks up the service from all published services in the shared global object and accesses the service. 
     To properly integrate two or more subcomponents generated by the CCG objects, the container CCG object exchanges data with the CCG objects of the subcomponents in the process of calling the coupling service methods of CCG objects. The data exchange on the server may be realized by using simple get- and set-methods of the CCG objects with data passed in their parameters. Data can also be exchanged through the objects returned by some functions. For example, each of the get methods often returns an object that contains requested data. The mechanisms of data exchange between two components on the client include use of strings, XML strings, variable passed as parameters for the inter-component communication functions (e.g., callback and service methods), hidden variables, and common global variables, which are shared by more than one component/subcomponent. A container CCG, in the simplest form, contains only the code to import CCG objects and the code to integrate the subcomponents the CCG objects represent. 
     A container CCG can implement various methods for ensuring that CCG objects that are of right type for the container CCG. Preferably, the container CCG is designed to accept CCG objects of subcomponents by the set-method (i.e., constructors or the initialization method) in Java class. To integrate the subcomponents of input CCG, the container component may need to know the information about the service method implemented in the component that the input CCG generates and the parameters used in calling the service method. The information is known as “Integration data”. The container CCG may implement coupling service methods, which are used by the container CCG to access, share, and validate integration data. In another embodiment of the present invention, the CCG of input subcomponent is derived from an abstract component class, which implements predetermined features and methods. The abstract component class is a subclass of AgileTemplate class, but is a distinctive indication of specific interface properties. Thus, only subcomponent CCGs derived from certain abstract class are compatible with a container CCG. 
     Any container CCG may serve as an input component for a larger container CCG. An instantiated and fully initialized container CCG object is used to create the presentation code of a container component, or used to generate component code as a subcomponent inside another larger container CCG. Yet another further larger container CCG may use the container CCG of the larger component to build an application. This simple hierarchical component assembling process can be repeatedly used to build larger and larger application components or applications. 
     By using the method of the present invention, subcomponents generated by CCGs is integrated by a container CCG during execution. The container CCG uses the subcomponent CCGs&#39; coupling service methods for the integration of subcomponents into the application code, and does not impose other limitations on the subcomponents and their code. Therefore, the CCGs intended for an application are created and tested independently, refined conveniently, or replaced quickly. A custom container CCG is built by assembling and integrating many CCGs. Reusable GUI container CCGs are created for popular applications such as On-line Analytical Processing (OLAP) analysis, Global Positioning System (GPS) Navigation, visual simulation or representation of dynamic systems, and shopping carts. ACCGs can be used just like all reusable container CCGs as long as their code of business logic is properly implemented in the ACCGs. 
     The method of software development in the present invention provides several advantages. Some advantages flow from the ability to preserve the independence of the reusable GUI CCGs or ACCGs and the ability to create computer programs by assembling and integrating the components. 
     In one aspect, the method of the present invention is used to make application development easier. An application can be divided into many components, which are developed and tested independently from each other. Components can be easily assembled to form the application. In another aspect, the method can be leveraged to substantially cut the development effort for container CCGs. To reduce coding effort, application developers can use pre-built reusable CCGs in class libraries such as GUI Controls, Menus, Meters, Dials, Charts, Trees, and Maps. 
     In yet another aspect, the method of the present invention can be used to shorten the development period for a new application. CCGs can be quickly integrated to build larger CCGs. This allows application developers to build CCGs independently, and use them to build CCGs for larger components. To build a larger CCG, the developers can use subcomponent CCGs for generating presentation code of the subcomponents and write code of integration logic for generating communication code. When a variety of CCGs are available for use as subcomponents, the time for building the new application using the available subcomponents is shorter. 
     In further another aspect, the classes for CCGs and ACCGs of subcomponents can be easily refined or modified to meet constantly changing business needs. The service methods of the components can be designed to provide loosely coupled simpler interface based on component features. As a result, such components are easily portable from application to application. 
     In yet another aspect, a reusable GUI CCG can be designed to inspect the version and type of the requesting client platform and generates platform-specific code for proper presentation of the component. As a result, the applications can be easily ported to newer versions of the client platforms. 
     The method of software development in the present invention provides another advantage that flows from using a special type of components that are referred to as replaceable components. Replaceable components offer higher degree of modularization. For example, a replaceable component of an application offers a higher degree of independence from the application in replacing the component by a new component and redesigning and updating the code of the component and testing the component. 
     Those and other aspects of features of the present invention will become apparent to those skilled in the art after a reading of the following detailed description of the invention together with the drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  shows the system for implementing the method of the software development according to the present invention, according to an embodiment; 
         FIG. 2   a  shows the presentation code to show a stock quote for the ticker ORCL; 
         FIG. 2   b  shows the presentation code created by an ACCG to display a stock chart, according to an embodiment; 
         FIG. 3   a  shows a full pie chart with three components: legend, Info-table and pie slices together with code structure, according to an embodiment; 
         FIG. 3   b  shows a two-component mouse-over pop-up component generated by a CCG, according to an embodiment; 
         FIG. 3   c  shows a component using an expandable menu for showing a stock chart for a selected tickle on the expendable menu, according to an embodiment; 
         FIG. 3   d  shows a hierarchical menu component, according to an embodiment; 
         FIG. 4  shows the class definition and data structure of an ACCG, according to an embodiment; 
         FIG. 5  is a block diagram for encapsulating the code of business logic and the code of presentation logic (e.g., GUI CCG) in an ACCG, according to an embodiment; 
         FIG. 6  shows the process of building presentation code by an ACCG using three ACCGs for building three subcomponents, according to an embodiment; 
         FIG. 7  shows the process used by the CGM of an ACCG to generate presentation code without code of integration logic, according to an embodiment; 
         FIG. 8   a  shows a sample depiction of components in an application for registering service names and service with a global service registration object or directory in an application; and service-consuming components lookup for the services from the registration object and accesses the services, according to an embodiment; 
         FIG. 8   b  shows steps for registering a service with the directory object and for looking up a service from the directory object and access the service, according to an embodiment; 
         FIG. 9   a  shows a container CCG with the CCGs of subcomponents being instantiated locally, according to an embodiment; 
         FIG. 9   b  shows a container CCG comprising an inner CCG and two CCG objects that are input into the inner CCG, the presentation code of two subcomponents generated outside the inner container CCG, and the inter-component communication code generated inside the inner CCG, according to an embodiment; 
         FIG. 9   c  shows a container CCG comprising an inner CCG for three subcomponents and two input CCGs, the presentation code of one subcomponent generated outside the inner CCG, and presentation code of two subcomponents and communication code, both of which are generated inside the inner container CCG, according to an embodiment; 
         FIG. 10   a  shows two subcomponents generated by two CCGs without inter-component communication code, according to an embodiment; 
         FIG. 10   b  shows two subcomponents generated by two CCGs with inter-component communication code, according to an embodiment; 
         FIG. 11  shows server code in a container CCG for generating communication code for two subcomponents, according to an embodiment; 
         FIG. 12  shows flow chart of a CGM in a container CCG that uses two CCGs to assemble two subcomponents and also creates communication code for the subcomponents, according to an embodiment; 
         FIG. 13  shows flow chart of a CGM in a container CCG that uses three CCGs to assemble three subcomponents and also creates communication code for the subcomponents, according to an embodiment; 
         FIG. 14  shows presentation component for presenting stock chart created by a container CCG using Rotate-banner and Dropdown Selection Menu, according to an embodiment; 
         FIG. 15  shows the process steps used by the CGM of a container CCG to generate presentation code together with communication code, according to an embodiment; 
         FIG. 16  shows a shopping cart application containing shopping cart&#39;s table/invoice and shopping items, according to an embodiment; and 
         FIG. 17  shows the mechanism for managing dependencies and validating communication interfaces of replaceable components in an application, according to an embodiment. 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     A. Definitions 
     Following definitions are applied in the construction of the disclosure and attendant claims. 
     An “application” is a program or set of cooperating programs that enable a user of a computer system to accomplish some task or set of tasks. It includes applications run on a platform such as browser, activeX viewer or virtual machine (e.g., Java Virtual Machine). It means the entire document and referenced files, which are sent to the platform where the application is executed. 
     “Application component” (“component”) is an instance that contains all the business intelligence to support a specific function or feature of the application. Many applications use graphical components to simulate or model real system and interactions of real objects. An example of application component is a temperature-reading meter, which contains the code to present current temperature, handling user events, and supporting service methods, which might be used by external code or other application components in order to read and/or update the temperature. A component may have subcomponents, e.g., a copier may have a sorter and a feeder attached to it. Because component and subcomponent are relative concepts, a component becomes a subcomponent when it is used by another component. Therefore, component may mean subcomponent when its relative relationship changes in a context. A container component is a target component to be built. 
     “eXtensible Markup Language” (XML) is a specification for designing formats for text data that allows for text objects to be organized into hierarchies (i.e., XML documents). XML allows web developers to create customized tags that offer flexibility in organizing and presenting information. 
     A “browser” means any HTML-rendering application. It means part of computer operating system if it is integrated with the operating system (OS). A “viewer” means a platform that runs applications written in appropriate language such as scalable vector graphics, XAML or Flash. Viewer can be part of the browser if it is integrated with the browser. It can be part of computer OS if it is integrated with the OS. 
     A “network connection” means any kind of IP network or equivalents, including Internet, Intranet, private network, LAN, WAN, and wireless network and any combinations thereof that allow two connected computers or computing devices (e.g., cellular phones or palm-tops) to exchange data according to an IP protocol or equivalent. It also includes the loopback of a computer when a server and a client reside in the same computer. 
     “Presentation code” is a block or several lines of code to render a component in a web browser or a viewer (or equivalent) at the client computer. This code can contain any combination of the programming languages and technologies. Presentation code may also include external files such as GIF images and JavaScript files included by reference. Furthermore, presentation code includes the application code, which is used to interface with other computer devices or to represent the state of machine. 
     “Component Code Generator” (CCG) is a computer program built for a component in any suitable language. It contains the code-generating method (CGM). Upon execution, the CGM of the CCG generates presentation code to present the component on a suitable platform. The CCG can also implement special coupling service methods for the component of CCG, where these coupling service methods are used to create code for inter-component communication. 
     “Component Code Generators for GUI components” (GUI CCG) is a CCG, which contains code that, upon execution, generates platform-specific presentation code to render a GUI component. Normally, a reusable GUI CCG class is implemented for generating a correspondent GUI component. For example, a GUI CCG class is for generating a pie chart while another GUI CCG class is designed to generate a bar chart. 
     “Application Component Code Generator” (ACCG) is a CCG that contains the code for implementing application logic. An ACCG is a special CCG. 
     “Container Components Code Generator” (Container CCG) is a CCG, which may use one or more CCGs for generating code of subcomponents and incorporates the subcomponents to build the code of the container component. The container CCG contains several lines of special code. When a container CCG is run to generate an application component, the special code is responsible for generating code statements known as communication code, which allows subcomponents and component to communicate with each other in the resultant application. A container CCG is a special CCG. 
     “Communication code” is few lines of application code to allow for collaboration or data exchange between two modules including objects or components. Usually one of the modules in the application initiates the communication upon an event such as mouse clicks, keyboard or touch screen events, arrival of data, function call from another module, timer trigger, and change of state or data. The responsive actions include change of state, display or data, send back response or initiate a communication with another module. The lists of events and responsive actions are not exhaustive. While the communication may pass data from one module to another module, passing data is not required. Communication code includes, but not limited to, all sample code provided in this disclosure. Communication code includes any code in an application by which an event in one module causes a response from a second module. 
     “Integration logic” is few lines of code in the CCG of a container component or CCGs for the subcomponents of the container component, which generates application code called “communication code”, which allows for data exchange or collaboration between the subcomponents or between the container component and one or more subcomponents in the client application. A server application such as JSP that uses CCGs for generating subcomponents is a special type container CCG. 
     “Coupling service methods” include any method implemented in a CCG that runs at server for creating necessary communication code for the component generated by the CCG, where the communication code allows for inter-component communication on the client. Examples of coupling service methods include (1) a service method implemented in a CCG for getting directly or indirectly integration data such as a name of a service method implemented inside the component code generated by the CCG and (2) a service method implemented in a CCG for setting directly or indirectly integration data such as the name of an external function to register a callback with the component generated by the CCG. 
     “Integration data” are the necessary information a container CCG needs when its object interacts with a CCG object for a subcomponent. In a shopping cart and shopping item example, when a user selects an item on the computer screen, the shopping item (e.g., the subcomponent) in the application causes the shopping cart (the container component) to update the invoice/purchase statement. When a user selects a shopping item, the subcomponent, shopping item, calls the service method of the subcomponent of the invoice/statement and passes data about the shopping item such as price, model and UPS-code through the parameters of the service method. The interaction at the client is achieved by the communication code. The information about the name of the service method and the parameters of the service method are examples of integration data. The container CCG needs integration data in creating the communication code. 
     “Self-containing” in this disclosure is defined as follows: A component, module or object is said to be “self-containing” if it requires a little or no construction code and data to assemble into an application and ready to perform its functions which include providing user interface features, providing services or collaborating with other parts of the application. A component is said to be self-containing even though it requires external services for performing its functions or provide service to other components. 
     B. Object-Oriented Programming 
     Object-Oriented Programming (OOP) languages, such as Java, support a concept called classes. A class is a module of code that generally contains (1) a set of data variables to store data and references to other objects, (2) a set of methods or functions to operate on the data, (3) methods for providing access to the services defined in classes, (4) methods for setting and changing the objects&#39; data (popularly known as set methods), and (5) methods for reading objects&#39; data (popularly known as get methods). 
     Object-oriented programming techniques involve the definition, creation, use and destruction of “objects”. These objects are entities comprising data elements or attributes, and methods or functions, which manipulate the data elements. Objects can be created, used and deleted as if they were a single item. The attributes and methods enable objects to model virtually any real-world entity in terms of its characteristics, which can be represented by the data elements, and its behavior, which can be represented by its data manipulation functions. Objects are defined by “classes”, which act as templates that instruct the compiler how to construct the actual objects. A class may, for example, specify the number and type of data variables and the way of manipulating the data. When an object-oriented program is compiled, the class code is compiled into the program, but no objects exist. An object is created by the program at runtime by calling a special function, constructor, which uses the corresponding class definition and additional information, such as arguments provided during object creation, to construct the object. Object creation is also referred to as object instantiation. When an object is created at runtime, memory is allotted and data structures are created. Objects may be used by using their data and invoking their functions. Objects are destroyed by calling a special function called destructor. 
     Class may support a rich set of methods to initialize the data variables and also to read the variables. Also, it supports methods, which can be used to request (or access) the services of the object, which is an instance of the class. For example, a sample drawing-class for a pie chart, which draws a pie chart, may contain variables: an array of floats, an array of strings, and a title string. The class may support methods to initialize these variables and a service method that draws the pie chart using the data. Users can instantiate a pie chart object and initialize the data using the supported methods; and then use the service method to draw the pie chart. Also, the class may support other methods such as service methods to register callbacks. If any external component interested in the user selection/clicks on the chart, they could use appropriate service method to register a callback to be notified on the event. 
     The major benefits of object-oriented programming techniques arise out of three basic principles; encapsulation, polymorphism and inheritance. More specifically, objects can be designed to hide, or encapsulate, all, or a portion of, the internal data structure and the internal functions. A program developer can define objects in which all or some of the attributes and all or some of the related functions are considered “private” or for use only by the object itself. Other data or functions can be declared “public” or available for use by other objects. Access to private variables inside an object by other objects can be controlled by defining its public functions for accessing the object&#39;s private data. The public functions form a controlled and consistent interface between the private data and the “outside” world. Any attempt to write program code that directly accesses the private variables causes the compiler to generate an error during program compilation, which error stops the compilation process and prevents the program from being run. 
     Inheritance allows software developers to easily reuse preexisting program source code and to avoid creating software from scratch. It allows a software developer to declare classes and their instantiated objects as related to each other. When a class is designated as a subclass of the base class, the subclass “inherits” and has access to all of the public functions of its base class just as if the functions were declared in the subclass. Alternatively, a subclass can override some or all of its inherited functions or modify some or all of its inherited functions merely by defining a new function with the same form. Overriding or modification of a function in the subclass does not alter the function in the base class. The creation of a new class by selectively modifying the functions of another class allows the software developers to easily customize existing code to meet their particular needs. 
     Moreover, many components are essentially Java objects that conform to an object model such as Microsoft&#39;s Component Object Model. An object module is a unifying set of rules that describe object structure, object life cycle, and inter-object communication. Object structure relates to the physical layout of objects in memory, while object life cycle refers to how applications create and destroy objects. Inter-object communication refers to protocols by which objects communicate with one another. Object modules are useful in contexts where all objects in a given system need to conform to a given protocol governing these parameters. Most of the object-oriented languages, including the C++ programming language, do not specify true object modules, but merely specify syntax and semantics of a basic object implementation without specifying the rules that unify object systems. 
     One of the important features of the present invention is the use of an abstract code-generating method for generating browser-compatible component code. A super class supports, among others, the code-generating method. The subclasses derived from the super class inherit the behaviors and characters of the method. 
     C. The System for Application Development 
     The system ( FIG. 1 ) for web application development in accordance with the present invention comprises a client computer  100  running an operating system (not shown) and a web browser  105 , a server computer  110 , and a network connection  115  between the client computer  100  and the server computer  110  so that the client computer  100  and the server computer  110  can exchange data according to an Internet communication protocol such as Hypertext Transfer Protocol (HTTP) or File Transfer Protocol (FTP). The server computer  110  hosts a web application server  120 , which runs Servlet or JSP and/or has a Common Getaway Interface (CGI). The server computer  110  may optionally run a database server  125  or similar data base application. The web browser  105  uses a URL (the virtual address of the server) to locate the web application server  120  and to request a web page. If the URL points to a static web page, the server computer  110  returns the page in appropriate code. If the URL points to an executable such as CGI or JSP/ASP program, the request will cause the server computer  110  to run the executable, which creates a web page dynamically. 
     The client computer  100  includes a central processing unit (CPU), a random access memory (RAM) for temporary storage of information, and a read only memory (ROM) for permanent storage of information. A bus, which is controlled by a bus controller, interconnects the components of the computer system. Secondary storage may be provided by diskette, CD ROM, hard drive, flash memory cards (by serial or USB or other connections), and tape drive. The diskette drive, CD ROM, and hard disk are connected to the bus by respective controllers; and the RAM is controlled by a memory controller. An interrupt controller is used for receiving and processing various interruption signals from any of the system components. 
     The client computer  100  also includes a communication adapter that allows the system to be interconnected to a local area network (LAN) or a wide area network (WAN) schematically illustrated by the bus and network connection. 
     Operation of both the client computer  100  and the server computer  110  is generally controlled and coordinated by operating system software, such as the Microsoft Windows 95, 98, 2000, ME, XP and NT from Microsoft Corp., Redmond, Wash., Sun OS/2, and Apple OS 10 from Apple Computer Systems, Inc. Cupertino, Calif., and Linux from RedHat Inc, Durham, N.C. The operating system controls allocation of system resources and performs tasks of processing scheduling, memory management, networking, and input and output services. The operating system resident in system memory and running on CPU coordinates the operation of the other elements of the computer. The present invention can be implemented with any of the commercially available operating systems including OS/2, UNIX, Windows 95, 98, 2000, ME, XP, Vista, NT, and DOS. 
     A platform such as viewer, virtual machine, browser, and any HTML-rendering application on the client computer  100  is necessary for use of the present invention. Commercial browsers include Internet Explorer from Microsoft Corporation and Netscape from Netscape Communication Corporation. Other browsers such as America Online browser are also available. Because graphic presentation code produced by the method disclosed in the present invention is displayed under an SVG viewer, it is therefore necessary to load an SVG viewer as a plug-in component of the browser. While all well-known browsers are not part of any of the commercially available operating systems, they can be merged into operating systems. For example, SVG viewer is analogous to Windows-OS to run enterprise applications; and SVG/JavaScript is analogous to programming languages such as Visual Basic or Java. Next generation Microsoft-OS Vista and IE-browser support Silverlight plug-in and XAML. The XAML is Microsoft&#39;s version of XML based graphics technology similar to SVG and the name of the viewer is Silverlight. Silverlight is an underline graphical platform which is much more powerful than SVG viewer. Therefore, the present invention is useful not only in web application development but also in general software application development. Also, Adobe has announced a new platform called Apollo, which runs MXML/ActionScript, where MXML is an XML-based graphics declaration language, and ActionScript is a programming language conforms to ECMAScript Specifications. 
     The server computer  110 , as is well known in the art, is a computer that is connected to the client computer  100  through Intranet, local network, WAN or wireless in accordance to an Internet Protocol (IP). The server computer  110  generally has similar components of the client computer  100  even though some of the components such as floppy disk, CD ROM drive and display may be dispensed with. The server computer  110  is capable of sending web pages to the client computer  100  in HTML format. HTML is a markup system used to create web pages that are portable from platform to platform. To send a web page, the two computers use the Internet HTTP, which specifies how information is exchanged between the client and the server. HTTP is an application that is designed to conform to International Standard ISO 8879—Standard Generalized Markup Language. HTML and HTTP standards are maintained by an Industry Consortium, the World Wide Web Consortium (W3C) jointly hosted by the Massachusetts Institute of Technology Laboratory for Computer Science (MIT/LCS) in the United States, the Institut National de Recherche en Informatique (INRIA) in Europe, and the Keio University Shonan Fujisawa Campus in Asia. 
     In one of the preferred embodiments, the server computer  110  supports the Common Gateway Interface (CGI) for running CGI programs. CGI is a publicly available method, which is used by web servers and web clients to mediate interaction between them. 
     In practicing this invention, it is often desirable to use the network connection  115  which may include Internet and the WWW infrastructure in whole or in part. The WWW is a collection of servers on an IP (Internet Protocol) network, such as the Internet, an Intranet, or an Extranet. The web servers on WWW utilize the HTTP for changing information. However, the invention may be practiced in private networks rendered by serial cable connection, leased phone line, and wireless networks without using the WWW. 
     The system described above is just one example of a suitable software development environment and is not intended to suggest any limitation as to the scope of use or functionality of the invention. Neither should the client computer  100  and the server computer  110  be interpreted as having any dependency or requirement relating to any one or combination of components used in the present invention. The invention may be practiced on cell phones and palm devices that run browser-like application such as SVG viewer or Adobe&#39;s flash players. Since the platform supports Application Peripherals Interface (API), the invention can be used to control other hardware devices. 
     In software development environment, the server computer  110  and the client computer  100  may reside in the same computer unit. This is especially straightforward in system running operating system such as Windows NT, Windows XP, Unix and Linux. In such a system, a web server application can be launched for hosting web sites. At the same time, a web client can also be launched so that the client can access the web server through loopback. In this situation, the ordinary network connection is unnecessary. This system is ideal for software development using the technique of the present invention. 
     Moreover, if the web browser  105  is merged into the operating system, the system might be reduced to one single standalone computer even though the details in operating such a system depend on how the system is implemented. Therefore, the system for application development is intended to cover both a single computer with a browser and a single computer without independent browser. In this situation, the client computer  100  should be construed as a logical computer. In the system where a browser is merged into the operating system, browser shall mean the part of the component of the operating system that performs browser&#39;s functions. 
     D. Presentation Platform and Component Code 
     Component code is a block or several lines of code to render a component in a web browser or a viewer at the client computer. This code is generated by a CCG at the server and be sent to the client computer in the SVG language, and it must be compatible with the requesting browser. Some sample components are shown in  FIGS. 2   a ,  2   b , and  3   a - 3   d.    
       FIG. 2   a  shows two images  200  and  201  showing stock information for ORCL and MSFT respectively. The code block  202  draws the image  200  under an SVG browser while the code block  203  draws the image  201 . 
       FIG. 2   b  is an image for a stock quote component. This component has three subcomponents. A stock quote table  210 , a line-chart  211  showing stock movements for a year, and a bar chart  212  showing volumes (i.e., numbers of shares) traded. 
       FIG. 3   a  shows a full pie chart  300  and general code structure of the code  305  for the full pie chart. The full pie chart  300  comprises three main subcomponents: (i) Legend  302 , (ii) Info table  304 , and (iii) the pie slices  303 . The code block  305  comprises three code blocks, the PC1  306 , the PC2  307  and the PC3  308 , which are respectively responsible for the legend, Info table, and the pie slices. Upon the mouse being moved over an item (e.g., 2006) on Legend  302 , a respective slice for the year will be shifted outwardly, and respective information for 2006 will be shown in the Info-table  304 . To accomplish this, the subcomponents need to communicate with each other. Hence, the full pie chart&#39;s code block  305  comprises inter-component communication code  309 . The code block  305  for the full pie chart also comprises additional code to accomplish other tasks such as displaying title  301 . 
       FIG. 3   b  shows an example GUI component created by an instance of a container reusable GUI CCG class for a pop-up component. The pop-up component comprises two subcomponents. It displays the first subcomponent  321 . If the mouse  323  is moved over the first subcomponent  321 , it displays the second subcomponent  322 . 
     The presentation code of the component on a web page may contain any combination of the languages that are understood and used by the requesting browser or viewer. The languages include HTML, XHTML, DHTML, JavaScript, CSS, SVG, DOM, XML/XSL, X3D, Xforms, MathML, ChemML, SMIL, VRML, and VML. Presentation code may contain data in XML format, variables, program code in any of the supported languages and programming technologies. 
     Although different languages can coexist in the same document, logically they may be independent. In an SVG document, JavaScript code and SVG code coexist with clear markings to identify their respective code sections. Each JavaScript code section is marked by tag &lt;script type=“text/ecmascript”&gt; and tag &lt;/script&gt;, while the SVG code is marked by &lt;svg&gt; and &lt;/svg&gt;. A section of code in a particular programming language can be executed by the engine that is specific for the language. For example, SVG viewer may contain a JavaScript engine to execute JavaScript code included in an SVG document. However, other implementations may employ alternative methods. For example, Microsoft&#39;s XAML files are compiled into executable files and Adobe&#39;s MXML files are translated into Flash files before they are sent to the client platform. 
     It is permissible to include the component class definitions and other JavaScript code such as JavaScript methods of a component in an external file. An external file is included by using statements like &lt;script xlink:href=“GUIcomp_class_version1 — 1.js”/&gt; and &lt;script xlink:href=“RadiobuttonList_v1 — 0.js” language=“text/ecmascript”/&gt;. Component code includes code included in the SVG file and also all image files and external files incorporated by reference. Therefore, SVG document means SVG code page and all external files incorporated by reference. Likewise, HTML document or page also includes all image files and external files incorporated by reference. 
     Code sections in JavaScript may be included at any location in the SVG document because all variables and function names in JavaScript are global. JavaScript code may be placed in a separate file, which is referenced in an SVG document, as shown above. However, implementations on different platforms (e.g., viewers or browsers) may require different approaches to achieve the same result. 
     Elements in SVG can be grouped using tags such as “g” and “svg”. The X and Y coordinates of a component on the screen are determined by the values of enclosing SVG group element in transform=‘translate (X Y)’. If the component contains subcomponents, the subcomponents are placed in sub-SVG groups. The X and Y coordinates of these sub-SVG groups are with respect to the top-left corner of the enclosing SVG group. 
     Different sections of code in different languages on a web page may collaborate and communicate with each other. Generally, a programming language such as JavaScript is used to support interactivity, which makes the component intelligent and context-sensitive. Components on a web page may exchange notifications (signals events such as user clicks or state change) and call each other&#39;s service methods. 
     SVG graphics elements can be associated with JavaScript functions as user action listeners, which are called when specified action occurs on the SVG elements. The following sample code shows how an onclick listener is set on an SVG graphic element: 
     &lt;g id=“name_id” onclick=“my_alert(‘hot spot’)”&gt; &lt;text&gt;HotSpot&lt;/text&gt; &lt;/g&gt; 
     Upon clicking on the text element “hot spot”, the SVG element calls onclick listener function my_alert( ). Conversely, JavaScript code is used to access SVG elements by using their id names and manipulate their properties or attributes by changing their values. For example, JavaScript functions can use “name_id” to locate the SVG element and change its attributes. Since the IDs of the SVG elements are global, any JavaScript function in the SVG document can use the IDs to access the graphical elements and change their attributes. 
     The following SVG code represents a square and a Text “USA” next to it: 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 &lt;g id = ‘grp1’ transform=‘translate(5 5)’ 
               
               
                   
                 20. 
                 onmouseover=‘change_color(“red”)’ 
               
               
                   
                 30. 
                 onmouseout=‘change_color(“white”)’&gt; 
               
               
                   
                 40. 
                 &lt;text x=‘20’ y=‘20’ id = ‘txt1’ &gt; USA&lt;/text&gt; 
               
               
                   
                 50. 
                 &lt;rect x=‘5’ y=‘10’ width=‘10’ height=‘10’ id = ‘rect1’ 
               
               
                   
                 60. 
                 stroke-width=‘1’ stroke=‘black’ fill=‘white’/&gt; 
               
               
                   
                 70. 
                 &lt;/g&gt; &lt;!— End of SVG group whose id is‘grp1’--!&gt; 
               
               
                   
                   
               
            
           
         
       
     
     The &lt;rect&gt; statement represents a rectangle image of the size given by “width” and “height”, and places the image at the location given by ‘x’ and ‘y’ attributes. Any JavaScript function in the SVG document can access the elements using their IDs: ‘txt1’ and ‘rect1’. The coordinates are with respect to top left corner of its container group. 
     JavaScript code can be included in the SVG code of the component code. The location of the group is determined by the statement transform=‘translate (X Y)’. A JavaScript function (e.g., MoveGroup(grp1, New_X, New_Y)) is implemented that updates the values of X and Y to move the group, which is called at any time to move the group to a new location. 
     Event listeners are placed for SVG elements. The above group element has two event listeners, one for onmouseover at line 20, which is for the act of moving the mouse over the graphic element, and one for onmouseout at line 30, which is for the act of moving the mouse away from the graphic element. In this example, both of the events call the same JavaScript function with different parameters. An act of moving the mouse over will cause the graphic element to show a red color while an act of moving the mouse away will cause the graphic element to show a white color. 
     The following shows a sample implementation of the function, which changes the color of Rect and Text elements to ‘red’ when the mouse is moved over their elements, and restores their original colors when the mouse is moved off the elements. 
     
       
         
           
               
             
               
                   
               
             
            
               
                 &lt;script type=‘text/ecmascript’&gt; 
               
            
           
           
               
               
            
               
                 10. 
                 &lt;![CDATA[ 
               
               
                 20. 
                 function change_color(col) { 
               
               
                 30. 
                     var svgobj = SVG_Document.getElementById(‘rect1’); 
               
               
                 40. 
                     (svgobj.getStyle( )).setProperty (‘fill’, col); 
               
               
                 50. 
                     var svgobj = SVG_Document.getElementById(‘txt1’); 
               
               
                 60. 
                 if ( col == ‘red’) 
               
               
                 70. 
                     (svgobj.getStyle( )).setProperty(‘fill’, ‘red’); 
               
               
                 80. 
                 else 
               
               
                 90. 
                     (svgobj.getStyle( )).setProperty(‘fill’,‘black’); 
               
               
                 100. 
                 } 
               
               
                 110. 
                 ]]&gt; 
               
               
                 120. 
                 &lt;/script&gt; 
               
               
                   
               
            
           
         
       
     
     This function uses global variable, “SVG_document” at line 30, which is initialized as the root document, to find the SVG elements. This function uses the IDs to access and manipulate the color attributes. The example shows how SVG elements and JavaScript work together. This feature of using programming code and graphical elements to present components in a cooperative way is used to create code to present interactive or animating application component. 
     E. Structure and Features of Presentation Code of Components 
     It is preferable to encapsulate JavaScript functions and data variable necessary for the basic component in a class definition. The part of the presentation code JavaScript class implementation can increase performance efficiency although it is not required to implement them as classes. Class implementation offers two features. It is helpful to the maintenance of good code structure and class definitions are used to encapsulate data objects and service methods. Configuration information, state information, and other context information of a basic component can be placed in the variables of an instantiated object of class. The class methods determine the behavior and functionality of the component. If multiple instances of a particular class component are presented multiple times in the SVG document, the web page needs the class definition code only in the first instance, and can reuse the same class definition for instantiating an object in all other instances. By way of example, when a web page displays multiple pie charts, the page needs to include the class definition code of a pie chart only once. An object can be instantiated and initialized with specific data for each of the additional instances of the charts. 
     One of the objectives of designing JavaScript class for the basic component is to encapsulate the component&#39;s functions such as data access, system modeling, system performance analysis, presentation of application data, interactivity, animation, data processing, data updates, event triggers, component services and handlers. While JavaScript is not a perfect object-oriented language, it is in many aspects similar to general purpose programming languages such as Java and supports sufficient features to emulate an object-oriented language. It can be used in way of emulating class concept, which allows for defining a class that can encapsulate data variables, methods of initializing data variables, and service methods, which allow other components to access the services of the component. 
     The presentation code of a component is used as a basic building part (e.g., subcomponent) of a larger component. Programs are developed to “capture” and copy the presentation code of the pre-built component into a larger container component as a building subcomponent. 
     The presentation code of a subcomponent may contain a service method, which can be called by a method in another subcomponent to invoke the service. Likewise, the presentation code of a subcomponent may contain a method, which needs to call a service method of another subcomponent. 
     Therefore, some programming statements are designed to get the name of the service method of a subcomponent and use the name to “write” (e.g., generate) the cross-calling method in the JavaScript language, allowing the subcomponents to communicate with each other ( FIGS. 10   a ,  10   b  and  FIG. 11 ). 
     Moreover, a program is developed to write additional application code to establish the communication between the container component and the subcomponents. 
     Since JavaScript functions and variables are global in scope, one character string cannot be used by two variables or service method names on the same web page. 
     The presentation code is designed, by coding its CCG, to allow the component&#39;s graphic image to be used as a subcomponent and can be placed anywhere on the screen of the client computer. The coordinates of graphic elements of the presentation code are designed so that the presentation code can be placed deeply inside a nested component hierarchy. Relative coordinates system is used for graphic elements. If necessary, relative coordinates are converted to the absolute coordinates by traversing up the DOM/XML Tree and calculating the absolute coordinates. Since a component&#39;s presentation code is placed deeply in a component hierarchy, care is taken to avoid bugs in treating the coordinate system. 
     F. Representative Presentation Code or Component Code 
     1. Stock Quote for Company 
     The presentation code as viewed under an SVG viewer for displaying a stock quote for the company with ticker ORCL is shown in  FIG. 2   a.    
     2. Rotate-Banner 
     The complete component code of Rotate-banner is shown in Appendix A. It has a list of four subcomponents for showing stock information in SVG images for the companies with tickers ORCL, MSFT, INTC, and SUNW, respectively. Upon being loaded, Rotate-banner displays only the first component for ORCL. It displays the next component in the list when a user clicks on the currently displayed banner. When the user clicks on the last banner, it displays the first banner, for ORCL again. The source code in the figure contains four sections: Section One contains global variables and code to initialize them, and Sections Two to Four contain the presentation code of the Rotate_banner component. 
     Upon initial loading, only the banner for ORCL is set visible. Upon clicking on the initially displayed banner, the object&#39;s listener function display_banner is called, which hides the currently displayed banner and displays the next banner, MSFT (Note that index is used from 0 to 3). Upon clicking on the banner again, display_banner( ) is called again, which hides the displayed banner and displays the next banner, which is the banner for INTC. Clicking on this banner will cause it to show the banner for SUNW. At this point, one more click causes display_banner( ) to display the first banner, the banner for ORCL. 
     In Section One, the code defines a shared global variable “onload_init_list”, which is an array that is accessed by any component&#39;s code to add its initialization function, which is called when the svg-document loaded. The function svg_doc_onload_init (evt) contains the code to loop through the array and calls all these functions. This function is registered in order to be called upon the loading of the SVG document by statement: onload=“svg_doc_onload_init(evt)” in the first line of the svg-code. The first section also defines a shared global variable “SVG_Document”, which is used to access elements in the SVG-document. The function “init_svg_doc(e)” initializes the global variable “SVG_Document”, when the SVG document is loaded. This section of code, which is not part of the component code, defines common global variables, objects and methods. The SVG source contains the SVG document body tags, which encloses the code of the component. The SVG document body is defined by the statement: &lt;svg width=‘500’ height=‘200’ onload=‘svg_doc_onload_init(evt)’&gt; and &lt;/svg&gt;. 
     Sections Two to Four contain the code to present Rotate_banner component. Section Two contains the definition of the rotate_banner class. This class supports two service methods. The first method is add_banner (banner_id), which is used to add subcomponents during the initialization of the rotate_banner object instance. The second method, display_banner(new_banner), is called to hide the subcomponent currently displayed and display a new subcomponent, whose index is stored in the parameter variable new_banner. This method locates the group element containing the subcomponent using the “ID” of the group, and manipulates its attributes to hide and display. Section Three contains the code to instantiate a Rotate_banner object instance and the code to initialize it. Upon initialization, four ids are added using the service method of the Rotate_banner object. 
     In this example, the JavaScript code sections are placed in the main SVG file. Alternatively JavaScript code can be placed in external files, and included by reference: 
     &lt;script xlink:href=‘Lib/Rotate_banner_CLASS.js’ language=‘text/ecmascriptt’&gt; or 
     &lt;script xlink:href=‘TMP/Rotate_banner_UNQ_IDX.js’ language=‘text/ecmascript’&gt; 
     Section Four contains SVG-instructions for presenting the component and its subcomponents. The SVG-instructions define each of four subcomponents as a group and assign a name to each of the group ids (banner_id1_UNQ_IDX, banner_id2_UNQ_IDX, banner_id3_UNQ_IDX, and banner_id4_UNQ_IDX). These ids are used in Section Three to add the group-elements containing the subcomponents. Each group also contains presentation code of the corresponding subcomponent. The presentation code contains the definitions of graphic images or banners, respectively for ORCL, MSFT, INTO, and SUNW. By setting the values for the style&#39;s visibility attribute in each of the enclosing group elements, only one banner (e.g., the banner for ORCL) is set visible while the rest of three banners are not visible. Also, each group sets “onclick” event listener to call the object&#39;s service method display_banner( ) to display the next subcomponent in the list, using the statement: onclick=“rotate_obj_UNQ_IDX.display_baner(index)”. This service method is called when user clicks on the banner subcomponent. 
     Although the service method (i.e., rotate_obj_UNQ_IDX.display_baner(index)) of the object of Rotate_banner is used within the code of the component, it is global in scope and may be called from anywhere in the SVG document or by any other component in the SVG document (for example to show a new banner). 
     3. Show_layer 
     The code generator for show-layer takes an array of components. It generates the presentation code of the Show_layer component that can display or hide each subcomponent independently. Appendix B shows the actual presentation code of the Show_layer component. It has a list of four subcomponents for showing stock information for the companies with ticker ORCL, MSFT, INTO, and SUNW. Upon being loaded, show-layer displays only the first component ORCL. 
     The figure also contains four hot squares, which are used to demonstrate the way that external code uses the service methods of presentation code to communicate with and control the application component. If a user clicks on any of the square-button on the right, it uses the service method for the presentation code and swaps the state of the component between showing the component and hiding the component. 
     The source code in the figure contains five sections. The first section contains global variables and code to initialize them. The Sections Two to Four contain the presentation code of the Show_layer component. 
     In Section One, the code defines a global variable “onload_init_list”, which is an array that is accessed by any presentation code to add its initialization function, which is called when the svg-document is loaded. The function svg_doc_onload_init (evt) contains the code to loop through the array and calls all these functions. This function is called upon the loading of the SVG document by statement: onload=“svg_doc_onload_init(evt)” in the first line of the svg-code. The first section also defines a shared global variable “SVG_Document”, which is used to access elements in the SVG-document. The function “init_svg_doc(e)” initializes the shared global variable “SVG_Document”, when the svg-document is loaded. 
     Sections Two to Four contain the presentation code of the show_layer. Section Two contains the definition of the show_layer class. This class supports four methods. The first method is show_layer(lid, stat), which is used to set the state for the subcomponent, whose index is ‘lid’. The parameter ‘stat’ may contain ‘visible’ or ‘hidden’ correspondent to a SHOW or HIDE state respectively. The second method, switch_state(lid), is called to switch the state (between show and hide) for the subcomponent, whose index given in the parameter ‘lid’. The third method is add_callback(cb_name), which is used to register a callback function, whose reference is passed in the parameter “cb_name”. This callback function is called when the state of any subcomponent changes. The fourth method is layer_init(e), which is called to initialize the show_layer object. 
     The component code may include integration data such as the names of service methods and/or variables about the subcomponent in a comment section. The SVG viewer or browser skips all commented lines. The function of the integration data will be discussed in the Section of Container Component Code Generator (container CCG). 
     Section Three contains the code to instantiate a show_layer object and the code to initialize it. In the second section, an array of ids is declared and a show_layer object is instantiated, whose constructor takes two arguments: the above ID array and the index of the first subcomponent to be displayed. The component initialization code adds the initialization method of the object to the global onload-init list “onload_init_list”, which causes the method “layer_init(e)” to be called upon the loading of the SVG-document to initialize the show_layer object. 
     Section Four contains SVG-instructions to present the component and its subcomponents. The SVG instructions define a group element for each of four subcomponents and assign a name to each of the ids of the group elements (layer_id1_IDX_N, layer_id2_IDX_N, layer_id3_IDX_N, and layer_id4_IDX_N). The constructor of the object, in the Section Three, uses these id names to add the IDs of the group elements to an array and pass the array to the object. Each of the group-elements contains the presentation code of the corresponding subcomponent. The presentation code provides the definitions of graphic images or layers for ORCL, MSFT, INTC, and SUNW. Although the component in this example is a simple graphic image in each layer, it can be a complex GUI component that contains subcomponents and JavaScript code. 
     Section Five shows how to use external code to use a service method implemented in the code of the Show_layer component. The external code defines a function switch_the_state(num), which calls the service method layer_obj_IDX_N.switch_state(num) to switch the state of a layer passed in the parameter ‘num’. This section also contains SVG code to display four group elements, each of which contains SVG code to draw a square and title on screen. Further, each group element sets “onclick” event listener to call the function switch_the_state(index), where index is set to switch the state of appropriate layers based on the title for the square. This section also contains a function my_test_callback(num, cb_obj, stat), which prints the layer number and the state of the layer, to which the values are passed in the parameters. This function is registered as a callback for the object for the component code by using the following service method:
         layer_obj_IDX_N.add_callback(my_test_callback)       

     This service method can be called from anywhere in the SVG document to set a new callback for the component. The callback function “my_test_callbacK” is called whenever the state of any component is changed. For example, clicking on the square of the first component, ORCL, will cause the service method, switch_the_state(num), to change the state between shown and hidden states. Upon the change of state, my_test_callback(num, cb_obj, stat) is immediately “notified” to display an alert message. The same is true for components MSFT, INTO, and SUNW. 
     4. Service Registration 
     By designing the component-code-generating program, the code of one component may use predefined shared global objects to establish communication with other component in an application as shown in Appendix C. ( FIGS. 8   a  and  8   b ). The application may define certain global objects, which is accessed by the presentation code of any other component. Their names of variables and services are defined as global in advance so that they can be accessed from anywhere in the application code. The code in Appendix C shows a method of using a predefined global object to establish communication between two or more subcomponents. The method is a publish-and-subscribe method. This code listing also contains a few representative functions to demonstrate this. If the code is loaded into an SVG viewer, it displays a series of popup messages. 
     The source code listing in Appendix C contains four sections. Sections One and Two contain class definitions for the registration object and the code for instantiating a global registration object “service_register_obj”. Section Three contains a service method to be used by the application code of each of the components to register its service methods with “service_register_obj”. Section Four contains a method for the application code of other components to access the services by calling the methods of the registration object “service_register_obj”. 
     Section One contains the class definition code of the Service Registration object. This class supports three methods. The first method is add_service(name, func), which is used to register a service (e.g., target service) function or object, where the service&#39;s name is given in the parameter ‘name’. The parameter ‘func’ contains the reference to the target service method or object to be called. The second method, find_service (ser_str) is called to find the target service method or object, whose service name is given in the parameter ‘ser_str’. The third method, get_service (ser_str, par1, par2, par3) is called to run the target service method, whose service name is given in the parameter ‘ser_str’. 
     Section Two contains the code to instantiate a service_register_class object. The name of the instantiated object may be predefined for the application at the beginning of the application design and published its functions and their interfaces. The global object “service_register_obj” can be referred from anywhere in the SVG document. Any component that offers a service can be designed to include application code (e.g., service_register_obj.add_service(name, func)) to publish its service by registering the service function and giving a unique name for lookup. The chief designer or architect of the application can determine lookup name during early design and share with developers of other components of the application. 
     If any other component requires a published service, it can include application code (e.g., service_register_obj.find_service(lookup_name)) for getting the reference to the service function from the global service registration object by using the pre-determined lookup name of the service. 
     Section Three contains code that defines three service functions. The section also contains code that uses three unique names to register each of the functions with the global “service_register_obj”. The first function is test_service1(par1, par2, par3), which accepts an XML string in the first parameter, and displays two popup message windows. This example also shows a method for using an XML data variable as a function parameter to pass data between two components. Second and third functions just display a popup message each. Section Four contains an XML string and code that defines a test function services_use_demo(e). The code in the test function uses the names or the services to look up the services functions and shows how to request the services. 
     This publish-and-subscribe method may be used to exchange data between any two components in the application. One component contains code for registering one or more services as shown in the section three. Other components are designed to access the services as shown in the section four if the names of the services are known at the time of development for the other components. 
     Example 1 
     Pie Chart 
     The presentation image of a full pie chart component is shown in  FIG. 3   a . The full pie chart component contains subcomponents such as legend, Info-table and pie slices (for presenting all the slices of the pie chart). Three presentation code sections may respectively present the subcomponents, which are embedded in the presentation code of the container pie chart component. The presentation code of the pie chart contains communication code allowing the subcomponents to collaborate and communicate with each other. When the mouse moves over any of the legend items, the component on the screen highlights the corresponding slice in the pie, and displays its relevant information in the info-table. 
     The presentation code of the component comprises the presentation code of the subcomponents such as legend, info-table and pie-slices. It may also contain additional code for performing miscellaneous tasks such as placing the subcomponents within the component. A separate chuck of SVG code, defined by tags &lt;g&gt; and &lt;/g&gt;, is dedicated to each of the subcomponents. The location, as defined by coordinates, of each of the subcomponents in the component is determined by group&#39;s attribute transform=“translate(X Y)”, where X and Y are coordinates of the group with respect to the top left corner of the container group. 
     While the presentation code shown in the above examples is associated with graphic images, it is not so limited. Application code, including presentation code, may be used to control hardware devices through interface such as ActiveX supported on the platform. Therefore, presentation code includes any type of code that is proper for the platform. Also, the application code may contain code for communicating with a server to get latest data to update component by using Asynchronous JavaScript and XML (Ajax) 
     G. Component Code Generator (CCG) 
     A component code generator (CCG) is built with code design, which upon initialization and execution (e.g., calling its CGM), generates the presentation code of component. The code listing in Appendix E shows an example of CCG for component rotate_banner. 
     1. Basic Code Structures and Properties 
     A CCG contains the code necessary for generating component code for presenting the component in graphic image. Since a component is ordinarily presented on a computer screen to reflect some properties observed in the real world, the CCG of the component requires some application data. However, it is not required to contain any code of application logic for retrieving business data, analyzing system performance, and modeling systems. For example, a reusable CCG class to present GUI components (e.g., a pie chart or line chart) contains methods for inputting necessary data. Each GUI CCG object instance uses the input data to generate presentation code for the GUI component. 
     The basic CCGs implemented in the present invention are derived from a base abstract class. One of the possible implementations is AgileTemplate.java (Appendix D) even though the class name is arbitrary. AgileTemplate.java has a variable UNQ_ID, which is initialized at the time of object instantiation by using any utility tool to assign a unique ID (a number or string) to each of the CCG object instances derived from the base class. An ID assigned to one component must not be used by any of other components in the SVG document. This utility tool remembers all of the assigned IDs and provides a new ID for each new assignment request. In this simple example, AgileTemplate.java uses static variable TemplateCount to assign a unique number to UNQ_ID. A UNQ_ID is appended to each of the names of variables and SVG element IDs in order to avoid conflicts in the service names and variable names in the SVG document. Each CCG also implements the abstract method CGM defined in the base class. Optionally, the CCGs can be implemented in their own classes even though this implementation might require specific attention from application developers who use the CCGs. 
     A CCG, which implements its own presentation logic, comprises variables for storing data, one or more constructors, and methods for initializing the data for variables. The CCG implements simple methods for inputting data and, optionally, specifying presentation style such as drawing colors, font sizes, and other customization information. The CCG also takes the parameters of the requesting browser as inputs. It uses all the data to create presentation code in SVG and JavaScript language. 
     The CCG supports code-generating method (CGM), which is a service method of its instantiated object. When this method is called, it generates a chunk of SVG or equivalent code, referred to as presentation code, which is compatible with the requesting platform. CGM is an abstract method in the super class, AgileTemplate, and is supported in all CCGs used in this invention. Since CGM is defined in the super class, each derived subclass inherits the CGM from the supper class and overrides it by the CGM of the subclass. By way of example, the CGM in a pie chart subclass generates presentation code to show a pie chart while the CGM in a line chart subclass generates the presentation code to display a line chart. 
     The CCG can also implement coupling service methods, which are used for setting or getting integration data of the component created by the CCG. This integration data is used to create inter-component communications code between the component and other components (or application code). Examples for the coupling service methods are setCallBackName( ) and getBannerUpdateMethodName( ) in appendix E. 
     A container CCG may contain class variables to store all the information necessary to initialize the CCGs of the subcomponents. The container CCG has constructors and methods for initializing its object variables, validates the data in the variables, and uses them to initialize each of the CCG objects of subcomponents. It initializes the variables for each of the CCG objects before it calls the CGM of each CCG object. 
     A container CCG may get other CCGs by any importing method provided in the programming language. The CCGs that are used as subcomponents by another container CCG is referred to as subcomponent CCGs. Subcomponent CCGs can be directly imported into a container CCG using a suitable method. When the container CCG and the subcomponents CCGs are coded in Java, instantiated objects of subcomponent CCGs can be input into the container CCG object by using its methods such as set-methods, constructors or initialization methods. A JSP application can select one or more subcomponent CCGs for inputting into container CCGs such as Rotate-banner or Show-layer to generate container component code as part of the application code. In this case, the subcomponent CCGs are selectable by the JSP and inputted into container CCG. The objects of subcomponent CCGs are instantiated outside the code of the container CCG (but inside the JSP file), and are imported into the container CCG object. The container CCG then calls the CGM of each of the imported subcomponent CCG objects to generate the presentation code of the subcomponents. 
     To present a component such as a pie chart or a map on the platform using an instantiated CCG class object, it is necessary to provide the minimum amount of data for initializing the object. If the CCG is coded in Java, data initiation can be done using set methods and constructor methods of the CCG class. Additional methods are used in the CCG for customizing the component. The object of the CCG may accept a wide range of data concerning presentation style, user-interface feel and look, user&#39;s profile, business matter, requesting browser, and even information about other CCGs, whose objects can be used to build subcomponents. 
     Example 2 
     Pseudo Code for Using CGM of the CCG 
     The basic steps for generating presentation code are shown by following pseudo code:
         10. GUI_CCG_PieChart Pie1=new GUI_CCG_PieChart(“Portfolio at the End of 2nd Quarter”);   20. Double val[ ]={10000, 12000, 14000, 16000, 18000};   30. String names [ ]={“Sun”, “Microsoft”, “IBM”, “Intel”, “Oracle”};   40. Pie1.setData(5, val, names);   50. Pie1.CGM(page_info, out);       

     First, a Java class, GUI_CCG_PieChart, is defined. In line 10, a class object is instantiated with a title “Portfolio at the End of 2nd Quarter”. The object saves this title in the string variable and uses it in generating presentation code. In line 20, an array of doubles is assigned with five performance numbers, one for each of five companies. In line 30, five name strings are assigned with respective company names. The value assigned to a double in the “val” array corresponds to the company name in the “names” array with the same index. In line 40, Pie1.setData is called to set data for the object Pie1 in run time so that the object is initialized with the values in the “val” array and the “name” array. In line 50, the CGM of the object Pie1 is called to generate the presentation code in the SVG format. By using this CCG to generate the presentation code of the pie, it is unnecessary to write hundreds of lines of presentation code for all image elements in the pie chart line by line. A Java developer, who uses reusable GUI CCG classes as building parts, needs little knowledge of the SVG language. To port an application in the CCG form to a newer-version SVG platform, the only thing required is to redesign the presentation code in the GUI CCG class without the need for modifying the JSP code that uses the reusable GUI CCG classes. 
     When output stream OUT is used in Java to create presentation code for a component, anything to be generated by the “OUT” statement is appended to the document currently under creation. If this component is used as a subcomponent of a larger component, the code of this component is embedded at a proper location in the SVG code of the larger component. 
     Generally, one GUI CCG class is needed for each type of components: one for the pie chart component ( FIG. 3   a ), one for the bar chart component, one for the hierarchical menu component ( FIG. 3   d ), and one for the expandable menu component (as shown in  FIG. 3   c ) 
     The objective of designing GUI CCG class is that the CGM of each of the GUI CCG objects is able to generate intended presentation code dynamically using run-time updated data. Furthermore, the object instance of each of GUI CCGs should be highly configurable so that each of the GUI CCGs is reusable in a large number of possible applications. Plural GUI CCGs objects are instantiated in an application, each of the objects for a component instance. For example, a GUI CCG class for pie chart is used to instantiate multiple CCG objects and initialize each CCG object with respective data to present a pie chart. 
     H. Business Logic in Component-Code Generator 
     A CCG may contain code of business logic. When a CCG contains code of business logic in the container component or in the CCGs of the subcomponents, it is referred to as Application Component Code Generator (ACCG). An ACCG is designed to perform or support specific application functions or designed to encapsulate many functionalities such as application and presentation logics to independently create an application component. 
     1. Basic Properties of ACCG 
     An ACCG is a special type of Java class and contains all the characteristics of CCG ( FIG. 4 ). It also supports the CGM so that its instantiated class objects are freely interchangeable with other CCG objects (e.g., to use for subcomponents). Therefore, an ACCG that is derived from the super class AgileTemplate also supports the same CGM used in the CCG. Both ACCG and CCG objects may be used as building blocks or subcomponents in the same way to generate the presentation code of subcomponents. 
     In an ACCG, the code of presentation logic and application logic are encapsulated in the object class ( FIGS. 4 ,  5 ). 
       FIG. 4  shows a simple application component code generator (‘ACCG’)  400  and a GUI component  421  created by the ACCG  400 . The ACCG uses a reusable GUI CCG  403  for bar chart. The server application or business logic in the ACCG  400  comprises code to access application data from data sources  401  and configuration files  402 . The server application code uses the data and information from an object  410  that has data about client and browser to initialize the GUI CCG  403 . The GUI CCG comprises methods  404  to input data and variables  405  to store data. The GUI CCG also comprises a CGM (Code Generation Method) to generate the code block  420  to render the GUI component on the client. If the code block  420  is properly included on a web page and viewed in an appropriate browser, it displays the GUI component  421 . 
       FIG. 5  shows an ACCG  500  and a GUI component  511  created by the ACCG  500 . The ACCG  500  is run on a first platform, which is usually a server, and its resultant component  511  is sent to a second platform, which is normally a client. The code of presentation logic of the ACCG  500  uses two GUI objects  501  and  502 , which creates the subcomponents  512  and  513  of the GUI component  511 . In addition, the ACCG  500  also uses other objects such as database object  505 , user/client object  506 , EJB object  507 , policy/rules object  503 , and algorithm object  504 . The ACCG  500  also contains code for accessing external data sources such as configuration-files  510 , remote XML data  509 , and database server  508 . The ACCG  500  also comprises code for processing all the data and initializing the GUI objects  501  and  502  in creating GUI component  511 . The ACCG  500  also contains code for accessing external data sources such as configuration-files  510 , remote XML data  509 , and database server  508 . 
     The database object  505  may contain application data from database sources; the user/client object  506  may contain style and configuration data, user&#39;s profile, preference information, client IP address and browser information; EJB object  507  may contain business data, the policy/rules object  503  may contain rules related to access security; and the algorithm object  504  may contain computation methods for processing application data. They are all placed in variables and methods independent of the portion of code for presenting the component. Once any of the class objects  501 - 507  is instantiated, the values of the variables, which are used in presenting the component, are set in run time. 
     The code of application logic of the ACCG is designed to access internal and external data such as configuration-files  510 , remote XML data  509 , and database server  508 , initialize the variables, and get information about the platform such as the version and type of the requesting browser. Also, the methods used in application logic are called to process application data for customization before they are used to generate the presentation code. By calling its CGM, the ACCG object generates platform-compatible presentation code of the component in real time. 
     Instead of implementing its own presentation-logic code, an ACCG can use the objects of the GUI CCGs such as pie chart, trees and table to generate presentation code for the subcomponents. In this case, the ACCG contains code for instantiating and initializing subcomponent CCG objects and code for calling the CGM of the objects to generate the presentation code of the subcomponents. Hence, the ACCG is also a container CCG.  FIG. 3   c  shows a component created by an ACCG using expandable menu and stock quote components.  FIG. 6  shows how an ACCG uses three other ACCGs for respective three subcomponents to build a container component. 
     It is desirable that the ACCG class is capable of being easily redesigned to meet changing business needs or to be easily replaceable. So it is desirable that the ACCG class requires minimal initialization by fully encapsulating both application logic code and presentation logic code. While it is not required to implement an ACCG in an object class, use of class definition in the ACCG to encapsulate both the code of presentation logic and the code of business logic makes the ACCG replaceable. 
     Because an ACCG is a special member of CCGs, it has the basic functions of CCGs. Therefore, an ACCG class object of a component is used as subcomponent by a container ACCG to generate the presentation code of the subcomponent. By repeating this process, application developers can build larger and larger components. 
     An ACCG not only generates subcomponents for the presentation code of the container component using subcomponent CCGs but also generates the rest of the presentation code such as placing/organizing the subcomponents generated (e.g., by enclosing CGMs of subcomponent CCGs between tags &lt;g&gt; and &lt;/g&gt;) and fills in any gaps ( FIG. 7 ). 
     In some cases, the subcomponents in a container component may need to communicate or exchange data with each other.  FIG. 10   a  shows a container CCG  1020  for generating application code for container component  1023 . The container CCG  1020  comprises server code for instantiating and initializing two CCGs  1021  and  1022 . The container component also comprises code for calling each of the CGM of each CCG  1021  and  1022  to generate application code for subcomponents  1024  and  1025  respectively. In this case the subcomponents  1024  and  1025  cannot communicate or exchange data with each other. In comparison,  FIG. 10   b  shows how communication code is generated for two subcomponents. The container CCG  1030  in  FIG. 10   b  comprises server code for instantiating and initializing two CCGs  1031  and  1032 . The container component also comprises code to call each of the CGM of the CCG  1031  and  1032  to generate application code for subcomponents  1035  and  1036  respectively. In addition, the container CCG  1030  comprises server “code of integration logic”  1033 , which calls coupling service methods of CCGs  1031  and  1032  to set or get integration data for generating necessary application code  1037  allowing for the communication between the subcomponents  1035 ,  1036  and the container component  1034 . 
     Inter-component communication code is useful in many cases. In the pie chart ( FIG. 3   a ), for instance, the Info-table component displays a few pieces of information when the mouse is moved over certain hot spots. Also, it is desirable to highlight the relevant parts of the chart when the mouse is moved on to the top of an item in the legend. 
     Example 3 
     Pseudo Code of Stock Quote Component 
     The following is an example of an ACCG that generates presentation code to present the stock information ( FIG. 2   b ). The ACCG in this example is a Java-class component that takes a company ticker symbol as input and generates presentation code to present the stock information as shown in the figure. 
     The ACCG of the stock component implements a method or a constructor for setting a ticker symbol. The application developer may implement application logic in the class definition. The CGM uses the ticker symbol to access other data sources for the real-time stock information of the company associated with the ticker, and then generates the presentation code. To generate the components presentation code, it may use GUI CCG classes of table and charts to present its subcomponents. 
     A stock object is instantiated with the ticker symbol of the company as below: 
     StockInfoPCF SiACCG1=new StockInfoPCF(“SUNW”); 
     An application developer may instantiate stock objects for tickers ORCL and MSFT, respectively. 
     StockInfoPCF SiPCF2=new StockInfoPCF(“ORCL”); 
     StockInfoPCF SiPCF3=new StockInfoPCF(“MSFT”); 
     These ACCG objects are passed to another ACCG or CCG as building blocks. The ACCG objects, upon being called by the container CCG, generate the presentation code to present the stock information, respectively, for those companies. 
       FIG. 6  shows code for a container component code generator (‘Container CCG’)  600  that generates a code block, which presents the container component  610  when it is included in a web application and viewed on appropriate browser. The container CCG  600  uses the code section  601  to get the application code for presenting the subcomponent  611 . It then uses the code section  602  to get the application code for presenting subcomponent  612 . Likewise, it uses the code section  603  to get the application code for presenting the subcomponent  614 . 
     Appendix D contains a sample implementation of CGM (Out, RequestObj, X_LOC, Y_LOC, Attributes), which places the subcomponent at given coordinates (X_LOC, Y_LOC) with respect to its container canvas such as SVG group. This CGM includes an SVG group (i.e., &lt;g transform=‘translate(X Y)’ and &lt;/g&gt;) at the coordinates and calls the main CGM for including the code of the subcomponent in the group. 
     Many ACCG classes are built, respectively, for one-year, six-month and three-month stock information. They take the ticker symbols and build the charts for one-year, six-month and three-month charts for the companies using customer preference data. The container ACCG can dynamically use if-then-else statements to instantiate ACCG objects in building the presentation code respectively for one-year, six-month, and three-month periods. 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 AgileTempate Subchart = null; 
               
               
                   
                 20. 
                 If (user_prefers == yearly_chart) 
               
               
                   
                 30. 
                 Subchart = StockYearlyChart(“ORCL”); 
               
               
                   
                 40. 
                 Else 
               
               
                   
                 50. 
                 If (user_prefers == half_yearly) 
               
               
                   
                 60. 
                 Subchart = new StockHalfYearlyChart(“ORCL”); 
               
               
                   
                 70. 
                 Else 
               
               
                   
                 80. 
                 Subchart = new StockQuarterlyChart(“ORCL”); 
               
               
                   
                 90. 
                 Subchart.CGM(Out, required_params); 
               
               
                   
                   
               
            
           
         
       
     
     The above pseudo code shows a method of dynamically selecting subcomponents and building custom container component. The ACCGs of those sub-charts may contain methods for accessing the data about user preferences and the parameters of the requesting device. The instantiated objects of the subcomponent ACCGs may use the data and the parameters to customize the style of the charts. For example, to change the business logic or fonts of the charts, the ACCG classes for the subcomponents are redesigned. The container ACCG in  FIG. 6  may dynamically select their subcomponents and assemble the presentation code generated by the subcomponents. 
     It is often desirable to create presentation code of many subcomponents (e.g., stock quotes in  FIG. 2   b ) using real-time data. The presentation code may also contain other types of subcomponents, and each of the subcomponents in turn is custom-built on the basis of user&#39;s profile and preferences. The container ACCG ( FIG. 14 ) supports a method for inputting an array of strings holding the names of companies (shown in Drop-down list) and an array of CCG objects (displaying the stock quotes). 
     2. Black Box Assembling Method 
     Black box assembling refers to assembling of subcomponents for building a container component without knowing the types or classes of subcomponents. If the container CCG does not need to create communication code for the subcomponents, it could blindly assemble the presentation code of subcomponents. 
     A container CCG is designed to use the CGM of the CCG objects of suitable subcomponents built for line charts, trees and tables to generate presentation code. 
     (a) The Basic Features and Functions of Container CCGs 
     Container CCGs are designed to perform the following functions: 
     (i) instantiating and initializing the CCG objects of subcomponents or providing methods for inputting the CCG objects of the subcomponents, 
     (ii) calling the CGMs of the objects to generate the presentation code of the subcomponents at the right location in the resultant presentation code of the container component, and 
     (iii) generating miscellaneous code necessary for the container component. 
     As shown in Appendices A and B, the presentation code of the container component basically comprises SVG code, JavaScript code and the presentation code of subcomponents. It can contain code in any of other programming languages proper on the rendering platform. 
     A container CCG is designed so that when the instantiated object of the container is run (e.g., at server), the CGM of the object is able to generate the container component&#39;s functional presentation code (runs on the client), which includes SVG code, JavaScript, and the presentation code of included subcomponents. All necessary code to be generated is coded in the container CGM. If the container CCG is coded in Java language to generate JavaScript and SVG code, the CGM of the container CCG simply uses the OUT statement using quoted strings to print the JavaScript and SVG code. The location of the lines of JavaScript code or SVG code on the SVG document depends upon the calling sequence. If the CCG is coded in other languages such as C (which can be used to implement OOP, indirectly) and C++, the developer simply uses PRINTF or COUT statements in the container CGM. Regardless of the language used in coding the container CCG, the developer must plan in advance to design the application code statements necessary to display the component on computer screen properly. The developer can use a series of string-printing statements in the container CGM for generating wanted application code statements. When the container CCG is run, it generates the intended application code statements. This simple technique can be used to generate SVG code, JavaScript code, and other miscellaneous code necessary for the container component. 
     Since the container CCG generates the presentation code of subcomponents by calling the CGMs of the subcomponent CCG objects, the developer has no need to write the presentation code of subcomponents in the container CGM line by line. What the developer needs to consider is where to place the presentation code of each of the subcomponents by using proper coordinate values for each subcomponent on the display screen relative to the container component. Usually coordinates of each subcomponent are with respect the top left corner of container component. Different coordinate systems are used in different cases, depending upon the programming languages and technologies. 
     When application code of a container component is written in SVG, the location of a subcomponent&#39;s presentation code in the container component code file is independent of the location of the subcomponent image on the display screen and its shape. The subcomponent image location is defined by the X and Y values in transform=‘translate (X Y)’ with respect to the coordinates of the enclosing element/component location. Therefore, presentation code blocks for plural subcomponents may be placed in the presentation code of the container component in any order. To define the location of a subcomponent image on the display screen, the container CCG can use the following statements to place presentation code for the subcomponent: 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 out.println(“ &lt;g transform=‘translate(X Y)’ &gt;” ); 
               
               
                   
                 20. 
                 SubCCG.CGM(out, pageinfo); //writes presentation code. 
               
               
                   
                 30. 
                 out.println(“ &lt;/g&gt;” ); 
               
               
                   
                   
               
            
           
         
       
     
     One exception to the above rule is when the SVG images of two subcomponents overlap on the display screen (e.g., one is on top of the other), the presentation code of the top subcomponent must be placed after the presentation code of the bottom subcomponent in the application code. 
     In comparison, if the presentation code of subcomponents is written in HTML, the locations of the subcomponent images are determined by the order the subcomponents appear. If a subcomponent is in a table cell, the call to CGM of the subcomponent is made between two tags that define the cell: 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 out.println(“ &lt;TABLE WIDTH=100%&gt; ” ); 
               
               
                   
                 20. 
                 out.println(“ &lt;TR&gt; ” ); out.println(“ &lt;TD&gt; ” ); 
               
               
                   
                 30. 
                 SubCCG.CGM(out, pageinfo);. 
               
               
                   
                 40. 
                 out.println(“ &lt;/TD&gt; ” ); out.println(“ &lt;/TR&gt; ” ); 
               
               
                   
                 50. 
                 out.println(“ &lt;/TABLE&gt; ” ); 
               
               
                   
                   
               
            
           
         
       
     
     In this example, Lines 10, 20, 30, and 40 define a table and a table cell. In Line 3, a call is made to run the CGM for the subcomponent SubCCG. The application code of the component from the CGM is filled into the cell of the table. 
     If an SVG document is included in an HTML document, the SVG document must be placed in a separate file which may be included in the HTML page using the EMBED tag. Many XML-based graphics technologies may not allow for inclusion of documents from other XML-based graphics technologies. Therefore, it is necessary to consult technical manuals of respective graphic technologies to determine whether two particular technologies can be used in combination. 
     The AgileTemplate abstract class may also contain commonly useful methods and properties such as (X, Y) coordinates for presenting the component and the method of defining the size of the bounding box by width and height. If those methods and properties are supported in the abstract class, they may also be accessed from CCG objects. 
     After a first container CCG is properly built for a component, an object of the container CCG can be used to build a second larger container CCG by using this black-box assembling technique. In building this second container component, the developer may use the same approach the developer used in coding the first container CCG, subject to the same limitation discussed below. The CGM of the first container CCG is able to generate complete presentation code for its component during execution. The presentation code of the second container CCG comprises the presentation code of the first container component, which is now a subcomponent in the second large container component. The presentation code of the first container component naturally includes SVG code, JavaScript code, and the presentation code of the subcomponents of the first container component. 
       FIG. 7  shows the general steps for generating a simple container component code when its CGM is run. When the CGM is started, it first starts writing presentation code of the component at Block  701 . Block  702  is a point for repeating the execution of object writing code. It then writes the presentation code of the first subcomponent (Block  703 ) by calling the CGM of the subcomponent if the object is a subcomponent belonging to a component class. If the object is unknown class or a string buffer, the CGM just prints it out. The CGM resumes writing container component code (Block  704 ) and checks if there are more objects (Block  705 ). If there are more, the CGM repeats the process of running the objects by going back to Block  702 . When no more objects are to be written, the CGM generates the remaining code (Block  706 ). It may optionally register the component class with a registration object. It then checks if a registration flag exists at Block  707 . If it does, it executes the code necessary for registration at block  708 . Otherwise, CGM execution ends at Block  709 . 
     (b) The Limitation on the Use of Black-Box Assembling Method 
     Block box assembling technique is useful only in the case where the subcomponents in application code do not need to communicate with each other and the container CCG does not need to know the names of service methods and the names of variables used by the subcomponents. In this case, the object of any subcomponent CCG is passed to the container CCG as a building block as long as the subcomponent is appropriate for the container component from the business point of view. The container CCG uses only the properties and methods supported in the base class AgileTemplate. Since all the CCGs are derived from AgileTemplate class, which supports CGM, any container CCG may properly call the CGM of the CCG objects to generate presentation code. 
     3. Container CCGs that Use the Black-Box Assembling Method 
     The following CCGs are used to build component using the black-box assembling technique: 
     (a) Rotate-banner container CCG (its source code in Appendix E and a sample component code in Appendix A). This container CCG takes a list of CCG objects for subcomponents by input and displays one subcomponent at a time and displays next subcomponent in the list when a user clicks on its hotspot. 
     (b) TAB CCG. It takes a list of CCG objects and a list of names of the objects, displays the first component and all the names at the top of the display area, and, upon being clicked on a new name, displays its component and highlights the name; 
     (c) Zoom-and-pan CCG. It takes any CCG object and displays its component in a zooming and panning area, and also provides controls to zoom and pan the component. 
     (d) Drawing-area CCG. It takes a list of CCG objects and each of their coordinates, and draws their components at proper locations (its source code is in Appendix T and sample test code in Appendix U). 
     (e) Scroll-bars CCG that takes a large CCG object and displays its component in an area with scroll bars. It is useful for displaying a larger image in a smaller area. 
     4. Container CCGs that can Use Subcomponent CCG Objects 
     The following container CCGs may use any subcomponent by using the black-box assembling technique: 
     (a). The tool-tip. The CCG for the tool tip may take any CCG object instead of just a string. It displays the component generated by the CCG object when mouse moves onto any hotspot. This component could be just a string or a large component, which in turn contains many subcomponents of its own. Since any CCG object may be used to build a popup component, it is flexible to build and customize the tool-tip. Likewise, the footer or title of a chart is presented by using CCG objects. In that case, the method that configures this part can accept a CCG object or a string to present the component for the footer or title. 
     (b). Legend CCG. It can take a list of CCG objects and each legend item is created using a CCG object. 
     (c). Common menu CCG. The CCG for creating a common menu such as hierarchical menus, pull-down menus or popup menus can use any CCG objects in any of the cells of the menus. 
     (d). A Landmark CCG. It may take two CCG objects. It displays a component, which is created by a first CCG object. When a user clicks on a hotspot of the first component on screen, it pops up a component, which is created by a second CCG object. This CCG is used to present landmarks as hotspots and a popup window for showing detailed information about a selected landmark on top of an image such as a city map image (i.e., City map is used as a background image). 
     3. Application of ACCGs. 
     ACCGs were designed in this invention to create the following kinds of components. 
     (a). Custom Weather Chart 
     An application developer may create a custom weather ACCG, which takes a city name denoted by a zip code and generates presentation code to show the weather conditions for the selected zip code. The ACCG class may have a method or constructor to set the value for the zip code. For example: 
     AgileTemplate Weather=new Weather_ACCG (20203); 
     The ACCG class may also have a method, which implements the application logic for retrieving the data on the weather conditions for any selected zip code. When a class object is instantiated using entered zip code, the method for retrieving the data on the weather conditions is called before the data is used by CGM in generating the presentation code. When a user inputs a zip code, the ACCG object then retrieves the data on the weather conditions for the selected zip code. After the necessary data is obtained, the CGM of the ACCG object generates the presentation code to display image showing the weather conditions. This ACCG object is used as a building block in another ACCG or CCG to build a further larger application component. 
     Likewise, an application developer may create a custom stock movement charts ACCG, which takes a ticker-symbol of a company and generates presentation code to show a stock movement chart for the company. The ACCG class may have a method or constructor to set the value for the ticker symbol. For example: 
     AgileTemplate StockCharts=new StockCharts_ACCG (“IBM”); 
     The ACCG class may also have a method, which implements the application logic for retrieving the data for the stock charts for any given ticker symbol. The CGM of ACCG could use the data and GUI CCG classes for stock charts to generate code to present the stock-chart component. 
     (b). Mouse-Over Menu 
     The mouse-over popup is shown in  FIG. 3   b . This popup menu uses two components. It presents a first component showing “Chicago Weather”  321 . When the mouse  323  is moved over this component  321 , it opens a popup window  322 , which shows a second component. The popup window, which is another layer, will be closed when the mouse is moved away from both of the components. Each component passed to the mouse-over popup object may be just a string variable or a CCG object. If it is a CCG object, the popup object uses the CGM of the CCG object to generate the presentation code to present the component in a popup layer or window. 
     (c). Expandable Menu 
       FIG. 3   c  shows an example GUI component created by an instance of a container reusable GUI CCG class for expandable menu. The GUI component shows three menus components  331 ,  332  and  333 . Upon clicking on the menu component  332 , it moves the menu  333  downwardly to make a space for displaying the subcomponent  334 . Upon clicking on the menu component  332  again, it hides the subcomponent  334  and moves the menu  333  back to its original location. 
     Expandable component may have one or more pairs of parent and child components. If the child is already displayed, clicking on the parent will cause it removed. Both the child and the parent components are just string variables or any CCG object. If it is a CCG object, it uses its CGM to generate the presentation code. The CCG uses all subcomponents&#39; presentation code as building blocks to build its presentation code. It is an example of HTML/DHMTL component. 
     (d). Hierarchical Menu 
       FIG. 3   d  shows an example GUI component created by an instance of a container reusable GUI CCG class for hierarchical menu. The GUI component displays top-items  341  of the hierarchical menu. If the mouse is moved over one of the top-items, the GUI component displays the sub-items  342  for the top-item. If the mouse further moved over one of the sub-items, the GUI component displays sub-options  343 . When the mouse is moved away from the GUI component, it closes sub-items  342  and sub-options  343 . 
     A hierarchical menu may have many top menu items. Each top menu item may have many submenu items. The menu presentation code contains logic to present the associated sub-menu. These submenu items may have sub-options and so on. This kind of hierarchy may go to many levels. To present a hierarchical menu, a user may instantiate the CCG class for the hierarchical menu. The top menu items and sub-menu items are specified and passed using set methods of the hierarchical menu GUI CCG class. It is an example of HTML/DHTML component. 
     5. Wrapper Component Code Generator (CCG) 
     A wrapper CCG is a special CCG. A wrapper CCG is created to fetch the presentation code of components or other necessary data from a wide range of sources for assembling the component. The basic requirements for the wrapper CCG are (i) getting component code upon calling its CGM and (ii) if the component needs to communicate or collaborate with other components in the application, it must implement methods for looking up ‘integration data’ and return the ‘integration data’. Integration data are placed in the comment section of the component code. 
     When an ACCG for a component (e.g., stock quote) is running on a remote server at a different location, the wrapper CCG is used to get the presentation code of component from the remote server. The wrapper CCG, which takes a URL and post-parameters as input, calls the server to execute corresponding CGI program, which uses an ACCG. The ACCG&#39;s CGM then generates the presentation code of the component, which is returned to the wrapper CCG. 
     The wrapper CCG may call a JSP or Servlet running on a remote server to get code for part of a web page or component (the Servlet and JSP are also known as Portlets). The process for fetching a component&#39;s presentation code is same as a browser fetching a web page from a server. By designing the code of the wrapper CCG during development, the CGM of the wrapper CCG can generate/fetch the block of presentation code for the component in execution and “copy” it into the container component&#39;s presentation code. Obviously, a wrapper CCG is used to fetch the presentation code of a component from a remote Portlet. The components fetched from remote servers are popularly known as“mashups”. 
     If the presentation code of a component has been already created and stored in a file, a wrapper CCG may be implemented in another class. The wrapper CCG class is designed to extract the presentation code from the file. The input to the object of the wrapper class is a file name that contains component code. The CGM may also change the names of the variables and service methods in the presentation code by affixing unique index numbers (or unique strings) so that they are not in conflict with the names of the variables of other components in the SVG document. 
     A wrapper CCG, implemented in class, is reusable. A variety of reusable wrapper CCGs is created to fetch components from many popular applications and files of different formats. By way of example, a wrapper CCG is used to fetch a small summary data table of a large spreadsheet document and use the data for generating SVG code to present the table (e.g., part of the spreadsheet) as a subcomponent on a web page. The input to the wrapper CCG object may be the filename of the spreadsheet and parameters for locating the summary table. The wrapper CCG always gets the latest and most updated summary data table even if the data in the spreadsheet is frequently updated. 
     6. Avoiding Conflicts in Variables and Method Names in Application Code 
     A large SVG document created by using a container CCG for a component may contain the presentation code of many subcomponents. The presentation code of each of the subcomponents may further contain the presentation code of subcomponents. The presentation code of component and/or subcomponents may contain several JavaScript methods and variables. Furthermore, some SVG (or HTML) elements have IDs, which are used to access and manipulate their attributes such as values, colors, visible or hidden states, and location and sizes. Many of the methods and variables are global in scope. Hence, any variable may be accessed from anywhere in the web document or application. 
     If two subcomponents contain the same variable or method names in their presentation code, the presentation code has name conflicts, which may cause a variety of performance problems. To avoid name conflicts, each CCG may use a common utility object for generating a unique seed ID and affixes it to the names of methods and variables in the component code generated by the CCG. Therefore, all global variables and service methods in the presentation code have unique names. 
     Since the variables or objects in the SVG document are global, all the presentation code can have access to the variables and use the services of the objects. The following shows a technique to track onload Init-Handlers for the presentation code of plural subcomponents. 
     Web browsers or SVG viewers support the ‘onload’ event trigger, which calls a method, when it finishes loading the document, as follows: 
     &lt;svg xmlns=“http://www.w3.org/svg” onload=“onload_init_method(evt)”&gt; 
     Unfortunately, only one method may be called for an SVG document. When the presentation code of several subcomponents is dynamically created in run time, the presentation code of each of the plural subcomponents needs to be notified on the ‘onload’ event so that it is initialized. To overcome the limitation, a globally reserved name onload_init_list is used. 
     var onload_init_list=new Array( ) 
     For any component that is to be notified on the ‘onload’ event, a notification function is to be added to the array by using the following statement. 
     onload_init_list [onload_init_list.length]=AC1_UNQ_ID.init_pb_onload; 
     The statement can be placed in any location of the SVG document. Each component in the SVG document, which needs to be notified on the onload event, may have this statement in its presentation code. This array grows whenever a new function is added as this statement is encountered while the SVG document is being loaded. When the loading of document is finished, the global method onload_init_method(evt) is executed. It executes all the notification methods by looping through the list: 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 function  onload_init_method (evt) { 
               
               
                   
                 20. 
                 for (var i = 0;  i &lt; onload_init_list.length;  i++) 
               
               
                   
                 30. 
                 (onload_init_list[i])(evt); 
               
               
                   
                 40. 
                 } 
               
               
                   
                   
               
            
           
         
       
     
     I. Integration Logic in Components Code Generators 
     A container CCG may contain special code, which is referred to as server code of integration logic, for generating several lines of application code. The application code is used on a client to establish communication between the container and any subcomponent or between any two subcomponents ( FIG. 10   b  and  FIG. 11 ). 
     The CGMs of the CCG subcomponents in a container CCG generate the presentation code of the subcomponents. The code of integration logic implemented in the container CCG is responsible for generating communication code necessary for inter-component communication and includes the communication code in the code of the component. 
     1. The Purpose of the Communication Code Generated by Integration Logic 
     In a model where a container CCG uses CCGs for subcomponents A and B to build component C, the container component C has its own method CM, subcomponent A has a method AM, and subcomponent B has a method BM, the server code of integration logic is designed during development so that it is able to generate the communication code to support the following basic model actions (“model actions”) in run time on the client: 
     (a) User&#39;s action (e.g., a mouse click) on the container component C leads to the running of the method AM of a subcomponent A; 
     (b) User&#39;s action on the subcomponent A leads to the running of the method CM of the container component C; 
     (c) User&#39;s action on the subcomponent A leads to the running of the method BM of the subcomponent B; 
     (d) Data exchange between the container component C and the subcomponent A for example through global shared variable; and 
     (e) Data exchange between the subcomponent A and the subcomponent B for example by calling the function BM and passing data through the parameters of BM, and getting response data from the object returned by the BM. 
     A user&#39;s action on a component for those relevant model actions means anything, which directly or indirectly affects the component. It includes user&#39;s clicking on a hotspot associated with a listener function, state change in the component, a timer event, and data arrival, which affects the component. 
     The code of integration logic is not required to generate all code necessary for performing all those listed basic actions. However, whenever integration logic is implemented to generate communication code to support a given model action, it needs to produce all code necessary to support the action. If it is necessary to pass application data in performing a given action, the code of integration logic is required to produce the portion of communication code, which allows the application data to pass from one component to another. 
       FIG. 11  shows sample code structure of server code of a container CCG  1100  and code structure of application code of the container component  1105  generated by the container CCG  1100 . The server code comprises code to instantiate and initialize CCG1 object  1101 , and also calls CCG1&#39;s CGM to generate the application code  1106  for a subcomponent PC1. The server code comprises code to instantiate and initialize CCG2 object  1103 , which generates the application code  1108  for a subcomponent PC2. The server code comprises code  1103  to generate application code for Callback_func function  1107  in the application code of the container component  1105 . 
     The server code section  1102  comprises a call to a coupling service method of CCG1 (i.e., CCG1.GetServiceMethodName( )) for getting the name of a service function implemented in the application code of PC1. The server code section  1103  comprises a call to a coupling service method (i.e., CCG2.SetEventCallback (“Callback_func”)) requesting CCG2 to set a callback in the application code of PC2. Calling the coupling service method for setting a callback causes the CCG2 to include necessary communication code in the application code of PC2, in order for PC2 to call the callback function  1107  upon a specific event. The callback (i.e., “Callback_func”)  1107  calls the service function implemented in the component code of PC1. 
     2. The Functions of the Code of Integration Logic 
     The code of integration logic means the code to be run on the server for generating communication code that is required to support any or all of the model actions on the client computer (e.g.,  FIGS. 14   a ,  14   b  and  FIG. 11 ). When the code of integration logic is executed on a server, it performs the functions of (1) getting the name of the service method implemented in the component code (run on the client) generated by the CCG object (run at server) of the first subcomponent, (2) picking or getting a unique callback name (i.e., to avoid possible name conflicts) for a callback function and generating necessary declaration statement of the callback function (3) using the name of the service method of the first subcomponent for generating the body for the callback function in a language proper on the rendering platform and properly passing the parameter to invoke the service method (3) setting the callback name to the CCG object (run at server) of a second subcomponent to be called on a specific event on the subcomponent, (4) setting the callback causes the second CCG to generate code statements in the application code of second subcomponent to register the callback function in the component code, and (5) creating necessary variables and/or XML strings (e.g., for passing as parameters to the callback or to get response) used by the container and subcomponents to exchange data. Upon the specific event on the second subcomponent (runs on the client) results in calling the callback function (runs on the client) which in turn calls the service method of the first subcomponent (runs on the client). Therefore occurrence of respective event on the second subcomponent will cause the first subcomponent to run the service method through the callback function. (e.g., on the right side of  FIG. 11 ). Obviously, the code of integration logic is designed to create plural communication paths or collaboration modes by using multiple callback functions associated with multiple event handlers. 
     Communication code generated by code of integration logic to facilitate collaboration or communication between components normally contains (1) necessary declaration statements of one or more callback functions, (2) the bodies of the callback functions for calling service methods of certain components, (3) necessary code for registration of the callback functions with certain other components for invoking the callback functions by the code in the components upon the occurrence of appropriate events, and (4) new variables such as common variables, XML strings, or hidden variables used by the container component or subcomponents in exchanging data which is necessary to support the basic actions. 
     Communication code may include any and all of those code elements necessary to support any one of the basic model actions. However, it is not required that communication code contains all the above four types of code statements. For example, the need for using new variables and parameters depends on the nature of the subcomponent, the details implementation of the container CCG, and the model actions used in the container CCG. 
     3. Accessing the Coupling Service Methods of CCG for Creating Inter-Component Communication 
     (a) Getting the Service Methods of Subcomponents by Using the Coupling Service Methods of CCGs. 
     Each CCG class for building subcomponents can implement several coupling service methods for getting the names of service methods implemented in the code of the subcomponent of a CCG object. The container CCG calls appropriate coupling service method of CCG object to get the name of a specific service method of the subcomponent. Methods used in the preferred embodiments of the present invention for getting the name of a service method include: (a) calling appropriate coupling service method of the CCG object for getting the name of a target service method that is implemented in the code of the subcomponent, (b) alternative coupling service methods are implemented for indirectly getting the service method implemented in a subcomponent from its CCG object. For example, a coupling service method can take a name of a JavaScript variable as a parameter and initialize the variable with the reference to the service method, as illustrated below: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 &lt;script&gt; 
               
               
                 20. 
                 var sm_ref_pointer_UID = func {}; 
               
               
                 30. 
                 function Callback_UID (param, data) { 
               
               
                 40. 
                     sm_ref_pointer_UID (data); 
               
               
                 50. 
                 } &lt;/script&gt; 
               
               
                 60. 
                 &lt;% CCGx.getServiceMethodRef(“sm_ref_pointer_UID”); 
               
               
                 70. 
                 CCGx.CGM (Out, UsrData); %&gt; 
               
               
                   
               
            
           
         
       
     
     Line 20 defines an empty function pointer variable. Lines 30 to 40 implements a callback function, which calls the empty function (declared in line 20). Line 60 calls a coupling service method of CCGx by passing the name of empty function pointer. Line 70 calls CGM of CCGx, which generates an additional line of code in the application code of the subcomponent that initializes the function pointer to a specific service method (e.g., sm_ref_pointer_UID=AC_UID.service_method). 
     Alternatively, the container CCG may get the names of service methods of a subcomponent indirectly. The CCG object may provide (or return) an XML string which contains the names of service methods, a name of a variable in the container component code where the reference to a service method is stored, an object which is able to return the names of service methods, or an address of an object which is able to return the names of the service methods of the subcomponent. The container CCG gets directly or indirectly the names of the service methods used in the presentation code of the subcomponent. If the container CCG is developed in other OOP language, the implementation for getting the names of service methods must be proper in the language. 
     This kind of methods is referred to as “coupling service methods of CCG for getting service methods (of its component)” because the ultimate goal of these coupling service methods are directly or indirectly getting the service methods implemented in the code of components of the CCG Objects. 
     (b). Importing Abstract Class Type CCGs by Container CCG for Including and Coupling Subcomponents 
     If a container CCG needs to integrate two subcomponents created by imported two CCG objects, each of the CCG objects should belong to appropriate class that comprises certain properties or has certain behavior (e.g., class interfaces for getting or setting integration data). For example, an abstract class may define these necessary properties such as define coupling service methods as abstract methods to be implemented by the derived CCG classes. Using the interfaces of the abstract class the code of the integration logic in the container CCG can properly call the coupling service methods of the CCG objects for the subcomponents to get necessary integration data. Since each coupling service method for returning the name of a service method is defined in the abstract class, all the derived class objects of the subcomponents must have an implementation of the method for returning the name of appropriate service method. 
     (c). Setting the Names of Callback Functions by Using the Coupling Service Methods of CCG 
     Each CCG class for building subcomponents can implement several coupling service methods for setting names of callback methods to be called upon specific events in the subcomponent of a CCG object (that is an instance of the CCG class). The container CCG calls appropriate coupling service method of CCG object for inputting the name of a callback. This inputting of each callback function name causes the CCG of the subcomponent to generate part of the communication code for invoking callback function upon respective events in the subcomponent. The callback function is implemented in the code of container component generated by container CCG or in the subcomponent generated by another CCG. 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 &lt;script&gt; 
               
               
                   
                 20. 
                 function Clallback_UID (param, data) { 
               
               
                   
                 30. 
                  other_AC_service_method (data); 
               
               
                   
                 40. 
                 } &lt;/script&gt; 
               
               
                   
                 50. 
                 &lt;% CCGx. setCallBackName(“Callback_UID”); 
               
               
                   
                 60. 
                 CCGx.CGM(Out, UsrData); %&gt; 
               
               
                   
                   
               
            
           
         
       
     
     Lines 20 to 40 generate code for the callback function “Clallback_UID”. Line 50 inputs the callback name using appropriate coupling service method of CCGx before the calling of the CGM of the CCGx in line 60. The call to the coupling service method at 50 causes the CGM to include necessary communication code, which allows the subcomponent to invoke the callback upon the occurrence of an appropriate event on the client. 
     Alternatively, one of the coupling service methods of the CCG object of a subcomponent is designed to choose the name for a callback function and returns the callback name to the container CCG. The container CCG&#39;s integration logic code uses the callback name in generating the implementation code of the callback function in the container component&#39;s code. Below is the sample code of integration logic of the container CCG: 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 &lt;script&gt; 
               
               
                   
                 20. 
                 function &lt;% Out.print (CCGx.getCallBackName ( ) ); 
               
               
                   
                   
                 %&gt; (param, data) { 
               
               
                   
                 30. 
                 other_AC_service_method (data); 
               
               
                   
                 40. 
                 } &lt;/script&gt; 
               
               
                   
                 50. 
                 &lt;% CCGx.CGM(Out, UsrData); %&gt; 
               
               
                   
                   
               
            
           
         
       
     
     The code in lines 10 to 40 generates the application code of a callback function. Line 20 calls coupling service method of CCGx object for getting the name of the callback. This call causes the CCGx not only to pick a unique name (i.e., to avoid possible name conflict) for the callback but also register the callback for the subcomponent of CCGx. 
     Alternatively, the code of integration logic of a container CCG can get the service method of a subcomponent of CCG by calling an appropriate coupling service method of a CCG object. Then, the container CCG can use the service method name to generate the code for registering a callback in the code of the container component, as shown below: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 &lt;script&gt; 
               
               
                 20. 
                 function Callcabk_UID (param, data) { 
               
               
                 30. 
                  other_AC_service_method (data); 
               
               
                 40. 
                 } &lt;/script&gt; 
               
               
                 50. 
                 &lt;% CCGx.CGM(Out, UsrData); 
               
               
                 60. 
                 var AC_serv_UID = CCGx.getServFuncToRegisterCallback( ); 
               
               
                 70. 
                 out.printIn (“&lt;script&gt;”+ AC_serv_UID + “(Callback_UID);  
               
               
                   
                 &lt;/script&gt;” %&gt; 
               
               
                   
               
            
           
         
       
     
     Lines 10 to 40 generate the code of a callback function. Line 50 calls the CGM of CCGx to include the code in the subcomponent. Line 60 gets the name of the appropriate service method of the subcomponent for registering the callback. Line 70 generates a line of communication code, which calls the service method of the subcomponent for registering the callback. Although the subcomponent of the CCGx triggers the callback, the CCGx does not generate part of the communication code, which registers the callback. In this method, the integration logic of the container CCG generates necessary communication code for registering the callback. 
     The CCG object may get the name directly or indirectly. The integration logic may provide an XML string, which contains necessary information such as the name of callback and/or event trigger, an object, which is able to return the names. 
     (d). Use of Registration Class 
     The SVG document may have global variables and objects. It is possible to define a service registration class (e.g., ‘service_register_class’) and instantiate a shared global object with a reserved name such as ‘service_register_obj’. Now, any component&#39;s code can access this global object using this reserved name (one version of service registration class is disclosed in Appendix C). Service methods or objects of multiple components or subcomponents are registered according to the general steps shown in  FIGS. 8   a ,  8   b.    
       FIG. 8   a  shows the code structure of a web application where plural components  801 - 803  and  805 - 807  are coupled through a global service registration object  804 . Each of the service-providing components  801 ,  802  and  803  comprises the code for registering each of its services by entering the name of the service and a reference to the service method (e.g., name-and-method pair) into an array in the registration object  804 . Each of the service-consuming components  805 ,  806 , and  807  comprises the code for looking up each of the registered services from the service registration object  804  and the code for invoking the service. After a service of a service providing component is registered with the service registration object  804 , any service-consuming component can use the service by calling the registration object using the service name. 
       FIG. 8   b  is a block diagram for the publishing-and-subscribing method to couple any two components in an application. The service-providing component  822  registers or publishes a service name and a reference to the service object or the function with the service registration object or a directory component  821 . The service-consuming component  823  queries the directory component  821  for the service using the service name. The directory component  821  returns a reference to the service object. The service-consuming  823  uses the reference to the service object to request the service of service-providing component  822 , which processes the service request and sends a response. In this case, the service request may carry data in an XML string and the response may also include data in an XML string. 
     The ‘service_register_class’ is implemented so that it supports methods to register services with a service-name ID. In this case, services are accessed by methods using the service-name ID. Using this technique, any component can register its service with a unique name ID. If any other component needs that service, the component can look up the service using the name ID. 
     This name of the service registration object can be agreed upon at the beginning of the designing of the application and reserved so that the component code of plural subcomponents are implemented to register their services. At the beginning of the SVG document, the service registration object is instantiated. 
     var services_register_obj=new service_register_class( ) 
     The CCG object can generate component code to register the component&#39;s service with the ‘service_register_object’ with a service name ID. 
     The following statement is used to add a service: 
     services_register_obj.add_service(“ShoppingCart”, shopping_cart_service); 
     “ShoppingCart is a name ID and shopping_cart_service is a reference to a shopping cart service function. Any CCG object that creates the presentation code of the component that uses this service knows the service-name ID, and can invoke the service by using the following statement: 
     services_register_obj.get_service(“ShoppingCart”, xml_data, callback_name); 
     By looking through the directory (e.g., for name ID “ShoppingCart”), the registration object finds the reference to the service: shopping_cart_service and calls the function by passing the xml_data and callback_name as parameters to the function 
     The service-providing component uses data in the xml_data to process the request (i.e., add the item to the cart). The shopping cart component saves the reference to the function “callback_name” and notifies the service requester (i.e., the subcomponent for shopping item) by calling the function if the shopping item is deleted from shopping cart later. 
     Developers of both service-providing components and service-consuming components may agree on the names of the services (e.g., “ShoppingCart”) in advance. 
     To accomplish more complex and multi-faceted inter-component communication, the presentation code, which provides services, can register an object containing plural methods and variables. In response to a request, the lookup service returns an object, which contains service methods (or callback functions) and variables. The requesting component then gets the service methods or callback functions, the values in the variables, and invokes appropriate actions of the services of the servicing component. 
     In the code of integration logic, the container CCG may use the service method names along with XML string variable names (based on predefined XML schema) as parameters to the callback functions. The XML-data strings might be saved in the application code of subcomponents and used by JavaScript functions, which supports the communication between the presentation code of the subcomponents and the presentation code of the container component. 
     There are many more methods, which are used to get the names of service methods of a subcomponent. For example, the CGM of a CCG of a subcomponent is designed so that it embeds necessary integration data such as the names of service methods of the subcomponent in the code of the subcomponent. The integration data are marked up by two reserved special tags (or in any way that can mark out the integration data). The container CCG contains the code for calling the CGM of the subcomponent and the code for storing the presentation code of the subcomponent in a string variable. The container CCG also contains a utility method for searching the presentation code for the reserved tags to locate and get the names of the service methods. After getting the names of the service methods from the presentation code, the container CCG then places the presentation code of the subcomponent in proper location of the container component code and starts writing communication code using the names (or integration data) extracted from the application code of the subcomponent. 
     (e) Communication with External Components. 
     After a container CCG generates functional presentation code of the container component. All service methods of its subcomponents and the container component may be accessed by external components or any other code on the web page. 
     4. Container CCGs and Integration Logic Examples 
     The container CCG disclosed in the preferred embodiment ( FIGS. 9   a ,  9   b ) is implemented in a Java class, which is extended from the base class AgileTemplate. The container CCG contains code of one or more methods of inputting/importing or instantiating/initializing the CCG objects of subcomponents, and code of integration logic. It optionally contains the code of business logic. 
     A container CCG containing code of business logic is also an ACCG even though it gets the presentation code of subcomponents by calling subcomponent CCG objects. Conversely, an ACCG, which contains code of integration logic, is also a container CCG whether the ACCG gets the subcomponent CCG objects by instantiation or importation. 
     Example 4 
     Pseudo Code of a Simple Container CCG 
     This example shows the pseudo code of a simple container CCG in JSP or Servlet using components as building blocks. The container CCG instantiates and initializes CCGs of two subcomponents C1 and C2, uses their CGMs to generate the presentation code to present PC1 and PC2, and places the presentation code at appropriate location in its component code. The CGM of the larger ACCG may include the following pseudo code: 
     10. Including container component code such as format and placement; 
     // Code for generating presentation code of PC1 
     20. Instantiating CCG object C1; 
     30. Using the container CCG object&#39;s input data to initialize the C1; 
     40. Generate_Presentation_Code PC1: Call C1.CGM(out); 
     50. Including container component code such as format and placement; 
     // Code for generating presentation code of PC2 
     60. Instantiating a CCG object C2; 
     70. Using the container object&#39;s input data to initialize the C2; 
     80. Including container component code including code for placement; 
     90. Generate_Presentation_Code PC2: Call C2.CGM(out); 
     100. Including container component code including code for placement; 
     // Code of integration logic for “integrating” subcomponents PC1 and PC2 
     110. String SM2=C2. getServiceMethodName( ); 
     120. out.println (“function CB_of_C1_to_control_C2 (EvtDat) {”); 
     130. out.println (SM2+“(“+EvtDat+”);”); 
     140. out.println (“}”); 
     // Code for PC1 service-method from C1 to register a Callback, 
     150. String Reg_SM1=C1. getCB_AddMethodName( ); 
     160. out.println (Reg_SM1+“(CB_of_C1_to_control_C2);”);; 
     170. Include the remaining container component code; 
     The pseudo code shows how the subcomponent PC1 may communicate with the subcomponent PC2. The CCG starts with the code for including container component code for format and placement. The CGM then instantiates and initializes a CCG object C1 in lines 20, 30. It then calls the CGM of the object C1 in line 40 (when this statement is run, it generates the presentation code of the PC1). Lines 60 to 100 are similar to the lines 40 to 50 except that they are for the CCG object C2 to generate the presentation code of the PC2. Code at  110 - 160  is the code of integration logic. It first gets the name of a service method for the PC2 in line 110. Code in lines 120-140 writes a callback function that allows the PC1 to call the service method of the PC2. Line 120 writes the name of the callback function together with a start bracket. Line 130 writes a main statement (which is also a calling statement) for calling the service method of the PC2 where the service method name SM2 will be replaced by the actual name. Additional parameters such as integration data and event are included in the main statement. Since the callback name is created by the code of integration logic in run time, it cannot be in the presentation code of the PC1. In order to allow the PC1 to call the callback function to run the service method of the PC2, the PC1 must have a code statement for invoking the callback, which is often associated with an event action or state change. To implement this function, the callback function must be registered with the invoking component, PC1. Code in line 150-160 writes a statement for registering the callback with the PC1. It first gets the service function name from the object C1 in line 150 and writes the name with necessary parameters such as callback name in paired brackets in line 160. The CGM ends after generating remaining container component code in line 170. 
     Thus, the application code allows the PC1 to call or communicate with the PC2. The callback is triggered by an event (e.g., a user action such as mouse click) on the PC1 or a change in the state in the PC1. 
     Example 5 
     Pseudo Code for Simple Integration Logic 
     Another version of the code of integration logic, which integrates subcomponents PC1 and PC2, is shown in the following pseudo code. It is assumed that in this example that the PC1 initiates communication based on an event such as a user&#39;s action or state change and calls the service method of the PC2. 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 String Second_comp_service_method = 
               
               
                   
                 C2.getServiceMethodName( ); 
               
               
                 20. 
                 Out.printIn(“ function first_comp_callback_UNQ_ID( par1, 
               
            
           
           
               
            
               
                 par2) {”); 
               
            
           
           
               
               
            
               
                 30.  
                 Out.printIn(“ ” + Second_comp_service_method + 
               
               
                   
                 “(par2);” ); 
               
               
                 40. 
                 Out.printIn(“} ”); 
               
               
                 50. 
                 String First_comp_service_method = C1. 
               
            
           
           
               
            
               
                 getCB_AddMethodName( ); 
               
            
           
           
               
               
            
               
                 60. 
                 Out.printIn(“ ”+First_comp_service_method+ 
               
               
                   
                 “(first_comp_callback_UNQ_ID);” ); 
               
               
                   
               
            
           
         
       
     
     The statement 10 in the Integration logic gets the name of service method of the PC2 and saves the name in variable “Second_comp_service_method”. The statement 20 picks up a unique name by attaching a unique ID to first_comp_callback (e.g., first_comp_callback_UNQ_ID) for a callback function to ensure that the callback name is unique. Statements 20-40 print the body of the callback function. Finally, the code of integration logic in line 50 gets a service method of the PC1 for registering the callback by calling the CCG&#39;s component service method, C1.getCB_AddMethodName( ). This method returns the service function implemented in the application code of the PC1. In line 60, the integration logic generates the application code for registering the callback. OK 
     Example 6 
     Pseudo Code of Integration Logic 
     Another version of the code of integration logic, which should be placed before the code to call the CGMs of the C1 and the C2 in the CGM of the container CCG, is shown as follows: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 String First_comp_callback_name = C1. 
               
            
           
           
               
            
               
                 getCallbackMethodName( ); 
               
            
           
           
               
               
            
               
                 20. 
                 Out.printIn(“var service_method_UNQ_ID = function( ) { };”); 
               
               
                 30 
                 C2. setServiceMethodReference (“service_method_UNQ_ID”); 
               
               
                 40. 
                 Out.printIn(“function ” + First_comp_callback_name + 
               
               
                   
                 “( par1, par2) { ”); 
               
               
                 50. 
                 Out.printIn(“ service_method_UNQ_ID(par2);” ); 
               
               
                 60. 
                 Out.printIn(“} ”); 
               
               
                   
               
            
           
         
       
     
     By running the statement 10, the code of integration logic in the container CCG calls a coupling service method of the C1, which picks up a callback name, and stores the name in the variable “First_comp_callback_name”. The code of integration logic picks up a unique name (service_method_UNQ_ID) for the variable to store a reference to the service function of the PC2, and generates a code statement for instantiating the variable that points to a null function in line 20. Then, the statement in line 30 uses the service method setServiceMethodReference to cause a C2 object to assign a target service method of the PC2 to the function pointer variable. Line 40-60 writes a callback function body using the callback name stored in First_comp_callback_name. As discussed in the CCG class for “RotateBanner.java” for its method setServiceMethodReference, the statement in line 50 writes a statement for calling “service_mathod_UNQ_ID” which contains the reference to the target service method of the PC2. Since the function pointer variable, service_method_UNQ_ID, in the callback body of the PC1 is assigned with a reference to the PC2&#39;s target service method upon the generation of the PC2, a call to the PCPs callback can invoke the PC2&#39;s target service method. 
     In this case, the C1&#39;s method of getting the callback name must be called before the calling of the CGM so that the CGM can use the callback name in generating the callback function and place it in the presentation code of the PC1. Thus, a triggering event occurring in the PC1 can invoke the callback, which in turn runs the associated service on the client. 
     Similarly, the callback name returned by getCallbackMethodName( ) is used by the code of integration logic in the container CCG to write the communication code used for the interaction between the container code and the PC1. 
     Each CCG may contain the code of plural service methods, which are used to get information from the CCG objects or pass the information to other CCG objects by using the set method. To integrate one subcomponent with other subcomponents or the container component, the code of integration logic may use one or more available coupling service methods of the CCG objects of the subcomponent. 
     General steps for the code of integration logic to create communication code between any two subcomponents are: (i) calling a coupling service method of the CCG of a first subcomponent for getting directly or indirectly a certain service method implemented in the code of the first subcomponent (ii) picking up a unique name for a callback function directly or indirectly and generating the callback function to call the service method of the first subcomponent by passing proper parameters, and (iii) calling a coupling service method of the CCG of a second subcomponent for properly registering directly or indirectly the callback function with the second subcomponent where the callback function is invoked upon occurrence of certain event on the second subcomponent on a client. 
     Example 7 
     RotateBanner.java and ShowLayer.java 
     RotateBanner.Java (Appendix E) is a CCG class for the RotateBanner component. The application code generated by RotateBanner.java and ShowLayer.Java have been disclosed in Appendices A and B respectively. The class defines the variables for storing input subcomponents, preference data, and configuration information. The CCG has constructors, set methods for initializing the variables, and the CGM for generating the presentation code. It uses the data, objects and subcomponents in the class variables to generate its presentation code. 
     Appendix A shows simple tested SVG component code, when loaded into an SVG viewer, it presents a RotateBanner component. The CGM for RotateBanner.java class first prints the “class definition” section of the container component using private function generate_class_def(out, doc_info). The “class definition” section may not be included in the code, if the class definition is already included in the web document by another earlier object instance of this class. The count of the input subcomponents and the list of the CCG objects for the subcomponents are stored in the class variables. Then, the CGM uses the information on the countOK and list of objects to generate for code to instantiate and initialize a JavaScript object for RotateBanner class (Section Three in the SVG document in Appendix A). Then, the CGM generates code to present the component, and each of its subcomponents (Section Four in the SVG document). By running the CGM of each of the input CCGs for the subcomponents, the CCG generates the code for each subcomponent. 
     The CCG code appends UNQ_ID to all names of global variables and functions to make the names unique and exclusive in the SVG document. 
     The CCG class supports coupling service methods (1) methods for getting names of service method of the component generated by the CCG object, and (2) methods for setting information about external components (or code) such as callbacks to be invoked by the generated component. This Java class supports coupling service method getBannerUpdateMethodName( ), which returns the name of the service method of the presentation code. Since the names of presentation code&#39;s objects and service methods are already defined in the class definition and Java class object instantiation, the CCG only need to append the UNQ_ID to the JavaScript object name and returns the name (e.g., the name with appended UNQ_ID), which is used to generate code for accessing the service of the component. Since all the objects are global in the SVG document, the service method of this JavaScript object can be called from anywhere in the SVG document. 
     The CCG class supports the coupling service method setServiceMethodReference(pointer_var_name), which saves the variable name passed in the parameter in the class variable “Service_func”. This pointer variable for getting a reference to component&#39;s service function must be defined in the code for the container component. If the Java string Service_func is not null, the CGM generates additional lines of code in the component&#39;s code to store the reference in this variable. 
     The CCG may use alternative methods to accomplish the same task such as registration of a callback for a component. The code of integration logic in a container CCG may use getCB_AddMethodName( ) of the CCG to get the name of the service method of the subcomponent of the CCG. It then generates application code where the name is used in setting the callback for the subcomponent. For example, 
     
       
         
           
               
               
               
             
               
                   
                   
               
             
            
               
                   
                 10. 
                 String SM = CCG1. getCB_AddMethodName( ); 
               
               
                   
                 20. 
                  Out.printIn (SM + “(Callback_func);” ); 
               
               
                   
                   
               
            
           
         
       
     
     Alternatively, the container CCG may use the Java object method setCallBackName(String cb_name) (e.g., CCG1. setCallBackName(“Callback_func”)), 
     Either of the methods may be used to set a callback for the component of the CCG1. However, the name of the callback must be set to CCG1 before the calling of CCG1.CGM to generate part of the communication code for registering a callback. This allows the CGM of CCG1 to generate subcomponent code to call the callback. On the other hand, the service method of a subcomponent for registering a callback is called only after the calling of the CCG1.CGM, which generates the subcomponent code comprises of the service method. Because usually a function can be called only after the function is defined. 
     Like RotateBanner, the CCG class for the ShowLayer component (Appendix G) also contains class variables and set-methods for initializing the variables. It also implements the CGM. This Java class also supports a coupling service method getShowLayerName( ), which returns the name of the service method of the presentation code of the component. Since the names of the object and service methods are already known, it only need to append the UNQ_ID to the object name and returns the name (e.g., the name together with appended UNQ_ID), which can be used to access the service of the presentation code. It also supports methods getSwitchStateName( ) and getCB_AddMethodName( ), which also return the names of the service methods of the component presentation code. 
     The CCG may use alternative methods such as registration of a callback for a component to accomplish the same task: (1) The container CCG may use getCB_AddMethodName( ) to get the name of the service method of the component and use this name to generate application code to register a callback. This method must be executed after calling the CGM of the CCG. 
     Alternatively, (2a) the Java class also supports a method setCallBackName(String cb_name), which, upon being called, can initialize the java variable “callback” with the string value given in “cb_name”, or (2b) the container CCG may use Java object method getCallBackName( ), which picks a unique name for callback, assigns the name to class variable ‘callback’, and returns the name of the callback function. Both functions save callback function name in java class variable “callback”. Both 2a and 2b initialize CCG Object&#39;s java variable “callback”, where the later method also picks a unique name and returns the name for the container CCG to generate code for the callback function. This second method must be executed before calling CGM of CCG so that the java variable “callback” is initialized. If the java variable is not initialized the CGM do not generate application code to invoke the callback. 
     A valid value in the ‘callback’ variable causes the CGM to generate additional JavaScript communication code using the name saved in the variable “callback”. 
     Likewise, the CCG may implement alternative methods for the code of integration logic to directly or indirectly obtain service method of the subcomponent created by the CCG. An alternative implementation is disclosed in Appendix F. 
     5. Basic Characteristics of Container CCGs 
     The container CCG may also contain the code of application logic for accessing data sources to get application data and process the application data. The container CCG may use the application data to build the container component or to initialize/configure the CCGs for the subcomponents. A CGI program (e.g., JSP files or Servlets) that generates web page is also a special type of container CCG if the program uses one or more CCG objects to generate their components and integrates the components. 
     A Container CCG could get the CCGs of the subcomponents in two different ways: 
     (a) Container CCG Integrating the Subcomponents, the CCG Objects of which are Instantiated Locally 
     In this case, the container CCG uses appropriate CCG class to instantiate each CCG object to build each subcomponent. That is, the CCG object should build right type of subcomponent for the container component in the business point of view. The container CCG obtains necessary application data in the following ways: (i) The class for the container CCG may have methods for inputting necessary application data, and (ii) The container CCG may also contain application logic to access application data from data sources (e.g., database) and to process the data. The container CCG uses the application data to initialize the CCG Object, before calling the CGM of the CCG object to build a subcomponent. 
     Example 8 
     Pie Chart 
     The presentation code of a full pie chart component is shown in the  FIG. 3   a  and some pseudo code will follow. 
     The presentation code of full pie chart comprises the presentation code of the subcomponents such as legend, info-table, and bare pie chart (that only displays all the pie slices). It also contains communication code and other miscellaneous code to define the location of the subcomponents and to display title. When the mouse moves over any of the legend items, the presentation code calls the pie chart subcomponent to highlight the slice corresponding to the item. Whenever the subcomponent of pie chart highlights a slice, it calls the service method of info-table, and passes relevant information such as percentage in the method&#39;s parameters in order to display the information. This interactive functionality, which is a reflection of underlying inter-component communication, is rendered by the communication code. A version of the pseudo code of the container CCG that create the pie chart is as follows: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 &lt;g transform=“translate(X-Loc Y-Loc)”&gt; 
               
               
                 20. 
                 &lt;script&gt; &lt;![CDATA[ 
               
               
                 30. 
                  --- JavaScript for the container component can be included here. 
               
               
                 40. 
                 ]]&gt; &lt;/script&gt; 
               
               
                 50. 
                 &lt;g transform=‘translate(5 35)’&gt; 
               
               
                 60. 
                 &lt;% LegendGUI LC = new LegendGUI (legend_array, n); 
               
               
                 70. 
                  - - - Include code to initialize &amp; configure Object - LC ... 
               
               
                 80. 
                  - - Call CGM to include component: LC.CGM (out, ses_obj);%&gt; 
               
               
                 90. 
                 &lt;/g&gt; 
               
               
                 100. 
                 &lt;g transform=‘translate(90 30)’&gt; 
               
               
                 110. 
                  &lt;% BarePieChart BPC = new BarePieChart (data_array, n); 
               
               
                 120. 
                  - - - Include code to initialize &amp; configure BPC-Object ... 
               
               
                 130. 
                  - - Call CGM to include component: BPC.CGM ( out, ses_obj);  
               
               
                   
                  %&gt; 
               
               
                 140. 
                 &lt;/g&gt; 
               
               
                 150. 
                 &lt;g transform=‘translate(25 320)’&gt; 
               
               
                 160. 
                  &lt;% TooltipTable TT = new TooltipTable( ); 
               
               
                 170. 
                  - - - Include code to initialize &amp; configure TT-Object ... 
               
               
                 180. 
                  - - Call CGM to include component: TT.CGM (out, ses_obj); %&gt; 
               
               
                 190. 
                 &lt;/g&gt; 
               
               
                 200. 
                 &lt;g transform=‘translate(5 5)’&gt; 
               
               
                 210. 
                  &lt; % 
               
               
                 220. 
                  - - - If Title is a String then, do the following: 
               
               
                 230. 
                  out.printIn (“&lt;text style=‘fill:red;font-size:16pt’&gt;” + Title +  
               
               
                   
                  “&lt;/text&gt;”); 
               
               
                 240. 
                  - - - Else, If a CCG Object then call: Title.CGM(out, ses_obj); %&gt; 
               
               
                 250. 
                 &lt;/g&gt; 
               
               
                 260. 
                 &lt;script&gt; &lt;![CDATA[ 
               
               
                 270. 
                  - - - Include necessary JavaScript methods here. 
               
               
                 280. 
                  &lt;% - - - Write Code for integration logic 
               
               
                 290. 
                  - - - Integration Logic calls coupling service methods of 
               
               
                 300. 
                  - CCGs LC, BPC and TT to write communication code %&gt; 
               
               
                 310. 
                 ]]&gt; &lt;/script&gt; 
               
               
                 320. 
                 &lt;/g&gt; 
               
               
                   
               
            
           
         
       
     
     Code between lines 60 and 80 instantiates and initializes a Legend GUI CCG object and calls its CGM to include a legend component. This code is included between statements at lines 50 and 90, which define the encapsulating canvas for the Legend component. The attribute transform=‘translate(5 35)’ defines the location of the Legend component with respect of the container group or canvas that starts at line 10 and ends at line 320. The attribute “transform=‘translate(X-Loc Y-Loc)’” at line 10 determines the location of the container component with in another larger container canvas. 
     The code between lines 110 and 130 instantiates and initializes a CCG object for a bare pie chart and calls the CCG&#39;s CGM to include all the slices of the bare pie chart component. This component is enclosed in a separate canvas by the statements at 100 and 140. Likewise code between lines 150 and 190 assembles a ToolTip component. The code between lines 270 and 300 is code of integration login, which generates necessary inter-component communication code for the components Legend, Tool Tip and Bare Pie Chart. Necessary JavaScript code can be included by enclosing the JavaScript code between statements &lt;script&gt; and &lt;/script&gt; as shown at lines 10 and 30. 
     Each of the subcomponents is defined by tags &lt;g&gt; and &lt;/g&gt;, forming a chuck of code (also known as a group for each subcomponent). In the miscellaneous code, the location of each of the subcomponents is defined by the X and Y values in the group&#39;s attribute transform=“translate(X Y)” with respect to the top left corner of the container component. 
     The container CCG instantiates and initializes each of the subcomponent CCGs. The container CCG must implement input methods for inputting all the necessary application data that are used to initialize the CCG&#39;s for the subcomponents such as Legend and ToolTipTable. 
     In generating the presentation code of a subcomponent, the container CCG calls the CGM of the subcomponent CCG within the group code as follows (after each CCG for the subcomponent is properly instantiated and initialized): 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 out.printIn(“&lt;g transform=‘translate(X_LOC Y_LOC)’&gt;”); 
               
               
                 20. 
                 Sub_comp.CGM(out, doc_info); 
               
               
                 30. 
                 out.printIn(“&lt;/g&gt;”); 
               
               
                   
               
            
           
         
       
     
     Those three statements create a group of SVG code within tags &lt;g&gt; and &lt;/g&gt; with the presentation code body of the subcomponent being between the two tags. The displaying location on display screen is defined by the X_LOC and Y_LOC with respect to the enclosing component. 
     Upon a user action on any of the items of the legend, the JavaScript mouseover event callback function of the legend calls the service method of the subcomponent of the pie chart to highlight the slice. When mouse is moved over the slice, the slice is highlighted. The pie chart subcomponent contains a method, which is to register a callback function, which is called, when the service method to highlight slice is executed. The container CCG may use this method to register a callback function. Then the container CCG implements and generates this function body that calls the service method of the Info-table to display the information about the pie slice. 
     In the Legend and Info-table, the container CCG of chart uses non-selectable subcomponent, since a developer cannot select the subcomponent but can provide data by using the methods provided by the container CCG to customize the Legend and Info-table to effectuate their look and feel. 
     In using non-selectable CCGs to build subcomponents, the developer of the container CCG knows whether a subcomponent is proper component (as illustrated by the above example for full pie chart, which uses GUI CCGs for ToolTip and Legend). 
     (d) Container CCG is Integrated with Subcomponents by Importing their CCG Objects from External Sources. 
     This type of container CCG gets the CCG objects of subcomponents by any importing method provided in the programming language that is used to code the container CCG ( FIGS. 9   b ,  9   c ). If the container CCG is coded in Java, the CCG objects may be input by using set methods. Alternative methods such as using a wrapper CCG may be used for importing code for a subcomponent and incorporate the code in the container component. 
       FIG. 9   a  depicts an outer container CCG  900 , which comprises an inner container CCG  903  and two CCGs ( 901  and  902 ). The outer container CCG  900  generates application code for outer component  910 . The server code for the outer CCG  900  comprises code for instantiating and initializing the CCGs  901 ,  902  and  903 . The outer container CCG also comprises server code for inputing CCGs  901  and  902  using input or set methods of the inner container CCG  903 . The inner container CCG  903  saves the references to the CCGs  901  and  902  as the references  904  and  905 , respectively. The outer container CCG  900  comprises server code for calling the CGM of the inner container CCG  903  to generate the application code of the inner container component  911 , which is a subcomponent of the component  910 . The CGM of the inner container CCG  903  comprises their own server code for calling the CGM of each of the referenced CCGs  901  and  902 , respectively, to generate the application code of the subcomponents  914  and  915 . The CGM of the inner container CCG  903  also comprises integration logic code  906 , which interacts with the CCGs  901  and  902  to generate the application code  916 , which is necessary for inter-component communication or data exchange between the subcomponents  914 ,  915  and the container component  911 . 
       FIG. 9   b  depicts an outer container CCG  920 , which comprises an inner container CCG  923  and two CCGs ( 921  and  922 ). The outer container CCG  920  generates application code for the outer component  930 . The server code of the outer CCG  920  comprises the code for instantiating and initializing the CCGs  921 ,  922  and  923 . The outer container CCG  920  also comprises server code for inputting the CCGs  921  and  922  using input or set methods of the inner container CCG  923 , and stores the references to the CCGs  921  and  922  as the references  924  and  925 , respectively. The CGM of the outer container CCG  920  comprises server code for calling the CGM of each of the CCGs  921  and  922  to generate application code for each of the subcomponents  934  and  935 , respectively. The outer container CCG  920  comprises server code for calling the CGM of the inner container CCG  923  to generate application code of the inner container component  931 . The CGM of the container CCG  923  also comprises integration logic code  926 , which interacts with the references  924  and  925  to generate communication code  936 , which allows for collaboration between the subcomponents  934 ,  935  and the container component  931 . 
       FIG. 9   c  depicts an outer container CCG  940 , which comprises an inner container CCG  943  and two CCGs ( 941  and  942 ). The outer container CCG  940  generates application code for the outer container component  950 . The server code of the outer container CCG  940  comprises code for instantiating and initializing the CCGs  941 ,  942  and  943 . The CCG  940  also comprises server code for inputting the CCGs  941  and  942  using input or set methods of the inner container CCG  943  and server code for saving the CCGs  941 ,  942  as the local references  944  and  945 , respectively. The CGM of the outer container CCG  940  also comprises server code for calling the CGM of the CCG  941  to generate application code of the subcomponent  952 . The CCG  940  also comprises server code for calling the CGM of the inner container CCG  943  to generate application code of the inner container component  951 . The CCG  943  comprises server code for instantiating and initializing the CCG  947  and server code for calling each of the CGMs of the CCG  945  and  947  to generate the application code of the subcomponent  953  and  954  respectively. The CGM of the CCG  943  also comprises the integration logic code  946 , which interacts with the CCG objects  944 ,  945  and  947  to generate application code  956 , which allows for communication between the subcomponents  952 ,  953 ,  954  and the container component  951 . 
     By designing the code of integration logic, the container CCG can generate a variety of communication code to establish any of the basic types of the inter-component communications. In generating communication code, the code of integration logic in the container CCG required to call the coupling service methods of one or more CCG objects of subcomponents (i) to get necessary data for integration such as names of service methods and/or (ii) to input integration data such as names of callback functions. Hence, each input CCG must have certain interfaces and the subcomponent to be imported must have certain properties, in order for the code of integration logic in the container CCG to properly call each CCG&#39;s coupling service methods for getting/setting necessary integration data. 
     In the cases where the CCGs of subcomponents are instantiated within the container CCG, the container CCG class code picks up only the CCG objects for appropriate subcomponents from the business point of view. The container CCG can get the names of service methods and/or to choose the names of the callback functions in generating the communication code. 
     For example, the developer of the container CCG for component such as full pie chart (e.g.,  FIG. 3   a ) chooses proper pre-built GUI CCGs of the subcomponents such as Legend and Info-table. Where the developer of full pie chart can refer documentation for the interfaces of the reusable pre-built GUI CCGs to properly initialize the CCGs of the subcomponents and to get/set integration data. The developer must also refer to the interfaces (e.g., parameters and return object) of the service methods and callbacks of the subcomponents of the GUI CCGs for properly generating the inter-component communication code. 
     A CCG for a component is pre-built and stored in a library to be used for use as a container component of other CCG subcomponents. The container CCG can integrate the subcomponents by importing the CCG objects by using its set method. Naturally, a container CCG can use only certain CCG objects as proper building parts, and therefore it is necessary to restrict the CCG objects to certain classes derived from an abstract class that defines the necessary interface. This assures that each of the CCG objects has a necessary interface for the container CCG and is a right part for the container CCG from the business point of view. A shopping cart can only be integrated with shopping item subcomponents but not with a weather condition subcomponent. For example, shopping cart container CCG&#39;s set methods to input the CCGs of shopping items are designed to input only CCG Objects that are subclass of abstract class for shopping items. Other methods for assuring correct matches are as discussed later. 
     Example 9 
     DropDownSelectionList and Rotate-Banner 
     In one embodiment of the present invention, the container CCG (Appendix H,  FIGS. 14   a  and  14   b ) takes a list of strings for a dropdown-list subcomponent and an array of subcomponent CCGs. When this container component is displayed in an SVG viewer, each of the items on the dropdown list  1401  corresponds to a subcomponent, which may be a unique text or image for the item. It shows an image for its default item. When a user clicks on the dropdown list and selects a new item on the dropdown list, the Rotate-banner hides the current subcomponent and displays the newly selected subcomponent  1400 . The subcomponent  1400  is a container component, since it comprises of subcomponents  1401 ,  1402  and  1403 . 
     The container CCG class has Title variable to store a string for title of the container component, an array of string names[ ], an integer count for the number of the items in the dropdown list, and an array of AgileTemplate CCG sub_ACCG_list[ ]. It has a constructor, which can take four parameters: title, an array of strings, an integer, and an array of CCG objects. The container CCG class uses GUI CCG for DropDownList and GUI CCG for RotateBanner, which are defined as an extended class to the AgileTemplate. 
     In the container CCG&#39;s CGM, a CCG object of a dropdown list DDList and a CCG-object of RotateBanner RB1 are instantiated. The code of integration logic in the container CCG then gets the service method of RotateBanner and places the name of the service method in variable rb1_service_name and uses a unique name for the callback of the dropdown list. It then creates the body of the callback, which is part of the communication code in the application code using a series of out.println statements. It also registers this callback in the subcomponent of DDList using its CCG objects coupling service method. The container CGM calls the CGM of the RotateBanner once and the CGM of the DropDownList once. The components are presented in the locations of choice. 
     In Appendix I is a JSP file. This container CCG is used to generate stock information. It initializes four variables, which are used as the parameters for the container CCG&#39;s constructor. The string variable title is assigned with a title of the component. Five ticker names are placed in a name array. Then, five ACCG objects are instantiated for the five tickers, respectively. An array of the objects of component ACCGs is also instantiated. It finally instantiates the container CCG&#39;s constructor with the four parameters and calls the CGM of the container object. 
     This container CCG is used to display the weather conditions for five zip code areas after corresponding changes are made in title value, constructor used to instantiate the objects of the subcomponents. In this case, the parameter passed in the constructor of the subcomponents is the ACCG objects of weather, each of which takes a zip code rather than a ticker. Appendix I contains a JSP example. 
     Example 10 
     Stock Quote 
     One embodiment of the present invention is Stock Quote shown in  FIG. 14   b . This component displays a drop-down selection menu  1401  and stock quote chart  1400  for a selected item. When the user clicks on a company name on the selection menu  1401 , the component displays the stock chart  1400  for the company associated with the selected name. 
     The application code of this component comprises two components: Rotate-banner and dropdown Selection Menu. The presentation code of Rotate-banner supports a service method, which is called to hide the currently displayed stock chart, and display a new chart when the user clicks another tickle name on the Selection menu. Upon user selection of a new company name, the presentation code of Selection Menu calls a callback function to notify Rotate-banner of the new selection, and the Rotate-banner displays the chart corresponding to the newly selected company name. 
     This CCG is built using two CCGs: Rotate-banner CCG and Selection Menu CCG. The Rotating-banner CCG takes a list of subcomponents (e.g., plural stock charts) and generates the presentation code that displays one chart at a time. The Selection Menu CCG, which takes a list of strings, generates presentation code that displays the selection menu. 
     When the container CCG is run, it uses its coupling service method to get the name of the service method for rotating the stock charts from a Rotate-banner&#39;s object, chooses a callback name, and generates the body of the callback function. The body of the callback function contains a code statement for calling the service method for rotating the stock charts. In addition, the container CCG uses another coupling service method of the Selection Menu object and requests it to register the callback name as a callback function in the presentation code it generates for the selection menu. Thus, when a user selects a new item in the Selection Menu, the presentation code of the Selection Menu calls the callback function. The callback function is called from anywhere on the web page to access the service of the Rotate-banner component. 
     The container CCG contains code of application logic, which uses the account number to get a custom list of tickles or companies in the user&#39;s portfolio for display. This application logic code allows each of the potential users of web site to view only the stock charts of his or her choosing. 
     The Appendices N and O provide examples for class implementations of simple container CCGs. The Appendices R and S provide examples for non-class implementations of simple container CCGs. 
     6. Generating Communication Code Using Integration Data 
     The developer, who designs a container CCG that uses an imported CCG object as a subcomponent, needs to know whether the subcomponent is a proper building part, coupling service methods of imported CCG and the data exchange interface the subcomponent uses. 
     The data exchange interfaces such as parameters to the function and return object of the function of (i) the coupling service methods of CCGs and (ii) the service methods and callbacks of the subcomponents of CCGs is designed and documented in advance. Only things that are not known at the time of development of the container CCG are the exact names of the service methods of the subcomponents of CCGs. 
     The exact names of the service methods are determined at runtime by each CCG usually by appending a unique string to avoid possible name conflict with other names in the application code. Hence each CCG implements coupling service methods for getting service methods of the subcomponent and/or for setting callbacks in the subcomponent. In the point of view of the subcomponent, the input callback is a service method implemented outside, for example in the container component or a service method of another subcomponent to provide a service. 
     The developer, who designs and builds CCGs for container components, uses pre-defined coupling service methods of CCGs for getting/setting the integration data. If the CCGs of subcomponents are created outside and input to the container CCG, it is desirable to restrict the components of CCGs to proper type for the container component from business point of view. Also desirable to assure that the pre-defined coupling service methods that are used by the container CCG are implemented in the input CCGs. 
     Hence it is desirable to use methods to prevent inputting incompatible CCG or to catch error when an incompatible CCG inputted by mistake. Methods available for determining component compatibility include (i) implementing an abstract component class that defines particular data exchange interface such as coupling service methods as abstract methods and using the class as a base class for all subcomponent CCGs (ii) placing component class name and integration data in the presentation code of the subcomponent generated by CCG objects as long as the integration data is accessible by container CCGs. 
     (a) Use of Abstract Component Class in a Subcomponent 
     A proper integration requires both a right subcomponent and compatible data exchange interface between the container CCG and the CCG object of the subcomponent. A data exchange interface is built into an abstract class from which a CCG of the subcomponent is derived. 
     By way of example, the CCG class of ShoppingItems subcomponent is derived from abstract class ShoppingItemTemplate, where the CCG class supports, for instance, a coupling service method, which is used to set a callback function in the presentation code of the item subcomponent. The code of integration logic in the container CCG uses the abstract classes data exchange interface to call the coupling service methods of the CCG object for setting a callback. 
     While in this example, the abstract component class uses only one service method for establishing the data exchange interface in the resultant application between two subcomponents, the abstract class may support plural methods and plural data variables, depending upon the nature of the subcomponents and number of services the subcomponent provides/consumes. 
     By way of example, a vender for reusable ShoppingCart container CCG can also provide abstract class for the CCGs of shopping item subcomponents. Developers of the shopping cart application derive CCGs of the subcomponents from the abstract class. The developer of the CCG object may use any image/component to present the ShoppingItem and include any other information to be filled in the XML string. There is no restriction on the presentation or business logic of the shopping-item as long as the CCG object is of a subclass of ShoppingItem class. The ShopingItem class ensures that the container CCG can register callback functions and the subcomponent is integrated properly. 
     The abstract class in this case is intended only for suitable subcomponents that use the data exchange interface. The name of ShopItemTemplate should not be used by a second abstract class for the subcomponents that use different data interface. Therefore, the container CCG and the subcomponent CCGs of type abstract class are designed for each other. The ShoppingCart container CCG accepts only the objects of subcomponents CCGs that are derived from the same abstract class. Because the data exchange interface is implemented in the abstract class, the CCG class derived from the abstract class supports its data exchange interface. 
     Abstract class implemented in the CCG objects used by container CCG may be a subclass of the abstract class, AgileTemplate, which defines an abstract method CGM. Therefore, an abstract class may contain both the elements used in the AgileTemplate class and the elements of the abstract component class necessary for the code of integration logic in the container CCG. The combined abstract classes can support both CGM and necessary coupling service methods for the container CCG. 
       FIG. 15  shows the general steps of CGM of a container CCG when the CGM is called. The process is similar to the one for the black box assembling ( FIG. 7 ) except in two aspects: The CGM gets integration data from the object if the subcomponent belongs to an appropriate component class. If the object is unknown class or a string buffer, the CGM may put the presentation code into a string buffer and read the integration data from the presentation code. The other difference is that it generates communication code at the proper location. 
     Example 11 
     Pseudo Code for Abstract Class that Extends AgileTemplate 
     
         
         
           
             public abstract class ShopItemTemplate extends AgileTemplate {public abstract void addCallBackOnSelection (String cb_name); public abstract String getCB_AddMethodName( ); 
             } 
           
         
       
    
     The example shows a method for setting a callback function. The presentation code of the item calls the callback whose name is in the variable “cb_name” upon selection of an item. An alternative method in the third line is used to get service method name of the presentation code and use the name to register a callback for the subcomponents. 
     Example 12 
     Shopping Cart 
     The container CCG of ShoppingCart uses a list of the CCG objects of ShoppingItems and a CCG object of Invoice/Table subcomponent and generates the presentation code for displaying the ShoppingCart component ( FIG. 16 ). The container CCG of ShoppingCart contains constructors and methods for inputting an array of CCG objects of the subcomponents and for presenting the shopping items. 
     The container CCG of ShoppingCart is implemented to accept only the objects of the CCGs derived from given abstract classes. The CCG of ShoppingItem subcomponents and the CCG of Invoice/Table subcomponent need to be integrated. To accomplish this, the container CCG gets and/or sets integration data needed to each CCG for generating necessary communication code for each of the subcomponents. This is accomplished by using two abstract java classes: one abstract CCG class for Invoice/Table that exports a service method to add an item to the list of selected items to purchase; and another abstract CCG class for ShoppingItem that accepts a callback function name, which the subcomponent calls when the ShoppingItem is selected to buy. The user may double click on an item to add it to the ShoppingCart&#39;s Invoice. 
     Abstract class for CCG for Invoice/Table component contains a coupling service method, which is called to return the name of the service method of the subcomponent of the Invoice/Table. The service method of the Invoice/Table is called to add a selected item to the ShoppingCart, and pass the data such as price, quantity and discount about the item in the parameters of the service method. One of the parameters of the service method is a variable that has reference to an XML string, which contains the data. The service method of the CCG object of Invoice/Table component may add the XML string to an array, each of which contains an entry for one of the items that have been added to ShoppingCart, and update the invoice of the Invoice/Tale based on the items in the ShoppingCart. Whenever this service method is called to add a new item, the service method updates the XML string array and Invoice component to reflect the addition so that all items are in the invoice. 
     The abstract CCG class of the shopping item supports a method to input a name for the callback function for the ShoppingItem component. Optionally, this CCG may further support methods that set data values of the variables for price, options and discounts in creating the XML string array. This XML string is placed in the presentation code of each ShoppingItem. The component of ShoppingItem calls the callback when the shopping item is selected to buy and passes the XML String as a parameter to the callback. 
     Also, the abstract class may contain a data validation method to ensure the application data supplied by the CCG of a shopping item is correct and complete before the XML string is placed in the item&#39;s presentation code. This data validation method uses pre-defined XML schema to validate the XML string. A data validation method in the abstract class should cause the program of implementing the container CCG to exit or flag errors appropriately when the CCG of shopping items fails to supply all necessary data to build the XML string. 
     The two abstract classes, shopping-cart and shopping-items, assure that the container CCG gets all the necessary integration data for use in integration. The container CCG generates the communication code so that all the subcomponents properly can communicate with each other. The component of each shopping-item calls the callback when the item is selected to buy. The container CCG implements the body of the callback, which calls the service method of the Invoice-table to add the item to its list. 
     Example 13 
     Code of Integration Logic in Shopping Cart 
     Pseudo code is used to show integration logic used in the container CCG for the Shopping Cart in the above example. An ACCG for presenting the shopping-items is derived from its abstract class, thereby providing necessary interface for setting a callback. In the resulting application code, the callback is called with a respective XML string as a parameter upon user&#39;s selection of an item. 
     
       
         
           
               
               
               
             
               
                   
               
             
            
               
                   
                 10 
                 String Invoice_SM = InvoiceCCG.getAddShoppingItemMethod( ); 
               
               
                   
                 20 
                 out.printIn( “ function add_item_to_invoice( item_bar_code, 
               
            
           
           
               
            
               
                 xml_data ) { “ ); 
               
            
           
           
               
               
               
            
               
                   
                 30 
                 out.printIn( “ “ + Invoice_SM +“ ( item_barcode, xml_data ); “); 
               
               
                   
                 40 
                 out.printIn( “ } “ ); 
               
               
                   
               
            
           
         
       
     
     Statement 10 gets the name of the service method of the presentation code of Invoice using the CCG&#39;s coupling method InvoiceCCG.getAddShoppingItemMethod( ). Statements from lines 20 to 30 generate the body of the callback function in JavaScript and place the function in presentation code of the container component. Assuming that name of the service method is “AddToInvoice_UNQ_IDX”, statement 10 gets the name and stores it in string variable “Invoice_SM”. When statement 30 is run, the container CCG prints the value of “Invoice_SM”, which is “AddToInvoice_UNQ_IDX”. Therefore, the body of the callback function is: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10 
                 function add_item_to_invoice( item_bar_code, xml_data ) { 
               
               
                 20 
                  AddToInvoice_UNQ_IDX( item_bar_code, xml_data ); 
               
               
                 30 
                 } 
               
               
                   
               
            
           
         
       
     
     Then, the container CCG registers the callback function in the application code for each of the shopping items by a loop. This function causes the CCG of the item to include necessary communication code in its presentation code to call the callback function upon user selection or action. 
     for (int I=0; I&lt;count; I++) {
         CCG_Items[I].addCallBackOnSelection (“add_item_to_invoice”);       

     } 
     The callback function “add_item_to_invoice” registered with each item&#39;s subcomponent. Upon user selection, the application code of the shopping item calls “add_item_to_invoice”, which calls the service method of the subcomponent Invoice/Table (as shown in line 20). Upon selection, the presentation code of each shopping Item calls the JavaScript callback function ‘add_item_to_invoice’, which adds the item to the Invoice/Table using the service method (i.e., AddToInvoice_UNQ_IDX) of the Invoice&#39;s presentation code. 
     7. Data Exchange Mechanisms Placed in the Application Code 
     The integration logic is responsible for generating necessary communication code, which is responsible for the inter-component communication. Therefore, in designing the code of integration logic, it is also necessary to understand data-exchange mechanisms. When a component calls a service method of other component, data is normally exchanged through the variables in the service method&#39;s parameters. Optionally service method can also return a data objects. The service method must be called by passing right number of parameters/variables and right type of the variables. Data exchange mechanisms include (1) use of XML strings, (2) use of common global variables shared by multiple components, and (3) use of hidden fields in HTML code. 
     (a). Use of XML Strings 
     Application developers can define a schema of XML data to be placed in the application code for data exchange between two subcomponents. An XML string is used to store a plurality of data items or pieces of data (along with metadata), thereby reducing the number of variables/parameters. Appendix C has an example that initializes a variable “xml_data_str” with an XML String and passes “xml_data_str” as a parameter to a service method. 
     Since XML strings are extensible, redesigning communication code may be avoided if more data pieces are added to an XML string or XML schema. However, the subcomponents must be redesigned so that the user of the XML string could use the newly added data pieces. 
     By way of example, the XML string for the shopping cart and shopping items in the application code contains data of price, discounts and inventory. The designer of the CCG class for invoice usually defines an XML schema for the XML string. The CCG class for the shopping items must be designed so that the XML string conforms to the XML schema. The CCG generates invoice component so that it can access the data pieces from the XML string to add the item to the Invoice/table. The abstract class of the shopping item may support methods that set data values for variables such as price, options and discounts, and the methods are used to create and manipulate the XML string, and place the XML string in the presentation code of the subcomponent. 
     If a user selects an item to buy in a shopping cart application, the presentation code of the item calls a ‘ShoppingCart’ service method and send the XML string comprising pricing, name, and discount to the ‘Shopping Cart’ using the service method so that the service method can update the invoice. 
     (b). Use of Common Global Shared Variables for Data Exchange 
     If the subcomponent A changes the value of a variable X as a result of a user&#39;s action and if the variable containing the changed value is used by subcomponent B, data exchange between two subcomponents has occurred. In this case, the name of common variable X should not be changed to be unique because change to the variable name could make the variable inaccessible to other subcomponents. To prevent the name from being changed by attaching a unique index number or string in subcomponents, variable X should take a reserved variable name so that the name is not changed in any of the subcomponents. 
     (c). Use of Hidden Fields for Exchange Data 
     If the application code contains HTML code, data are placed as strings as hidden fields. Putting data in hidden fields does not affect the view of the component and yet, the data can be used by other components. 
     8. Use of Integration Data in the Presentation Code of Subcomponents 
     In a case where it is difficult or even impossible for a container CCG to access the CCG objects of subcomponents, alternative methods are used to get necessary integration data for creating communication code for the subcomponents. By way of example, if the presentation code of a subcomponent has been created and stored in a file, the container CCG cannot access the CCG object of the subcomponent. In this case, the integration data are embedded in the comment lines of the presentation code so that the data is invisible under the viewer but can nevertheless be used by the container CCG. 
     The developer, who designs the container CCG, can use the embedded integration data in implementing the code of integration logic. In this case, the developer needs to implement code for copying the presentation code from the file to the presentation code of the container component. Also, the container CCG may store the subcomponent&#39;s code in a string buffer and scan the code to find the integration data and use the integration data to generate required communication code. Since the integration data is embedded in the presentation code of subcomponent, the container CCG may also comprise utility methods for extracting the integration data from the presentation code. 
     By way of example, the integration data of the Show-layer component are in the form of name-value pairs, as follows: 
     COMPONENT_INTEGRATION_DATA SHOW_LAYER { 
     UNIQUE_INDEX_NUMBER=IDX_N 
     OBJECT_INSTENCE_NAME=layer_obj_IDX_N 
     ADD_SWITCH_CALLBACK=add_callback 
     SHOW_LAYER_SERVICE=show_layer 
     SWITCH_STATE_SERVICE=switch_state 
     } 
     COMPONENT_INTEGRATION_DATA is a unique reserved name. This data is coded into the CGM of the component CCG so that when CGM of the object is run, it generates the above data in a commented section of the presentation code. 
     A special utility method is designed and used in the container CCG to search the keyword COMPONENT_INTEGRATION_DATA. This utility method is able to find the tag and read the integration data. During the run time of the container CCG, the code of integration logic calls this utility method to get the integration data for use in generating necessary communication code. 
     However, the use of the integration data is not limited to the case where presentation code is stored in a file. Integration data are coded into the CGM of the any subcomponent, and the CGM of the subcomponent, upon execution, generates the integration data as comments in the presentation code of the subcomponent (Appendix G has an example). For example, if component code is fetched from a CCG Portlet running on a remote server, the container CCG can use the embedded integration data in generating communication code for the component. 
     Apparently, all of the above methods are used individually or in combination whenever possible. When integration of two components is based upon abstract component class, the container CCG may further validate integration data. 
     Moreover, a container CCG may contain a special method for verifying component class name and integration data. This method should cause the program running the container CCG to take a proper action if something is wrong with the component class and integration data. This verification method helps application developers spot the problems that the container CCG imports a subcomponent belonging to a wrong class or that one subcomponent CCG is of wrong type. 
     9. Interaction Between Container CCGs and Wrapper CCGs 
     A container CCG may use a wrapper CCG to fetch the presentation code of a component from a remote server. The presentation code may contain integration data, which is used by the container CCG to integrate the component. The integration data is coded into the CGM of the CCG for the component so that the CCG object is able to embed the integration data in the component code when the wrapper CCG calls the CCG object on the remote server. 
     A wrapper CCG may call the remote CCG in a similar way discussed under ACCG. The wrapper CCG may also have a special utility method for getting the presentation code of the remote CCG and a utility method for searching the presentation code for the reserved key word ‘CLASS_COMPONENT_DATA’. When the container CCG is run, the wrapper CCG gets the presentation code from the remote server, searches the presentation code for the reserved key word and returns the integration data to the container CCG for use in generating communication code, and copies the application code to the application code page. 
     The wrapper CCG may perform additional functions. One of such functions is to process the integration data and replaces the IDX_N with a unique index number or string to avoid variable name conflicts. 
     A wrapper CCG is designed to fetch a component&#39;s presentation code from a file. The following statement may be used to call a Java object to load the presentation code using a file name and the name of the component class to retrieve the integration data shown in example Show_layer: 
     WrapperCCG ShowLayer=new FileWraperCCG (file_name, “SHOW_LAYER”); 
     The object reads the “value” (e.g., the string) of the keyword after COMPONENT_INTEGRATION_DATA to determine whether the component class is of SHOW_LAYER (the second parameter of the CCG constructor). The object then gets the presentation code only if it is. Otherwise, the wrapper CCG flags an error and takes an appropriate action. 
     A wrapper CCG may implement a coupling service method for returning the name of the service method of the presentation code to the container CCG. The container CCG may contain code for requesting the name of the service method of the presentation code using the keyword as follows: 
     string switch_service= 
     ShowLayer.getComponentService(“SWITCH_STATE_SERVICE”); 
     In execution, this statement returns the name of service method corresponding to the service name “SWITCH_STATE_SERVICE”. The actual name of the service method is layer_obj_IDX_N. switch_state, which is object name appended with a unique-id, plus the name of the service method. The container CCG then uses the actual name of the service method in resultant communication code. 
     Instead of being stored in the tag-and-value pair data structure shown in the example, the integration data may also be stored in other format such as an XML string, and placed the XML string in a comment section of the presentation code. 
     Example 14 
     Pseudo Code Showing Integration Using Integration Data 
     The following statement in the wrapper CCG is used to fetch the presentation code from a remote server using a URL. The wrapper CCG reads the value next to a tag keyword COMPONENT_INTEGRATON_DATA to determine whether the component to be fetched is of the type SHOPPING_ITEM_CLASS. 
     Items[I]=new RemoteComp_WrapperCCG(URL, “SHOPPING_ITEM_CLASS”); 
     The statement gets the presentation code if the component on the remote server is of class SHOPPING-ITEM-CLASS. Otherwise, it flags an error and takes an appropriate action. If the wrapper CCG gets the presentation code successfully, it then gets the names of the service method of the component for use in generating communication code. 
     The following statement in a container CCG is used to get the name of the service method of the component, which has been obtained by a wrapper CCG by using a predefined tag BUY_CALLBACK_REG: 
     10. String reg_name= 
     Items[I].getComponentService(“BUY_CALLBACK_REG”); 
     20. out.println(“ ”+reg_name+“(add_item_to_invoice);”); 
     Line 10 stores the name of the service method implemented in the code of subcomponent of item[I] for registering a callback. Assuming that the value stored in reg_name is ‘item_obj_UNQ_ID.AddCallback’, the statement at line 20 generates the following communication code in the presentation code of the container component. 
     item_obj_UNQ_ID.AddCallback(add_item_to_invoice); 
     The above statement registers a callback ‘add_item_to_invoice’ for the Item subcomponent, where ‘add_item_to_invoice’ is the service method of the Invoice/Table subcomponent. 
     This example shows how a container CCG gets integration data from a CCG object on a remote server and uses the name of service method defined in the integration data to generate communication code for the component fetched from a remote server. 
     9. Basic Consideration in Designing Container CCGs 
     In order to use the method of the present invention, it is necessary to consider following issues: 
     The presentation code to be created by the container CCG should conform to the requirements of at least one of the supported programming languages supported on the platform. Variable declaration, code grouping, calling methods between subcomponents, placement of subcomponent code, and incorporation of files should be proper for the platform. 
     The objective of designing a reusable container CCG is to build and test the container CCG and the CCGs of imported subcomponents independently and allow the container CCG to take the CCG objects as subcomponents. The CCGs of the subcomponents are derived from an abstract class to ensure they support necessary component interface (e.g., coupling service methods of CCG) for providing integration data. If a container CCG is designed to use presentation code containing integration data of subcomponents, a data validation method is implemented to verify whether a subcomponent is of a right type. A container CCG that directly copy subcomponents presentation code should be capable of processing the presentation code of subcomponent, and getting necessary integration data from the presentation code. 
     Subcomponents are placed in proper locations according to the guideline for building an ACCG. In coding a container CCG, it is preferable to place the main communication code such as callback body after the variable and methods are defined in the application code. In the case where part of communication code is generated by the CCG object of a subcomponent and the communication code of the subcomponent refers to any external function (e.g., invokes callback functions implemented outside), the code for generating the functions should appear before the code for calling the CGM of the subcomponent. 
     A method of avoiding variable and method name conflicts is necessary for building a container CCG, as in building an ACCG. In some situations, this method is not necessary if the names of variables and methods happen to be unique. In practice, it should be used to avoid potential conflicts. One of the preferred implementations is to use a common utility object in the CCG of subcomponents, which can pick up a unique ID and append it to each of the global names in the application code. In the alternative, a global lookup table is used and a name in conflict with any of the names, which have been docketed in the lookup table, is changed to be a unique name. A change is made for all instances of this name. 
     In building a reusable container CCG, it is necessary to know whether an imported subcomponent is of a proper subcomponent for the container CCG or whether one subcomponent can properly interact with another subcomponent. 
     One of the implementations is to design the container CCG to accept only CCG objects of the subcomponents that belong to certain abstract classes. All versions of CCGs intended for the container CCG should belong to the abstract classes, and is input to the container CCG using an appropriate input method. The input method should accept only CCG objects that belong to or are derived from the abstract class. In another implementation, each of the CCG objects of subcomponents provides respective integration data necessary for integration. Moreover, it is preferable for the container CCG to check and validate the integration data for component compatibility. 
     A container CCG should be designed so that it is used as an input CCG to a larger container CCG to build a larger container component. This makes it possible to build component hierarchy conveniently. If the container component needs to be integrated with other components in the larger container component of the larger container CCG, the container CCG should be designed with coupling service methods for returning necessary integration data. 
     When a container CCG directly implements application logic or calls an ACCG which have application logic, the container CCG and the included ACCG should be designed so that application data is accessed, processed, and updated before the component is rendered on the platform, thereby making it possible to present real-time data. Alternatively the application code of subcomponent at the time of initialization or during execution on client can request additional data from data servers and use the data to update the subcomponent. This process of updating components while being presented on client is called Ajax. 
     A data exchange mechanism is provided if the container component and subcomponents A and B need to exchange data during the execution of the presentation code of the container component. One of the data exchange mechanism is to use XML string or data-objects, which are passed through the parameters of the service functions or callback functions. Alternatively, component data might be shared by using a common global variable. If presentation code is in HTML/DHTML, data are exchanged by using hidden fields. Finally, a large amount of data are exchanged though a file which is accessed by all sharing components. 
     J. Creation of Component Hierarchy 
     Many methods are used to build component hierarchy. 
       FIG. 12  is a flow chart that shows the steps or equivalent code sections of the CGM of a container CCG  1030  for generating a container component  1034  having two subcomponents  1035  and  1036 . Reference should be made to  FIGS. 10 ,  11  for sample pseudo code and the identity of components. The code of the CGM comprises the following main code sections or process steps: 
     1. Step  1200  or code section  1200  is server code for start generating code for the container component  1034 . 
     2. Code section  1201  is server code for instantiating and initializing an object CCG1  1031  for the first subcomponent PC1. 
     3. Code section  1202  is server code for calling the CGM of the CCG1 to generate and include the code of the PC1  1035  in the code of the container component  1034 . 
     4. Code section  1203  is server code for requesting the CCG1  1031  to get the name of a service method (e.g. PC1_ServiceMethod) of the PC1. 
     5. Code section  1204  is server code for generating a callback function to call the service method of the PC1  1035 . Here selected name of the callback function (e.g. CB_of_PC2_gets_service_of_PC1) must be unique to avoid variable name collision with other variable names in the container component  1034 , and also in an application that contains many other components, if the container component required to be used as a component of the application. The container CCG  1030  can make callback&#39;s name unique by affixing a unique id (which is not done in the code section  1102 ).
 
6. Code section  1205  is server code for instantiating and initializing an object of the CCG2  1032  for the second subcomponent PC2.
 
7. Code section  1206  is server code for requesting the CCG2  1206  to register a callback function name CB_of_PC2_gets_service_of_PC1 as a callback to the PC2.
 
8. Code section  1207  is server code for calling the CGM of the CCG2 to generate and include the code for the PC2  1036  in the code of the container component  1034 .
 
9. Code section  1208  is code for generating remaining code of the container component  1034 .
 
     (a). Building Container Component in Class Implementation 
     When a container CCG is implemented in class (e.g., instead of as JSP/Servlet), it is used as subcomponent of another container CCG. The container CCG class is used to instantiate and initialize a CCG object. Another container CCG could use the CCG object to build a subcomponent. If the CCG object is instantiated outside the container CCG, the CCG object is imported using set methods of the container CCG. 
     (b). Using GUI Controls to Build CCGs 
     GUI environments such as X11/Motif in Linux and Unix Operating Systems or Microsoft Windows API (MSW-API) provide GUI elements such as buttons, lists, check boxes and menus, known as GUI controls. The instantiated objects of the CCGs for creating GUI Controls are used as the building blocks of larger CCGs. The CCG objects generate presentation code, which renders the GUI elements. The presentation code generated by the CCG for GUI component contains service methods and event notification methods. 
     Like the GUI for the Windows, the presentation code of GUI Controls may have a rich set of class methods and variables to support many functionalities such as (i) handling user events and interactions, (ii) exporting service methods for external objects which use the service methods to get data or set values for variables, and access the services of the object of the control component, and (iii) allowing external objects to set callback functions for receiving notification of events and notifies them using the given callback functions when the events happen. (See Appendix-K for radio buttons group) 
     (c). Building ACCGs for Use in Larger ACCGs as Subcomponents 
     A large web application or container component comprises many components and subcomponents. It is desirable to build ACCGs for many such components and subcomponents. Each ACCG (e.g.,  FIGS. 4 and 5 ) class is custom designed for the application where the ACCG custom builds each component based on user preferences. Each ACCG class is built and tested independently. The ACCG encapsulates both business logic and presentation logic. Most of the ACCGs can be refined nearly independently to adapt to evolving business needs. 
     By way of example, component Hierarchical-menu is used to build component hierarchy. Each cell of the Hierarchical menu is filled by just a string variable or by a CCG object of more complicated component such as a pie chart or table. If an item passed to the Hierarchical-menu is CCG, the Hierarchical-menu class uses the CGM of the item to generate the component code. An instantiated hierarchical-menu object is passed to other large component (such as a cell of table or title of a map) as a subcomponent. This kind of component hierarchy could go on forever. 
     The Rotate-banner CCG (Appendix E) is a container component, which is used as subcomponent by another container CCG. The RotateBanner takes an array of CCG objects of the subcomponents. Each of the CCGs that are used by Rotate-banner may further use other CCG objects in building their subcomponents. 
     Theoretically, there is no limit in the size and complexity of the presentation code of the subcomponent. However, care must be taken for such items as coordinate system and the naming of the variables to avoid collision. In practice, very large and complex presentation code has been placed as subcomponents. No severe limitations are found for SVG components in Adobe&#39;s SVG viewer. Likewise no insurmountable limitations are found for DHTML/JavaScript components in Microsoft-IE5 or IE6. 
     K. Component Based Software Development 
     One of the preferred embodiment of component-based programming for building an application using plural components comprises following steps: (1) including or incorporating each component into the application, and (2) coupling the service providing component and service consuming component in order to allow the components to communicate or exchange data with each other on the client. 
     This process of incorporating and coupling each component should also be reversible. The component can be updated, disassembled from the application, or replaced by another component. 
     One of the preferred methods for accomplishing this is employing a component manager (“CM”) for each component. The component manager is used (i) to properly incorporate the component into the application or container component and (ii) to properly couple the component. 
     In one of the preferred embodiments of the present invention, an ACCG or a wrapper CCG is used as the component manager. The ACCG is a Java class, which is designed to custom build code for an application component. Each ACCG is designed to encapsulate all the necessary code such as application logic, presentation logic and business logic as shown in  FIG. 5  and generates custom component based on each user&#39;s preferences and profiles. 
     Each ACCG instance is used to include a component in the application code of the container component. The ACCG also comprise coupling service methods, which are used to create necessary coupling code. The coupling code is necessary for the component if the component need to collaborate or exchange data with other components in the application. 
     The following pseudo code shows a simple method for incorporating components into an online GUI application or a web page. If the following three ACCG Java classes are already created: (1) An ACCG StockInfoTable that takes ticker symbol of a company and generates code for stock quote table, (2) An ACCG IntraDayChart to generate code for one day&#39;s stock movement chart for given ticker symbol, and (3) An ACCG AnnualChart to generate code for one year&#39;s stock movement chart for a given ticker symbol. 
     The following example code for a CGM of a container component (FullStockQuote in  FIG. 6 ) is incorporating each component as a subcomponent by including two line of code. Since each component is incorporated by including two lines of code in the CGM of the container component, the components can be removed or replaced by changing only two lines of code. 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 void CGM(Out){ 
               
               
                 20. 
                  Out.printIn(“&lt;g&gt;”); 
               
               
                 30. 
                  AgileTemplate CF1_Table = new StockInfoTable(Ticker); 
               
               
                 40. 
                  CF1_Table.CGM(Out, 0, 0, null, ACi); 
               
               
                 50. 
                  AgileTemplate CF2_Chart1 = new IntraDayChart(Ticker); 
               
               
                 60. 
                  CF2_Chart1.CGM(Out, 0, 250, null, ACi); 
               
               
                 70. 
                  AgileTemplate CF3_Chart2 = new AnnualChart(Ticker); 
               
               
                 80. 
                  CF3_Chart2.CGM(Out, 0, 500, null, ACi); 
               
               
                 90. 
                  Out.printIn(“&lt;/g&gt;”); 
               
               
                 100. 
                 } 
               
               
                   
               
            
           
         
       
     
     The container ACCG starts calling the CGM of the container component in line 10. It first prints a canvas start-tag for the component in line 20. It then instantiates and initializes a CF1_table object in line 30 and calls the CMG of CF1_table in line 40 to generate a stock table (with X=0, Y=0). It then instantiates and initializes a CF2_chart object in line 50 and calls the CGM of CF2_chart object in line 60 to generate a intra-day chart (with X=0, Y=250). Finally, it instantiates and initializes a CF3_chart2 object in line 70 and calls the CGM of the CF3_chart2 object in line 80 to generate an annual chart (with X=0, Y=500). It closes the canvas for the component in line 90. The three images respectively for the table and two charts are placed vertically. 
     If one of the components needs to collaborate with another component in the application, the ACCG for the component is designed with mechanisms for creating necessary communication code as discussed above. 
     In a preferred embodiment of the present invention, an ACCG is designed with a minimum amount of coupling code for incorporated components. Each coupling operation used in the integration-logic method usually requires 1 to 5 lines of code. To replace a coupled component, the developer must (1) remove the code for incorporating the component, and (2) modify the code for calling the coupling service methods of the ACCG object. 
     Both a wrapper CCG and an ACCG object can function like a component manger, which not only can incorporate a component in an application but also can create necessary communication code for the component in the application. Also, the component generated by the ACCG is replaced by changing the code statement from referring to one ACCG object referring to a different ACCG object. 
     It is necessary to use a method to issue components are not mismatched. A typical communication interface between any two components comprises a reference to a service function, the number of parameters passed to the function, the data type or format of each of the parameters, and returned data of the function. For example, an interface between Invoice-table and Shopping-items in a shopping-cart application is as follows: 
     var Status=add_to_shopping_cart (Inferface_version, item_xml_data, call_back); 
     If a need arises that the Invoice-table to show additional pieces of data for each item placed in the shopping cart, but this additional data is not being passed through the parameter ‘item_xml_data’, then the interface must be redesigned so that the additional data are passed through the interface. The additional data are passed to shopping_cart component in new parameters to be added to the interface or ‘item_xml_data’ whose XML-schema has been modified to accommodate the additional data. If the interface is updated, each of the shopping-item components must be redesigned so that they can properly request the service using the updated interface. 
     Therefore, it is desirable to use a generic tool to automatically detect a broken coupling or mismatched interface between two components. 
     L. Component Manager as a Replaceable Component 
     A replaceable ACCG component is a module that is designed with the features that it can be easily assembled into a container component and disassembled or removed from the container component. 
     The ACCG comprises the code of presentation logic and code of application logic. The presentation logic is implemented in reusable GUI classes for GUI components while the code of application logic uses application data to initialize GUI objects for the GUI components. Also, the ACCG comprises special methods for creating necessary communication code if the component needs to communicate with any of other components in the application. The following code illustrates replaceable property of an ACCG, where the component is included by the following lines and removed by removing the lines: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 ComponentManger CM1 = new FullStockQuote (“IBM”, parameters1); 
               
               
                 20. 
                 ParentCanvas.AddChild(CM1, x_location, y_location, parameters2); 
               
            
           
           
               
            
               
                 Alternatively: 
               
            
           
           
               
               
            
               
                 10. 
                 ComponentManger CM1 = new FullStockQuote (“IBM”, parameters1); 
               
               
                 20. 
                 CM1.CGM (Out, x_location, y_location, parameters2); 
               
               
                   
               
            
           
         
       
     
     If the component needs to communicate with other components in the application, the component manager CM1 is designed to support coupling methods as previously described for coupling the component with other component in the application. Since the code of integration logic calls the coupling methods of component manager CM1 in creating communication code, this component is replaced by properly redesigning the code that refers to the variable of the component manager CM1. 
     In a preferred embodiment, each of the replaceable components is designed for easy removal from an application. This is achieved by, for example, by making the communication code of the component simpler or reducing the communication code required for the coupling with each of the other components. A replaceable component may be removed so as to (1) assemble a better component during maintenance time or (2) to update and test the component with a higher degree of independency from the application. For example, a subcomponent such as IntraDayChart in FullStockQuote can be refined and tested independently outside of the application that comprises one or more subcomponents (See  FIG. 5 , Section K and  FIG. 6 ). 
     One or more replaceable component ACCGs can be assembled to form a container component. The container ACCG is designed to be a replaceable component. This process can be repeated to build larger and larger replaceable components. Appendices T, U contain code, which shows an implementation for building a component hierarchy. 
       FIG. 13  is a flow chart that shows steps of either the CGM of a replaceable container CCG or a server program (e.g. JSP) for generating the code of a container component or an application having 3 replaceable subcomponents AC1, AC2 and AC3, and for integrating the subcomponents by creating necessary inter-component communication code for the replaceable subcomponents AC1, AC2 and AC3. 
     Example 15 
     Building Application by Assembling Replaceable Components 
     A Geographical Information System (‘GIS’) application for a city is built by assembling three replaceable components: (i) city map comprising vector drawings such as streets and canals, (ii) important landmarks of the city, and (iii) emergency services. An ACCG for each of the three components is designed, developed and tested independently. 
     Assuming that ACCGs for the city map, city landmarks, and emergency services are respectively known as CityMapCF, CityLandmarksCF, and AmbulancesCF, which display current locations and movements of ambulances on the city map. Then, the CGM of the container ACCG, City_GIS_CF, assembles all three replaceable components as follows: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 Void CGM(Out, ACi) { 
               
               
                 20. 
                 RepComp CityMap = new CityMapCF (ACi,ZipCode); 
               
               
                 30. 
                 this.canvas.AddChild (CityMap, 0, 0, null); 
               
               
                 40. 
                 RepComp LandMarks = new CityLandmarksCF(ACi, ZipCode); 
               
               
                 50. 
                 this.canvas.AddChild (LandMarks, 0, 0, null); 
               
               
                 60. 
                 RepComp Ambulances = new AmbulancesCF(ACi,ZipCode); 
               
               
                 70. 
                 this.canvas.AddChild (Ambulances, 0 0,null); 
               
               
                 80. 
                 this.canvas.CGM(Out, ACi); 
               
               
                 90  
                 } 
               
               
                   
               
            
           
         
       
     
     All the above components overlap each other so each component (and its subcomponents, if any) must be drawn on a canvas with a transparent background except the component CityMap. If there is need for adding new overlaying features, additional replaceable components are added to the application. Also, such replaceable components can be added by using if-then-else conditional statements, which may be based on user preferences or profiles. For example, following code are added to the code listing between the line numbers 70 and 80. 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 20. 
                 if (User_Preferes_City_Traffic) { 
               
               
                 30. 
                  RepComp TrafficCongestion = new BadTraffic(ACi,ZipCode); 
               
               
                 40. 
                  this.canvas.AddChild (TrafficCongestion,0,0,null); 
               
               
                 50. 
                 } else if (User_prefers_Air_traffic) { 
               
               
                 60. 
                  RepComp AirTraffic= new CityATC(ACi, AirportCode); 
               
               
                 70. 
                  this.canvas.AddChild (AirTraffic, 0, 0, null); 
               
               
                 80. 
                 } 
               
               
                   
               
            
           
         
       
     
     The first condition statement causes the ACCG to add a component for city traffic and the second conditional statement causes the ACCG to add a component for air traffic. If any of the components is too big, it is further subdivided into replaceable subcomponents. For example, the Component Manager ACCG CM for the city landmarks is divided into three replaceable subcomponents, respectively for, (1) hotels and hospitals (2) theaters and auditoriums, and (3) tourist spots. Then, ACCG CM for the subcomponents is designed and developed by three different developers nearly autonomously and is assembled by the CGM of CityLandmarksCF as follows: 
     
       
         
           
               
               
             
               
                   
               
             
            
               
                 10. 
                 Void CGM(Out, ACi) 
               
               
                 20. 
                  RepComp Hotels = new CityHotelsCF (ACi, ZipCode); 
               
               
                 30. 
                  this.canvas.AddChild (Hotels , 0, 0, null); 
               
               
                 40. 
                  RepComp Theatres= new TheatresCF (ACi, ZipCode); 
               
               
                 50. 
                  this.canvas.AddChild (Theatres, 0, 0, null); 
               
               
                 60. 
                  RepComp TouristSpots = new TouristSpotsCF(ACi, ZipCode); 
               
               
                 70. 
                  this.canvas.AddChild (TouristSpots, 0, 0, null); 
               
               
                 80. 
                  this.canvas.CGM(Out, ACi); 
               
               
                 90. 
                   } 
               
               
                   
               
            
           
         
       
     
     The code statements instantiate and initialize the component Hotels in lines 20, 30, the component Theatres in lines 40, 50, and the component TouristSpots in lines 60, 70. The code statement then generates the code for displaying city landmarks in line 80. 
     If a replaceable component needs to communicate or exchange data with other components, the replaceable component must be coupled. Component coupling methods such as “integration-logic” or “publish and subscribe” are used to implement necessary communication code. The design objective of each of the replaceable components is to satisfy unique needs of a single application. Thus, a replaceable component must be designed not only to be self-containing but also to have the minimum number of coupling interfaces in order to minimize the effort required for removing or replacing the component. 
     The replaceable components Theaters, Hotels or LandMarks are easily removed or disassembled from the application. Each replaceable component is disassembled and replaced by a newer or better component. It may also be reassembled after it is redesigned, updated, and tested to satisfy evolving business needs. Each of the replaceable components such as LandMarks or TouristSpots is custom designed to satisfy the unique needs of an intended single application. The design objective is to achieve a high degree of autonomy (or modularization) as much as possible in order to minimize the effort required to remove, update, and test the component during future maintenance periods. 
     The replaceable CM ACCG and their hierarchies are created using other technologies and GUI programming languages such as Adobe&#39;s ActionScript/Flex. The component is replaced by functionally equivalent new component manager and by properly redesigning the code lines that refer to old component variable. For example, each of the replaceable components such as tourist spots or it&#39;s container component Land marks is assembled by using a variable TouristSpots or LandMarks respectively. Here each of the variables is an object instance of respective classes TouristSpotsCF and CityLandmarksCF. The land marks component and its subcomponents can be removed by removing the two lines of the code that refers to the variable LandMarks from the CGM of City_GIS_CF. A subcomponent of land marks component such as tourist spots can be removed by removing two lines of code that refers to variable TouristSpots from the CGM of CityLandmarksCF. 
     M. Description of Replaceable Components 
     Replaceable components are different from other kinds of software components. Each replaceable component is custom designed to satisfy unique needs of an application and to allow for easy updates to meet unpredictable evolving future needs. The main design objective of the replaceable components is to maximize to the highest degree possible (1) self-containing and (2) loose coupling by minimizing the number of interfaces and code needed for their coupling. A replaceable component is considered as self-containing even if it collaborates with or depends on a few external services in its functions as long as its collaboration is through loosely coupled communication interfaces. The main design objective of a replaceable component is not reuse itself but to meet unique needs of an application, to be self-containing, and be easily replaceable in order to easily adaptable to evolving needs. 
     Replaceable components are different from the reusable components such as GUI API or GUI CCG classes. A replaceable component in general requires redesigning its code to create a new version for use in a new application. It needs not only to satisfy current unique needs but also to be able to evolve by version to meet future needs of the application. Otherwise, a reuse of a replaceable component of an application in a new application without creating a new version will compromise the quality of the new application and discourages updates for meeting evolving needs of each of the two applications. 
     In contrast, the design objective of a reusable GUI class of a large GUI component is to make the GUI class reusable across multiple applications without the need for redesigning the component for each of the applications. Hence, a reusable GUI class is designed to offer many configurable features and interfaces for initializing and configuring its GUI component to meet unique needs of each of the applications. For example, to build a large functional self-contained GUI component (e.g. line chart  512  or  612 ) for an application requires many lines of code for accessing data  505 , application logic in addition to instantiate, initialize and configure the GUI object  501  instance of a reusable GUI class. To properly remove the GUI component  512  from the application requires removing or updating all those lines of code associated with the GUI component in addition to the code for instantiating and initializing the GUI object. Although line chart  512  is self-contained and loosely coupled, the line chart alone is not a replaceable component because code of application logic and data access for line chart is not encapsulated within the component scope (e.g. an ACCG class definition). For example, a reusable GUI class of a large GUI component in general can be neither self-contained nor replaceable. However, a replaceable component  500  is a self-containing class implemented to satisfy unique needs of an application where the class-definition comprises not only data access code and application logic code but also the code for instantiating and initializing multiple GUI objects (e.g.  501 ,  502 ) using respective reusable GUI classes. 
     A replaceable component is a smaller self-contained replaceable part of a larger application. For example, a container component can assemble a replaceable component (e.g. FullStockQuote in  FIG. 6 ) by (i) instantiating an object variable using the replaceable component&#39;s class definition, and (ii) implementing a few lines of code for initializing and coupling the replaceable component using the object. The replaceable component can be disassembled from the container component by changing or removing the code statements that refers to the variable. A component is replaceable if it can be implemented as either a module or a class definition abstract, which encapsulates all the required code of the component in the abstract. When all the code of the component is well encapsulated in the abstract, the component can be assembled into an application by writing a few lines of code and can be disassembled from the application by removing or updating those lines of code. 
     The dependency or coupling between any two components means that the components collaborate with each other by requesting each other&#39;s services. Two software components are said to be loosely coupled if their service interface is designed so that they are coupled by including a few lines of communication code and uncoupled by deleting or updating the communication code. When a component is self-contained, the component usually communicates or collaborates with other components of a larger application through loosely coupled service interfaces. For example, collaboration between two self-containing components such as shopping cart and shopping item to add shopping item to shopping cart upon user&#39;s click on shopping item is different from accessing data by using a database object and using the data to initialize an object of a reusable GUI class to construct a component. 
     Since replaceable components are self-contained, it is easy to refine and test each of the components independently. If a component provides any services, each of the services is accessed to test its service interfaces and functions or features. Likewise, if a component depends on external services, each of the services can be provided to test the service interfaces and functions or features effected by the external services. 
     A replaceable component provides a method for testing its application component independently. This method is used when existing functions, features or services need to be improved or there is a need for overcoming any shortcomings in the current version. To redesign and test a replaceable component independently outside any application, a small test application is created, which comprises (i) the replaceable component, (ii) necessary code for accessing and testing any of the services provided by the replaceable component, and (iii) necessary code for providing any of the services needed for the replaceable component under testing. It is not required that the replaceable component be an ACCG or a component generated by an ACCG. For example, each replaceable component is a class definition abstraction, which encapsulates a self-contained loosely coupled component so that the component can be replaceable as a unit by using an object instance variable and offers means for testing independently out side the application. 
     In contrast, although reusable classes such as CCG GUI classes of a large GUI component is not self-contained because reusable GUI classes requires many lines of code and data for constructing a self-contained GUI component. Example 15 under Section ‘L’ shows few examples for the replaceable components. Each of the replaceable components (e.g. LandMarks or TouristSpots) is a fully constructed self-contained component of an application, which can properly function in the application to process user inputs such as mouse clicks or collaborate with other components by providing or requesting services. Each replaceable component is designed to have loosely coupled service interfaces and the interfaces must be properly coupled if its component needs to collaborate with other parts of the application. 
     Replaceable components may depend on one or more global service objects, some of which are discussed below. If a replaceable component depends on one or more global service objects, its test application can comprise the global service objects. To minimize effort needed for testing a replaceable component independently using a test application, it is desirable to minimize the number of couplings of the replaceable component with other components and the number of global service objects that the replaceable component depends on. 
     The coupling code for a component is included in its container component or within the code of the component. Since the server code of integration logic responsible for generating the coupling code is within the container component but outside the component code, the resulting coupling code is also outside the component code. Alternatively, the coupling code can be included in the code of the component if it uses predefined global services. Any component can be designed to contain code for requesting a predefined global registration object to look up necessary services. An application can predefine and include global message window object (e.g., APP_xyz_Services), which is used by any component in the application if it needs to display a message. 
     APP_xyz_Services.Display_message_window (message_type_code_num, message_string, config_info, call_back); 
     Where “APP_xyz_Services.Display_message_window” is a global predefined service method for displaying a message in a popup window. The following statements illustrate three service calls for displaying three massages: 
     APP_xyz_Services.Display_message_window (INFO_MSG, “CONGRATULATIONS! Your test score is: 99%”, NULL, NULL); 
     APP_xyz_Services.Display_message_window (ERROR_MSG, “You entered a negative number for age, enter a number between 0 and 150”, NULL, NULL); 
     APP_xyz_Services.Display_message_window (ERROR_GET_ANSWER, “There is an Error in calculation, do you wish to continue?”, NULL, take_action); Function take_action (selection) {if (selection==YES) do_something( );} 
     Any replaceable component in an application can use such predefined global service objects. Each global service object may provide more than one service method. For example: 
     APP_xyz_Services.Send_event_log_message (SECURITY_ERROR_LOG, “This user trying to access secure data area”, user_id); 
     Since such a global service object does not depend on replaceable components, removing a replaceable component that depends on the global service object won&#39;t cause errors. The component can be easily disassembled or reassembled. However, care must be taken when redesigning a global service object. When new features are added to the global service object, backward compatibility must be maintained. If many components depend on the global service object, removing the global service object can cause errors in many components. The global service object is not a replaceable component. 
     Each global service object can be designed as a class definition so that it needs fewer lines to include an object instance in any application. In the following example, code line 10 includes a file containing a class definition (e.g. APP_MSG_service_class) and line 20 instantiates a global service object (i.e. APP_xyz_services is an object instance of class APP_MSG_services_class). 
     10. &lt;script xlink:href=‘Global_JavaScript_Classes/APP_MSG_services_class.js’ language=‘text/ecmascriptt’/&gt;” 
     20. var APP_xyz_services=new APP_MSG_service_class( ); 
     Alternatively, an ACCG (e.g. APP_Services_ACCG1 Java class) is implemented to generate application code of a global service object using a given name (e.g. “APP_xyz_services”). For example, below is sample code to include the Global object using the ACCG: 
     10. &lt;% Global_Ser_Obj=new APP_Services_ACCG1 (“APP_xyz_services”); 
     20. Global_Services_Obj.CGM (ACi, Out); %&gt; 
     The replaceable component comprises all the necessary code such as code for accessing application data, code of application logic and presentation code for building a loosely coupled component.  FIG. 5  shows an example of a replaceable component. The GIS application (See example 15, Section ‘L’) provides examples for a few replaceable components. Each replaceable component is assembled into a large application as a subcomponent or may run as an independent application by providing services the component requires or accessing services offered by the component. For example, it is possible to test each replaceable component (e.g., CityLandmarksCF, AmbulancesCF or CityATC) independently by assembling into a simple test application, which contains additional code for providing required services for testing. When it is necessary to update or refine a replaceable component, its class implementation can be redesigned independently. It then is tested using the test application, which may use static data from files to conduct tests for various cases. Once the component passes all necessary tests, it is assembled into a large application. 
     In summary, a replaceable component is a self-containing object or class-definition or module custom designed with the features (a) that it can be easily assembled or included in an application, (b) it can be easily disassembled or removed from the application, and (c) it comprises methods, interfaces and code to allow for loose coupling of the component with other parts of the application if the component needs to communicate or collaborate with other parts of the application. 
     N. A Mechanism for Managing and Validating Dependencies Between Replaceable Components 
     An application can be created by assembling many replaceable components as shown in  FIG. 17 . Plural replaceable components  1710  offer one or more services for other components. Likewise, plural replaceable components  1720  depend on one or more services offered by other components. It is thus desirable to have a tool for automatically detecting broken dependencies or incompatible interfaces between any two replaceable components. During the initialization of the application, each component registers each of its services with the Service Registration Object (“SRO”)  1700 . Like-wise, each component registers each of the services that the component requires (or depends on) with the SRO  1700 . The SRO  1700  builds a list of all available services  1730  and a list of all required services  1735 . After the initialization of the application, the SRO  1700  compares the two lists, match the available services  1730  with the required services  1735 , and create a diagnostic report showing all mismatches. The SRO also detects that (i) a required service  1740  for a component is not available, (ii) an available service  1745  is not used, and (iii) a required service  1751  and an available service  1752  are incompatible. Missing services and incompatible services are also known as dependency or interface problems. Those problems may arise after one of the service-providing components is updated while one of the dependent components is not updated properly. The unused services are removed when cleaning up the application code. 
     The SRO  1700  is used to facilitate communication between two components, for example a service providing component  1762  and service consuming component  1764 . Service providing component ( 1762 ) registers a service function using a predefined service name (e.g. “Shopping Cart Type3”) with the SRO. Service consuming component  1764  calls the SRO&#39;s lookup method for finding the service function by using the predefined service name (i.e. “Shopping Cart Type3”). The name of the service and interface of the service function must be defined in advance of designing the two components ( 1762 ,  1764 ) so that the components is implemented to communicate with each other properly. The interface of a service function comprises service version, type of the object returned by the service function, number of parameters and type of each parameter of the service function. The service providing component  1762  is designed to include information about the interface  1752  and a unique id for the component (e.g. its Class name) when registering service function with SRO. The service-consuming component  1764  is designed to include information about the interface  1751  and a unique id for the component when it calls SRO&#39;s method for looking up or at the time of initialization. SRO  1700  is designed to use the information  1751  and  1752  to detect incompatible communication interface if one of the two components is redesigned and the other component is not updated accordingly. 
     This method of using the SRO  1700  to manage component dependencies or detecting incompatible interfaces is not limited to web applications, and can be used in any software application comprising replaceable components. Each replaceable component may offer one or more services and also consume one or more services of other components. The services listed in the SRO  1700 , the available services  1730  and the required services  1735 , can be used for building tools or utilities such as (a) an utility for finding all the other components that depend on a given component or service; or (b) an utility for graphically displaying each component as a node in a network map and connection lines between the components as dependencies (the image is referred to as component dependency map). Each of the components or nodes on the map may be a hot link for opening a new window that displays services the component provides or consumes and a list of components that consume or provide each of the services. The SRO  1700  may create a file containing the lists  1700  and  1730  upon exiting the application or on a given event such as clicking on a designated button. A tool is build to read the lists from the file to display the component dependency map. 
     An application may implement two service registration objects, SRO1 and SRO2. Here SRO1 ( FIGS. 8   a ,  8   b ) is for facilitating communication between each of the service-consuming components and each of the service-providing components in the application like the method discussed above while SRO2 is for managing dependencies between service-consuming components and service-providing components. To allow for managing dependency, each of the replaceable components in the application also separately registers (i) each of the services it offers along with information about the communication interface and (ii) each of the services it needs along with information about the communication interface with the SRO2 ( FIG. 17 ). The SRO2 uses the information about the communication interfaces for managing dependencies by (i) detecting incompatible communication interface between any two components or (ii) finding all the communication interfaces of a component. This second SRO is different in that it has storage space for accepting information about communication interfaces for each service entry and a method for adding service with interface information. In addition, this second SRO also has the code necessary for finding all communication interfaces for a component, the code for comparing whether a required service is missing from the available service list, and the code for comparing whether the communication interface of an requested service is same as the communication interface of an available service. 
     O. Use of the Method and System of the Present Invention 
     The method is used to build a wide range of reusable GUI container CCGs that implement complex GUI-Metaphors such as On-Line Analytical Processing Cubes (OLAP-Cubes), shopping-carts, master-detail tables for database applications, GPS-maps, and air-traffic control systems. Also, it is possible to support reusable GUI container CCGs for simulation of DNA/Genetic composition, visual representations of chemical formulas and online games. It is possible to implement custom application specific ACCGs, which isolate and encapsulate the code of application logic for custom-creating each subcomponent. The reusable GUI container CCGs encapsulate the code of integration logic and automate the integration of subcomponents. 
     In the preferred embodiment of the present invention, Java is used on the server side, and W3C&#39;s SVG and JavaScript, which is an XML-based presentation language, is used on the client side. Any programming language such as .NET/C# on the server side, and any XML based presentation languages such as Adobe&#39;s MXML/Flex or XAML implemented in the Avalon subsystem of Vista Windows Operating Systems can be used on the client side to achieve the same goal. 
     XML includes a feature known as the Document Object Model (DOM), which is an API (application programming interface) for HTML and XML documents (e.g. to manipulate the elements in the XML documents). The DOM defines the logical structure of documents and the way the elements in a document is accessed and manipulated. The DOM allows programmers to build documents that may contain navigation structure and methods for adding, modifying, or deleting elements and content. Many objects found in an HTML or XML document can be accessed, changed, deleted, or added using the DOM. Documents are modeled using objects, and the model encompasses not only the structure of a document, but also the behavior of a document and the objects (e.g., GUI elements and components) of which it is composed. This invention is intended to cover this method used under the Avalon subsystem. The XAML/SilverLight is expected to support similar or equivalent features of the XML based graphical elements. 
     The approach to declaring graphical elements is commonly referred to as declarative GUI programming. The XML based graphical technologies such as XHTML/DHTML, XAML, SVG, VML, X3D and SMIL fall under this category. They are ideally suited for representing or dynamically building larger component hierarchy in the XML Tree. Each of the sub-trees in the XML tree may represent a component. Each of the sub-trees of the component tree represents its subcomponents. This tree of components and component-hierarchies is created by program and dynamically manipulated in runtime on client. 
     The code generated for the application component may include any of the technologies to present the component on any platform running a browser, a viewer or other equivalents. The invention may be practiced with any of the commercial browsers which support at least one of the XML-graphical formats or namespaces. Understanding the specifications of programming languages/technologies used on a platform, any person skilled in the programming art can design CCGs and ACCGs to achieve the same results for the platform according to the teaching of this disclosure. While most of the CCGs in the examples are presented in the Java language, it is not so limited. If a container CCG is built in C++ or other suitable programming languages, the CCG objects of subcomponents are inputted to the container CCG by any method supported in the languages. However, the different languages may require the library of basic components for presenting them. 
     In those exemplary embodiments of the present invention, specific components, hardware parts, arrangements, and processes are used to describe the invention. Obvious changes, modifications, and substitutions may be made by those skilled in the art to achieve the same purpose of the invention. The exemplary embodiments are, of course, merely examples and are not intended to limit the scope of the invention. It is intended that the present invention include all other embodiments that are within the scope of the claims and their equivalents.