next up previous contents
Next: 4. TCM User Interface Up: Toolkit for Conceptual Modeling Previous: 2. System Architecture

Subsections

   
3. Source Code Organization

3.1 Source code versus design criteria


  
Figure 3.1: Logical source code organization.
\includegraphics[width=5in]{p/src-organization.eps}

In this chapter we explain how the source code of TCM is organized. TCM basically consists of about two dozen graphical editors and a startup program. The source code can be found in the directory $TCM_HOME/src. The TCM source code is physically split over several subdirectories. The sources can be compiled into a number of object libraries and executables. The source code is split in order to factor out commonalities between the programs. See figure 3.1 for a Venn-diagram like overview of the commonalities of the source code. The entire TCM source is called Global, the sources of the programs that have an X/Motif GUI, are called GUI. The sources that are used in all editors, are called Editor. The sources that are used in all diagram editors, are called Diagram. The sources that are used in all table editors are called Table. The sources that are used in the editor TERD are called TERD etc. For instance, the editor TSSD uses the sources of the TSSD area, the TERD area, Diagram, Editor and Global, but it does not use Table or TCRD. See figure 3.2 for an overview of the current TCM development directory structure. The sources are physically split over several subdirectories of the src directory. This is done according to the following criteria:

In principle each C++ class is declared in a distinct header file and has a distinct source file for the implementation. The files names are equal to the class name except that file names are in lower case letters by convention. Header files have suffix '.h' and source file have suffix '.c'. The reason that C++ source files have suffix '.c', which is originally used only for C programs, is that some C++ compilers require a suffix '.C', and some require '.cc' or '.cpp'. There is no C++ file name suffix that is accepted by all compilers that we have used except the '.c' suffix.


  
Figure 3.2: TCM directory tree.
\includegraphics[width=4.5in]{p/tcm-distribution.eps}

  
3.2 Individual files and directories

In the previous section we described the contents of the src subdirectory. Here we will describe the individual files and directories that are included in the source code distributions of TCM. The TCM distribution top-level directory contains the following files:

The top-level directory contains the following directories:

3.3 Object libraries

Depending on the operating system and the way TCM is compiled, object libraries are either shared object libraries, ending on .so or object archive libraries ending on .a. In the first case, the object code in the library is kept separated from the tool executables (they are dynamically linked), which makes executables smaller and run faster. For the Sun CC compiler (the default Solaris compiler) shared object libraries are made by default. For the other compilers such as gcc archive libraries are made by default. The contents of archive libraries are physically made part of the tool executables (they are statically linked); the libraries could be removed when compilation is completed.

Executables using object archive libraries tend to be much larger than with shared object libraries. Because of that, distributions that have to use archive libraries are in general compiled into only a few different executables, e.g. one for the tcm startup tool, one for all the diagram editors and one for all the table editors. The individual editors are then symbolic links to the collective diagram or table editor. The collective editor will see in its argv[0] argument which of the tools has to be launched.


next up previous contents
Next: 4. TCM User Interface Up: Toolkit for Conceptual Modeling Previous: 2. System Architecture
Henk van de Zandschulp
2003-01-07