Recent Changes - Search:

Homepage

This is the old Camino website, please visit our new page to download the code and get the latest documentation.









UCL MIG Home

UCL CS Home

UCL Home

edit SideBar

CodeOrganization

Development.CodeOrganization History

Hide minor edits - Show changes to markup

April 28, 2011, at 10:17 PM by pcook -
Changed lines 73-74 from:
      Some programs have too many options to list; in which case just list the most common ones and indicate that there are more
to:
      Some programs have too many options to list; in which case just list the most common ones and indicate 
      that there are more
April 21, 2011, at 10:34 PM by pcook -
Changed line 57 from:

All applications should provide a basic usage when passed the -help option.

to:

All applications should provide a basic usage when passed the -help option. This is handled by EntryPoint so applications don't have to do anything except implement the usage() method.

April 21, 2011, at 10:33 PM by pcook -
Changed lines 14-21 from:
initDefaultVals()
- Set all class variables to default values
initOptions(String[])
- Process command line options
initVariables(String[])
- Any additional setup that is required after processing command line args
execute(data.OutputManager)
- Runs the executable and passes output to the OutputManager
to:
void initDefaultVals()
- Set all class variables to default values
void initOptions(String[])
- Process command line options
void initVariables(String[])
- Any additional setup that is required after processing command line args
void execute(data.OutputManager)
- Runs the executable and passes output to the OutputManager

Executables must also provide a String usage() method, which returns basic information on how to run the application. This method is called by EntryPoint only if the command is run with -help and no other options.

Changed line 30 from:

EntryPoint simply constructs an AppName object, forwards the command line arguments, and then calls its execute method.

to:

EntryPoint simply constructs an AppName object, forwards the command line arguments, and then calls its execute method - unless the command is called with -help.

April 21, 2011, at 05:40 PM by pcook -
Changed lines 77-78 from:
  Detailed description of what the program does
to:
    Detailed description of what the program does
Changed lines 82-83 from:
  Complete listing of options with explanation of their syntax and function
to:
    Complete listing of options with explanation of their syntax and function
Changed lines 85-86 from:
   Who wrote the program or a substantial portion thereof
to:
    Who wrote the program or a substantial portion thereof
Changed lines 88-89 from:
  Other programs of interest
to:
    Other programs of interest
Changed lines 91-92 from:
  Formerly bugs, but more general. Includes known bugs, limitations, or common misconceptions
to:
    Formerly bugs, but more general. Includes known bugs, limitations, or common misconceptions
Added line 95:

The HTML man pages are auto-generated nightly - but new man pages need to be added to the Wiki. If you commit a new command, update the Wiki command list to point to the HTML version of that man page.

April 21, 2011, at 05:38 PM by pcook -
Added lines 60-93:

Man pages are written in NROFF. Check how your man pages look when you type man <command>. The man pages should follow a consistent format:


NAME
      program - One or two sentence description of what the program does

SYNOPSIS

      program -mandatoryOption <arg> [-notMandatory <arg>] [...]

      Some programs have too many options to list; in which case just list the most common ones and indicate that there are more

EXAMPLES
 Some common examples with a brief explanation

DESCRIPTION
  Detailed description of what the program does

OTHER SECTIONS  AS NECESSARY

OPTIONS
  Complete listing of options with explanation of their syntax and function

AUTHORS
   Who wrote the program or a substantial portion thereof

SEE ALSO
  Other programs of interest

CAVEATS 
  Formerly bugs, but more general. Includes known bugs, limitations, or common misconceptions

April 14, 2011, at 05:24 PM by pcook -
Changed lines 55-56 from:

All applications

to:

All applications should provide a basic usage when passed the -help option.

Added lines 59-60:
April 14, 2011, at 05:17 PM by pcook -
Changed lines 9-10 from:

The code itself is written in Java and should adhere to the principles of object-oriented design.

to:
Changed lines 34-35 from:

Other modules are arranged by theme

to:

Other modules are arranged by theme. These classes should not have main methods (a couple currently do, eg AnalyzeHeader / Nifti1Dataset), they should be objects with a well-defined and documented API. We don't have well-defined coding standards, but Effective Java by Bloch has some good guideines.

Added lines 44-45:

Applications should be documented with command-line usage, man pages, and online tutorials as appropriate. All classes should be documented with Javadoc for all methods.

Added lines 48-52:

By default, public, package and protected methods will appear in the javadoc. Private methods should be documented in the code with a Javadoc comment, but this is more for the benefit of people coding the class itself.

You can build the Javadoc with make docs. See the Javadoc tutorial for more information on coding doc comments.

Added lines 54-55:

All applications

April 13, 2011, at 10:39 PM by pcook -
Changed lines 7-8 from:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later. Users never invoke Java or any other interpreter explicitly.

to:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the application name and arguments to EntryPoint. New scripts should be written in bash, though we may allow other scripting languages later. Users never invoke Java or any other interpreter explicitly.

Changed lines 13-19 from:

Apps have a special structure to accomodate Matlab wrapping and provide a consistent user interface. All applications should extend the Executable class. Executables provide three methods:

initDefaultVals()
initOptions(String[])
execute(data.OutputManager)

EntryPoint etc.

to:

Apps have a special structure to accomodate Matlab wrapping and provide a consistent user interface. All applications should extend the Executable class. Executables provide the following methods, which are executed in the following order:

initDefaultVals()
- Set all class variables to default values
initOptions(String[])
- Process command line options
initVariables(String[])
- Any additional setup that is required after processing command line args
execute(data.OutputManager)
- Runs the executable and passes output to the OutputManager

