Micro Focus recommends that you create and use Eclipse projects for your source code. There is a number of benefits to using projects, such as:
The following sections include recommendations on how to create and configure your projects, especially when you are working with a large number of files.
The definition of a large code base and a large project depends on various factors such as the number and size of files that comprise your application, the complexity and dependencies of the code base as well as the capacity of your machine. A large project could include hundreds or thousands of files and typically you experience performance issues when using Eclipse to load the projects, navigate the source code and when editing, compiling and debugging.
This section of the product help includes a number of recommendations and best practices to help you structure your code in the best possible way and optimize the performance of the IDE when you are working with a large code base.
The following list gives tips on how to structure your projects, especially if your applications consist of a large number of files:
Recommendation | Benefits |
---|---|
Create multiple smaller projects and make them dependent on each other, rather than keeping all the code in one very big project. |
Smaller projects are:
In addition, keeping your projects smaller helps achieve quicker response times in the editor. |
Create projects only for the source files you are working on. | This helps keep your projects smaller. |
Create one project per functional area of your application and create dependencies as required. | This helps keep the projects smaller, making it easier to understand the logical structure of your application and edit only those areas that require a change. |
Store copybooks and include files outside of the projects for the source code in copybook and include projects | You can then add these projects as dependent projects to the build path of other projects that include the source files. Copybook
projects are not compiled, thus saving processing time and resources.
|
Close projects not in use (click Project > Close Project) | This helps reduce the amount of memory Eclipse uses. |
Do not use source files and copybooks from a network drive. | Network drives are remote folders that are mapped to virtual local drives. This is associated with the NFS/Samba connection type which contributes to a slower performance compared with RSE connections. You should either use files from local folders or, if the files are located on a remote machine, create remote projects using the RSE connection type. |
Use folders and packages for COBOL JVM applications to organise code within a project | This helps organize and make navigation of the files in your projects easier by creating a hierarchical structure. |
Use paths relative to the project location in the project's properties - for example, for paths for the build output, or for linked resources. | This helps make the project portable to other machines. |
It is hard to provide a strict recommendation for the maximum number of files to store in a single project. This number will depend on many factors related to your particular development scenario such as:
Keeping the size of your projects smaller helps avoid various performance issues. As the size of a project increases:
Micro Focus recommends that you avoid having a large number of projects in your workspace. The reasons are the same as the ones for limiting the number of files within a single project.
It is hard to provide a strict recommendation for the maximum number of projects to store in the workspace. Keeping the number of projects smaller helps avoid various performance issues and improves the times for:
Create and use working sets within Eclipse to work on and only see a smaller number of projects in your workspace. Working sets enable you to work on and only see a selected number of projects in Eclipse.
You can select to build only the projects that are in the current working set although this will build any project which has a file present in the working set.
See Working Sets for more information.
Ensure your projects are easy to share between different development teams:
To export configurations or breakpoints:
To import breakpoints
You can also export a run or a debug configuration in your workspace as follows:
If linking sources into a project, only link individual source files and folders that will be used and not all of the available source files.
When using linked files, Micro Focus recommends that you create your project in a physical folder which is close on disk to the source files. This reduces the complexity of any relative paths used for linking and makes the projects more portable. Alternatively, create workspace variables that substitute the path to a project to make the configuration easier.
For example, if your source files are in /path/source then create any projects in /path/projects.
Micro Focus recommends that you use a source control system, SCM, to store and share your application's sources. Using an SCM has various benefits:
See the recommendations for making the projects portable to make working in a shared environment easier.