Best Practice in Development Using Eclipse

Here is a list of recommendations about how to make the most of using Eclipse in real-life scenarios.

Break down large projects

Projects that contain a large number of source files and build artifacts can be hard to navigate and slow to build. If you find this is the case with your application, Micro Focus recommends that you review the contents of large projects and split them into separate projects in which you group items that are logically related.

For example:
  • If you have different versions of a product for different customers, keep common source in one project and have a separate project for each customer.
  • If you have core code that is rarely changed or recompiled, keep that in one project and have separate projects for those areas that change regularly.

Reference common sources

Use the COBOL Copybook project type to store all your copybooks and add this project as a dependency to the projects that contain any source programs that reference the copybooks. Use this approach in preference to using linked resources.

Use linked folders to reference resources where it is not possible to restructure your projects (to use the COBOL Copybook project type) or use a remote project (to access any sources on remote machines).

Use existing Compiler directives files

To avoid repetition and reduce maintenance effort, consider keeping all your Compiler directive settings in a directives file. To reference this file in each project, specify the USE"filename" Compiler directive in the Additional directives field in each project's properties.

Use relative paths

Keep your sources relative to a base path and avoid specifying full paths in you projects. This ensures your code is portable and easy to use with source control systems.

Access sources on remote machines

  • For optimal performance, create a remote project from the available project types to access any sources on remote machines.
  • Use RSE or SSH in preference to Samba type remote connections. Only use the Samba type connection when it is not possible to use the other types of connections. This is because the Samba connection has the slowest performance.
  • Avoid using network shares or drives to directly access any resources on remote machines from your local projects.

    If for some reason, it is not possible to use local versions of the sources, you can use network shares as linked folders but the connection will be very slow. In such cases, you might be able to improve the performance by splitting the remote shared folder into smaller chunks then set the COBCPY environment variable before you start Visual COBOL for Eclipse on your local machine.

Eclipse workspace

  • To avoid performance issues, your Eclipse workspace must not be on a shared drive.
  • Do not commit the Eclipse workspaces into a source control system, as they contain metadata which is updated frequently.

Configure Visual COBOL

To boost your productivity, enable some additional views in Eclipse that are suitable for the programming tasks you're dealing with within the current active perspective. To do this click Window > Show View and either select a view from the ones that are displayed, or click Other to choose from all available ones.

For example, in the Debug perspective, enable the Expressions view that lists any data items you want to monitor. Or enable the Remote Systems view to see all remote systems that have a connection defined in Eclipse and to launch terminal sessions from within the IDE.