download

If you find this software useful or develop any extensions, please inform us by mail. To keep yourself informed about new versions, please subscribe to our mailing list. This software is published under the LGPL (GNU Lesser General Public License).

OCL for Java

If you want to try OCL on real java code, do the following:
  1. Download dresden-ocl-injector.jar and royloy.jar into a directory.
    Problems when downloading with netscape? Select "Save Link As.." in the context menu, instead of just clicking the link.
  2. Change into that directory.
  3. Unzip the example java code in royloy.jar:
    jar -xf royloy.jar
    
  4. Compile the example:
    javac -classpath dresden-ocl-injector.jar tudresden/ocl/test/royloy/*.java
    
  5. Run the example:
    java -cp .:dresden-ocl-injector.jar tudresden.ocl.test.TestInjectionRoyloy
    
    Nothing happens. The example code runs through without complaining.
  6. Compile the example ocl expressions and put them into the java code:
    java -jar dresden-ocl-injector.jar -r tudresden.ocl.test.royloy --modify tudresden/ocl/test/royloy/*.java
    
    The example java code has now been modified.
  7. Compile the example again:
    javac -classpath dresden-ocl-injector.jar tudresden/ocl/test/royloy/*.java
    
  8. Run the example again:
    java -cp .:dresden-ocl-injector.jar tudresden.ocl.test.TestInjectionRoyloy
    
    This time something happens. Enjoy the messages about violated ocl constraints.
  9. Clean the code:
    java -jar dresden-ocl-injector.jar --clean --modify tudresden/ocl/test/royloy/*.java
    
    The example code is now exactly the same as you downloaded it.
Of course you may try this on your own java code.

compiler demo application

If you want to use the ocl compiler demo application, do the following:
  1. Download dresden-ocl-demo.jar and xerces.jar into a directory.
    Problems when downloading with netscape? Select "Save Link As.." in the context menu, instead of just clicking the link.
  2. Change into that directory.
  3. Type
    java -jar dresden-ocl-demo.jar
    at the command prompt.
  4. A window pops up. There you can enter constraints, check them against a model and generate java code.

Argo/UML

If you want to use the ocl compiler as part of Argo/UML version 0.8 do the following:
  1. Download ocl-argo.jar (a subset of dresden-ocl.jar).
    Problems when downloading with netscape? Select "Save Link As.." in the context menu, instead of just clicking the link.
  2. Replace the current ocl-argo.jar in your Argo/UML installation with this file.
  3. Restart Argo/UML.

Use the tab "Constraints" in the lower section of the Argo/UML main window.

OCL for SQL

If you want to use the OCL2SQL tool prototype, do the following:
  1. Download dresden-ocl-sql.jar and xerces.jar into a directory.
    Problems when downloading with netscape? Select "Save Link As.." in the context menu, instead of just clicking the link.
  2. Change into that directory.
  3. Type
    java -jar dresden-ocl-sql.jar
    at the command prompt.
  4. A window pops up. There you can load an XMI source file with model information, enter OCL constraints and generate according table schemas, object views, integrity views (SQL) and trigger templates as specified.
The OCL2SQL has been developed by Sten Loecher. Contact him to ask tool specific questions. You can find more information about the purpose of the tool in the paper "OCL as a Specification Language for Business Rules in Data Base Applications" (see papers).

Alternativly to the OCL2SQL tool, the jar also contains a SQL test application which was used during the development of the SQL code generator. The test application makes use of the compiler demo application. You can run the SQL test application by typing at the command prompt:

java -classpath .:dresden-ocl-sql.jar tudresden/ocl/SQLTestApp

sources

The complete source including test suites is available in dresden-ocl-src.tar.gz.
For compiling, you need: The ultimate source of the newest version is the cvs repository at sourceforge.
The API documentation is available for download or for reading online.