Explain the XMI development UML diagram technology in Oracle

XML is a machine-oriented data format. Although it is difficult to write by hand, it is highly efficient. When XML (Extensible Markup Language) was introduced to the software industry in February 1998, it brought a storm to the industry. For the first time in history, the world has a versatile and adaptable format for structured documents and data that can be used not only for WEB but also anywhere.

UML modeling visually represents the business process flow and the interaction between software and data components by using charts. Standard UML diagrams include class diagrams, use case diagrams, status diagrams, activity diagrams, collaboration diagrams, sequence diagrams, and deployment diagrams.

XML Metadata Exchange (XMI), another OMG specification designed to simplify data integration, is a popular format for representing UML objects; UML diagrams can be stored in XMI format; instead, UML diagrams can also be created from XMI files. . To this end, XMI simplifies the transfer of UML chart data, and many UML tools support this switching function.

In this article, we will generate an XMI document with a sample EnterpriseJavaBean (EJB) deployment descriptor ejb-jar.xml.

If you don't have a tool to automatically store UML diagrams in XMI format, you can use XSLT to generate XMI documents. The XMI document created by the sample deployment descriptor displays a UML class diagram; this diagram will represent the analysis view of the deployment descriptor EJB. Paper detection, OracleJDeveloper. Paper detection, OracleJDeveloper. The XMI document will be converted to a UML chart in JDeveloper 10g.

Preparatory setting

The oracle.xml.parser.v2.oraxsl class is required to generate XMI documents from XML documents. First, download the Oracle XML Developer's Kit (XDK) and add XDK10g/lib/xmlparserv2.jar to the Classpath. "XDK10g" is the directory where the XDK is installed. Then, download and install JDeveloper 10g.

2. Generate UML class diagrams

As mentioned above, UML class diagrams show different entities in a class. In this section, we will create an XMI file for a UML class diagram using the sample EJB deployment descriptor.

Example of a container-managed persistence (CMP) entity EJB The ejb-jar.xml deployment descriptor specifies different fields and query methods in an EJB class. The UML class diagram created by ejb-jar.xml will display the different properties and methods in the EJB Bean class and EJB interface. Analysis View The UML class diagram contains a rectangle with three horizontal areas. The upper area shows the class name, the middle area shows the class attributes corresponding to the fields in the EJB, and the lower area shows the methods in the EJB bean class and EJB interface. An example class diagram is shown in Figure 1.

Explain the XMI development UML diagram technology in Oracle

Figure 1 UML class diagram

The XMI representation in a UML class diagram contains XML elements and attributes that correspond to the classes, properties, and operations in the UML class diagram. The following table lists some of the elements of an XMI document.

Element application common properties

The root element of the XMIXMI document xmi.version=“1.2” xmlns:UML=”org.omg.xmi.namespace.UML”

XMI.content contains the actual data transferred

XMI.header stands for XMI documentation

UML.Model stands for UML model xmi.id, isSpecificaTIon, name, isRoot, isLeaf, isAbstract

UML: Namespace.ownedElement contains UML:Class, UML:Attribute, UML:OperaTIon, UML:Package, and UNL:Stereotype elements

UML:Class stands for UML class xmi.id, visibility, isSpecificaTIon, isRoot, isLeaf, isAbstract, isAcTIve, name

UML: Attribute stands for UML class attribute xmi.id, visibility, isSpecification, ownerScope, name, type

UML:Operation represents the UML class chart method xmi: id, name, Visibility, isSpecification, ownerScope, isQuery, concurrency, isRoot, isLeaf, isAbstract

UML:Parameter represents the method parameters xmi: id, name, isSpecification, kind

UML: Package represents a class chart package xmi: id, name, visibility, isAbstract, isRoot, isLeaf

UML: Stereotype (not currently supported by JDeveloper) represents a class diagram template (eg "entity") xmi.id, name, visibility, isSpecification, isRoot, isLeaf, isAbstract

3. Generate an XMI file

Create an XSLT to convert the sample XML document into an XMI file containing the elements of the UML class diagram in the XMI and UML namespaces. Create a XSLT by selecting File New in JDeveloper. In the New Gallery frame that appears, select General XML and then select XSLT Stylesheet from the listed items. Paper detection, OracleJDeveloper. In this example, the sample XML document ejb-jar.xml is converted to an XMI document UMLAnalysisView.xmi via an XSLT file called UMLAnalysisView.xslt. In the example ejb-jar.xml, all CMP fields are of type String. If some fields are not of type String, then the XSLT needs to be modified. The oraxsl utility is used for XSLT transformations.

》java oracle.xml.parser.v2.oraxsl ejb-jar.xml

UMLAnalysisView.xslt UMLAnalysisView.xmi

All three files are provided in the sample code.

4. Display UML class diagrams in JDeveloper 10g

In this section, we will import the XMI document into JDeveloper to generate an analysis view class diagram. First, start JDeveloper 10g and create a project, as shown in Figure 2.

Open the XMI document by selecting File > New as shown in Figure 3.

Explain the XMI development UML diagram technology in Oracle

Figure 2 Creating a JDeveloper project Figure 3 Opening an XML document

In the displayed frame, select General "Diagrams" UML Class Diagrams from XMIImport, as shown in Figure 4. Select the XMI document (UMLAnalysisView.xmi) from which we want to create our UML class diagram.

Explain the XMI development UML diagram technology in Oracle

Figure 4 Select UML Class Diagram from XMI Import

Then add a node called ClassDiagram for XMI Import to the UMLAnalysisView.xmi document in the Applications-Navigator framework, as shown in Figure 5. Paper detection, OracleJDeveloper.

Explain the XMI development UML diagram technology in Oracle

Figure 5 Class Diagram XMI Import node

To display the UML class diagram, as shown in Figure 6, right click on the Class Diagram XMIImport and select Open.

Explain the XMI development UML diagram technology in Oracle

Figure 6 Open ClassDiagram XMI Import

The UML class diagram corresponding to UMLAnalysisView.xmiXMI will then be displayed, as shown in Figure 7.

Explain the XMI development UML diagram technology in Oracle

Figure 7 UML class diagram in JDeveloper

The upper area of ​​the class diagram contains the class name. Paper detection, OracleJDeveloper. The middle area contains class attributes that correspond to the cmp fields in ejb-jar.xml. The data type of the attribute is also specified. The bottom area contains class operations that correspond to the create, finder, getter, and setter methods in the EJB bean classes and interfaces. The class operation contains the return type of the method. Analysis view class diagrams may also contain other features such as ejbSelect and various business methods. Paper detection, OracleJDeveloper.

5 Conclusion

As you can see, the XMI format makes it very convenient to transfer UML chart metadata used to reconstruct UML diagrams. If you don't have a UML tool to import a UML diagram into an XMI document, you can create an XMI document directly from the XML document.

Connectors System

We cover many types of Connectors for industrial, electrical and automotive, such as IP68 and waterproof connectors, OBD diagnostic connectors, also the standard or custom-designed power connectors for MINI FIT, MICRO FIT, MATE-N-LOCK.


We can support customers to copy some original componenst for local/equivalent connecotors by considering short L/T and competitive price. Also it's workable to offer solutions for unique and customized connectors by overmold tooling with low cost.

Connectors System,Board System Connector,Efi System Injector Connector,Efi System Car Connector

ETOP WIREHARNESS LIMITED , https://www.wireharnessetop.com

Posted on