Browse Prior Art Database

Method for the management of code fragments Disclosure Number: IPCOM000123370D
Original Publication Date: 2005-Apr-04
Included in the Prior Art Database: 2005-Apr-04
Document File: 3 page(s) / 69K

Publishing Venue



Disclosed is a method, and format to facilitate copy/paste operations that normally are handled largely through documentation. For development tool samples, the user is typically instructed to copy a certain block of text or code from within the documentation (or re-key it themselves) and paste it somewhere into the development tool. This is error prone and forces the user to toggle between different source locations and the destination locations. This also leads to problems if the text or code to be copied must be maintained/updated since the documentation must be reworked and possibly retranslated before being released to customers.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 3

Method for the management of code fragments

Application developers make extensive use of development tools and environments. The developers of those tools have to communicate to the application developer how to make use of the tools for specific purposes. This is often done through the use of samples or examples in the documentation.

    Typically, the documentation would instruct the tool user to 'Copy the following and paste it into the editor: System.out.println("This is a test.").' The user would then use the system clipboard to perform this copy/paste operation. However, when copying, often the start or end of the section to be copied is missed. Alternatively, this instruction might be 'Type the following into the editor: System.out.println("This is a test.");' When manually retyping the information (as must be done if the documentation is in printed form only), there are often keying errors that might never be noticed.

    During the development of an eclipse-based development tool, it was necessary to add sections to the documentation that instructed the user to copy a specific block of code from the documentation to the sample application being developed. Since the development tool was being under development, the code that needed to be added had to be changed from time to time, so the writers and developers needed to revalidate repeatedly to ensure the correct code was in place. This led to problems for the developers and writers, in addition to the potential problem for the application developers attempting to complete the example using the development tool.

    Clearly, a new solution was required. For the next release of the development tool, it was decided that the documentation would instead point to a location that contained the code snippets to be copied and instruct the user to copy from that location. The problem of missing some information in the copy operation, however, remained. The file format was then reworked to formalize the content:

<snippetcollection collectionname="Code snippets for Sample 1">

<snippetgroup groupname="Construction">

<snippet id="part1">

   System.out.println("This is a test.");
<snippet id="part2">

     System.out.println("This is a second test.");
<snippetgroup groupname="Execution">

<snippet id="deploy">

   System.out.println("The process is deployed.");
<snippet id="start">

   System.out.println("The process has been started.");
<snippet id="success">

System.out.println("The process has ended successfully.");

   System.out.println("Verify that the appropriate information has been
<snippet id="fail">

     System.out.println("The process has ended abnormally.");


Page 2 of 3