Model Library

1. Package model library

1.1.Jar file

    The model can be released together with Java, usually packaged into a jar file.

1.2.dml file

    A .dml file is set in the root directory of the jar file, and the name of the model library is set in the .dml file.

    Such as:


    The workingSet attribute is optional, and it is used in the model editor to put the model library under the working group by default.

    Optional. If this file exists in the root directory of the jar, the zip will be decompressed to the root directory of xworker when XWorker is initialized (XWorkerUtils.setup()).


    Optional. The file is text, and one line is the path to an action model. If the file exists, related actions will be performed when XWorker is initialized (XWorkerUtils.setup()).

2. Import model library

     The model library is also an ordinary Java library, which can be directly used after being imported into the project.

3. How to write a model library

  • Encapsulation using interfaces
    A model is generally an encapsulation of the usage interfaces of various functional modules. It is generally recommended that the core of the functional module be written in Java, and how to use the interface of the functional module to package it into a model. The use of interfaces can be simply regarded as the configuration of functional modules.
  • Can be packaged into multiple models
    A functional module can be used in various ways, so a functional module can also be encapsulated into multiple models. Just like a Java class library can be encapsulated into multiple model libraries, they can also be used together very well.
  • Extensible framework
    With the support of XWorker's model registration function, it is generally recommended to encapsulate functional modules into an extensible framework, and third parties can also easily extend the model.
  • Knowledge and experience
    With the support of XWorker's model registration function, third parties can also write documents, examples, and tools for functional modules, and help write models through documents, examples, and tools.

    Because the model is generally the encapsulation of the interface of the functional module, which requires rich experience in the use of the corresponding functional module, XWorker hopes that you who have experience can write and improve the model library together.

4.XWorker model library

4.1. Source code

    The source code of XWorker was published on Gitee, /xworker/.

4.2. Maven

    The official version of the XWorker model library can be viewed on the Maven warehouse, see search?q=xworker.


    XWorker's SNAPSHOT version of the model library is published on Sonatype. If you want to use the SNAPSHOT version of the dependency, you can add the following settings to maven.

             <name>sonatype Repository</name>

5. Model library dependency tools

    You can open XWorker's Online Model Library Dependency Tool, which may not be updated in time ,for reference only.



Copyright ©  2007-2019  版权所有  沪ICP备08000575号