IBM®
Skip to main content
    United States change      Terms of use
 
 
Select a scope:    
     Home      Products      Services & industry solutions      Support & downloads      My account     
alphaWorks  >  Java technology  >  

HyperJ

Make extensions to existing Java programs, integrate Java programs, and remodularize Java programs without having to modify, or even have, source code.


Date Posted: January 7, 2000
Overview Requirements DownloadFAQsForum Reviews

1. Can I use HyperJ to adapt, extend, or integrate a Java™ program for which I do not have the source code?
2. Can I use the composed classes produced by HyperJ as input to HyperJ for further composition?
3. Can I import the composed classes produced by HyperJ into new Java code that I write?
4. Can HyperJ be used to extend Java library classes?
5. What do I do if code for multiple concerns is tangled within the body of a single method?
6. What are the limitations, updates, and plans?
7. Where can I learn more about HyperJ?
8. Please explain "separation of concerns" in more detail.
9. Please tell me more about HyperJ's composition capability.
10. What is the directory structure of the hyperj.zip file?


1. Can I use HyperJ to adapt, extend, or integrate a Java™ program for which I do not have the source code?

Yes. HyperJ uses class files and does not need source files to work. Of course, you need some understanding of the program, such as interfaces and method signatures, but this can be obtained from documentation or from class file dumps produced by javap.
Back to top Back to top

2. Can I use the composed classes produced by HyperJ as input to HyperJ for further composition?

Yes. The class files produced by HyperJ are standard Java class files that can be used just as class files produced by a Java compiler, including use as input to HyperJ.
Back to top Back to top

3. Can I import the composed classes produced by HyperJ into new Java code that I write?

Yes. The class files produced by HyperJ are standard Java class files that can be used just as class files produced by a Java compiler. To use them, you need to know some of the details, such as interfaces and method signatures. HyperJ does not produce source files, but you can obtain this information in a number of ways:
  • by running javap on the composed class files
  • by examining the "unparse files" produced by HyperJ in verbose mode; these are not Java source files, but they do contain most declarative information.
  • through your understanding of the composition process.
Back to top Back to top

4. Can HyperJ be used to extend Java library classes?

Not yet. In principle this can be done -- library classes, except perhaps those that the Java system treats as special, such as Object, are just regular classes with standard class files -- but there are some implementation kinks we have not yet worked out. This capability is planned for the next release.
Back to top Back to top

5. What do I do if code for multiple concerns is tangled within the body of a single method?

HyperJ works at the granularity of whole members and does not support pulling apart of code within method bodies. This leaves two choices:
  • You can exclude the method entirely from compositions, perhaps by assigning it to a "None" concern. Instead, you provide your own methods to do the necessary processing, separately, for each concern of interest, and use HyperJ to compose these as desired. If you are very lucky, the needed per-concern methods will already exist in the program, with the tangled method merely calling them. This approach is illustrated in the example in Chapter 5 of the HyperJ manual.
  • If you have the source code, you can modify it by hand to split the method.
Back to top Back to top

6. What are the limitations, updates, and plans?

The first release is a file-driven, batch version that has a number of limitations, noted in the manual. Some key features planned for future releases include: an interactive GUI, support for composition of Java library classes, and more convenient ways to specify a number of common compositions. Updates to HyperJ include the following:
  • simplified control files (allowing one instead of three, and often abbreviated)
  • support for different bracketing of the same method for different call sites
  • some additional composition relationships
  • "unimplemented error" exception to allow easier writing of declaratively complete class fragments
  • summary function library
  • compatibility with Tengger, which provides support for composition of UML models and generation of Java from UML.
Back to top Back to top

7. Where can I learn more about HyperJ?

You can learn more about HyperJ at http://www.research.ibm.com/hyperspace.
Back to top Back to top

8. Please explain "separation of concerns" in more detail.

"Separation of concerns" is simply an approach to decomposing software into modules, each of which deals with, and encapsulates, a particular area of interest, called a concern. Examples of concerns are functions, data types or classes, features (such as persistence, print, or concurrency control), variants, and roles. Object-oriented languages permit decomposition by class, but only by class. Unlike classes, other kinds of concerns cannot be encapsulated in single modules; instead, their implementations end up scattered across the class hierarchy.
Back to top Back to top

9. Please tell me more about HyperJ's composition capability.

HyperJ provides a powerful composition capability, which can be used to combine separated concerns selectively into an integrated program or component. For example, it can be used to create a version of a system that contains some features, but not others, even if the original system was not written with the features separated. It can be used to extend or adapt a component, even if that component was not written with suitable hooks or open points. To give a concrete example: Suppose a developer needs to produce an XML representation of a complex domain model that spans a large system. Rather than modifying the classes involved in the domain model to add XML streaming methods, the developer can code these methods in a separate package (or packages) and integrate them with the domain model classes using HyperJ.
Back to top Back to top

10. What is the directory structure of the hyperj.zip file?

The file hyperj.zip contains the following directories and files:
  • bin directory
    hyperj.jar: A JAR file containing the HyperJ class files.
  • doc directory
    hyperj-user-manual.ps: Describes the use of the HyperJ tool.
  • demo directory
    This directory contains the Java source code and various HyperJ specification files (described in Chapter 4 of the "User Manual") for an example application (elaborated upon in Chapter 5 of the "User Manual").
Back to top Back to top
Download now Download now

Related technologies

For platform(s):
All Java Platforms

For topics:
integration, Java technology


 

    About IBM Privacy Contact