Once you've written an app, you need to add it to the getExecutable method of the EntryPoint class, which is what actually gets executed in the script called by the user:

    java [options] EntryPoint AppName [options]

EntryPoint simply constructs an AppName object, forwards the command line arguments, and then calls its execute method.

April 13, 2011, at 10:14 PM by pcook -
Changed lines 13-17 from:

Apps have a special structure to accomodate Matlab wrapping and provide a consistent user interface. All applications should extend the Executable class.

to:

Apps have a special structure to accomodate Matlab wrapping and provide a consistent user interface. All applications should extend the Executable class. Executables provide three methods:

initDefaultVals()
initOptions(String[])
execute(data.OutputManager)
April 13, 2011, at 09:05 PM by pcook -
April 13, 2011, at 07:48 PM by pcook -
Changed lines 13-14 from:

Apps

to:

Apps have a special structure to accomodate Matlab wrapping and provide a consistent user interface. All applications should extend the Executable class.

EntryPoint etc.

Changed lines 28-34 from:
to:

Javadoc

Usage

Man pages

Changed lines 37-38 from:

Please see the test page for information about tests. Avoid embedding test code in the main methods of classes, or by writing test classes inside the packages themselves. For application tests, write a real-world use of the class and place it in ScriptTest. For unit tests, use the JUnit framework in the test directory. Java packages are virtual, you have the same access to package / protected methods in test/numerics as you do in numerics. A JUnit test is accessible to all users rather than just the person who wrote the test, and it can be run automatically by all users.

to:

Please see the test page for information about tests. Avoid embedding test code in the main methods of classes, or by writing test classes inside the packages themselves. For application tests, write a real-world use of the class and place it in ScriptTest. For unit tests, use the JUnit framework in the test directory. Java packages are virtual, you have the same access to package / protected methods in test/numerics as you do in numerics. A JUnit test is accessible to all users rather than just the person who wrote the test, and it can be run automatically by all users.

April 13, 2011, at 07:39 PM by pcook -
Changed lines 7-9 from:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later.

to:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later. Users never invoke Java or any other interpreter explicitly.

The code itself is written in Java and should adhere to the principles of object-oriented design.

Changed lines 13-14 from:
to:

Apps

Changed lines 17-18 from:
to:

Other modules are arranged by theme

Changed lines 21-25 from:

Compilation is performed via a Makefile. Each class in apps is compiled individually, which should in turn compile the rest of the code. However, this relies heavily on Java to correctly work out all the dependencies with other classes, which it doesn't always do correctly. Therefore, there is an additional target allclasses - make allclasses will compile everything under the Camino tree that isn't in the test directory.

Alternatively, you can do make clean and then make, which should be equivalent, but this is slower. However, most users will download the code and just do make, so be sure that your apps all work by doing make clean, make, and then running the tests.

to:

Compilation is performed via a Makefile. Each class in apps is compiled individually, which should in turn compile the rest of the code. However, this relies heavily on Java to correctly work out all the dependencies with other classes, which it doesn't always do correctly. You can bypass this issue with make allclasses, which will compile everything under the Camino tree that isn't in the test directory. Alternatively, you can do make clean and then make, which should be equivalent, but this is slower. However, most users will download the code and just do make, so be sure that your apps all work by doing make clean, make, and then running the tests.

Changed line 29 from:

Please see the test page for information about tests. Avoid embedding test code in the main methods of classes, or by writing test classes inside the packages themselves. Java packages

to:

Please see the test page for information about tests. Avoid embedding test code in the main methods of classes, or by writing test classes inside the packages themselves. For application tests, write a real-world use of the class and place it in ScriptTest. For unit tests, use the JUnit framework in the test directory. Java packages are virtual, you have the same access to package / protected methods in test/numerics as you do in numerics. A JUnit test is accessible to all users rather than just the person who wrote the test, and it can be run automatically by all users.

April 13, 2011, at 06:51 PM by pcook -
Changed lines 7-9 from:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later.

to:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later.

Added lines 13-15:

Other modules

Changed lines 18-22 from:
to:

Compilation is performed via a Makefile. Each class in apps is compiled individually, which should in turn compile the rest of the code. However, this relies heavily on Java to correctly work out all the dependencies with other classes, which it doesn't always do correctly. Therefore, there is an additional target allclasses - make allclasses will compile everything under the Camino tree that isn't in the test directory.

Alternatively, you can do make clean and then make, which should be equivalent, but this is slower. However, most users will download the code and just do make, so be sure that your apps all work by doing make clean, make, and then running the tests.

Changed line 28 from:

Do not embed testing code in the main

to:

Please see the test page for information about tests. Avoid embedding test code in the main methods of classes, or by writing test classes inside the packages themselves. Java packages

April 13, 2011, at 04:47 PM by pcook -
Added line 13:

Compiling

April 13, 2011, at 04:18 PM by pcook -
Changed lines 7-8 from:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command.

to:

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command. New scripts should be written in bash, though we may allow other scripting languages later.

Changed lines 15-20 from:

Documentation

to:

Documentation

Testing

Do not embed testing code in the main

March 30, 2011, at 07:54 PM by pcook -
Added lines 1-14:

Camino code organization and standards

This page describes in detail how Camino code is (or should be - work in progress) organized.

The user interface

Camino users interact with the commands in the bin/ directory. These are executable files that may call one or more Camino program. Currently, most of the executables are bash scripts that do some simple system checks and then forward the arguments to a Camino command.

Applications (apps)

Documentation

Edit - History - Print - Recent Changes - Search
Page last modified on April 28, 2011, at 10:17 PM