Interpretation of source code by Java-to-Service-Model transformations

The software services model elements that the transformation generates depend on the characteristics of the Java code that you specify as the source of the transformation. If the transformation cannot transform a Java element, it ignores the element.
The following table lists how the transformation transforms Java elements into UML elements in a software services model.
Java element Transformation output
Package The transformation generates a package that has the fully qualified name of the package that contains the Java elements to transform.
Consider the following Java code fragment:
packageB.packageC;

ClassAlpha{
}
The transformation generates the following UML representation:

<package>packageB
     <package>packageC
           <class>classAlpha

Java implementation class
  • In the target model, in the corresponding package path, a UML component that has the same name as the Java implementation class, and that contains the following items:
    • A port named <Name of the Java implementation class>Port<Unique number> that has the following characteristics:
      • The Type property of the port references the Java implementation class
      • The list of provided interfaces contains the Java interface that the Java implementation class implements
    • A part whose type is set to Java implementation class
  • In the target model, in the corresponding package path, the transformation generates a UML component named <Name of the Java implementation class>Delegate. This component delegates service calls to the Java implementation in the target model. In this component, the transformation creates two ports:
    • A port whose Type property references a UML class

      The list of required interfaces contains the Java interface that this Java implementation class implements. The name of this generated port is <Name of the Java implementation class>Port<Unique number>.

    • A port whose Type property references the UML interface that the transformation generates from the Java interface

      The transformation adds the UML interface to the list of provided interfaces for the port. The name of this generated port is <Name of the UML interface>Port<Unique number>.

  • In the top level of the target model, the transformation generates a UML component that wraps the previous two components in this list.

    Depending on the target profile that you select in the transformation configuration, the transformation applies either the «Participant» stereotype from the Services Modeling (SoaML) profile or the «serviceProvider» stereotype from the deprecated Software Services profile.

    The transformation generates the following items in this component:
    • A port whose Type property references the UML interface that the transformation generates from the Java interface. For more information, see the Java interface row in this table.

      The transformation adds the UML interface to the list of provided interfaces. The name of this generated port is <Name of the UML interface>Port<Unique number>.

    • A property whose type and name correspond to the UML component that the transformation generates from the Java implementation class
    • A property whose type and name correspond to the generated UML component that delegates service calls to the Java implementation.
    • A connector between the port in this component and the port in the <Name of the Java implementation class>Delegate component. The Connector::kind property is set to Delegation.
    • A connector between one of the ports in the <Name of the Java implementation class>Delegate component and one of the ports in the Java service implementation component. The Connector::kind property is set to Assembly.
Java interface In the target model, in the corresponding path of the Java package, the transformation generates a UML interface that has the same name as the Java interface.

Depending on the target profile that you select in the transformation configuration, the transformation applies either the «ServiceInterface» stereotype from the Services Modeling (SoaML) profile or the «serviceSpecification» stereotype from the deprecated Software Services profile.

Java class The transformation transforms only the Java classes that are Parameter types in the methods of the interface that corresponds to the transformation source.

For these Java classes, in the target model, in the corresponding package path, the transformation generates a UML class that has the same name as the Java class.

The names of the Java attributes do not change in the generated UML class.

Consider the following Java class:

Package a.b.c;
Import a.d.ClassB;
Import x.a.ClassD;

Class ClassA{
   Int x;
	 String a;
	 ClassB c;
  	 ClassD d;
}

For each attribute that is of type Java class, where the class exists in the workspace, the transformation creates a UML class, as in the following example:

<package>a
   <package>b
      <package>c
         <class>ClassA
			      <attribute>x //primitive type
             <attribute>a // primitve type
             <attribute>c //ClassB type
             <attribute>d //ClassC type
   <package>d
      <class>B
   
<package>x
   <package>a
      <class>ClassD

Feedback