Welcome to XWorker. XWorker provides some model libraries for dynamic models. These model libraries generally encapsulate various Java class libraries or functions. The purpose of using these model libraries is to achieve rapid programming.

    XWorker is open source, the code is on gitee and github, https://gitee.com/ xworker/xworker, https://github.com/x-meta/xworker .

Dynamic model

1. Introduction

    Dynamic model is a model-based object-oriented programming method, in which the model can be represented by XML, etc.

    For example, the following XML is a model program, and each node of this XML is an object. You can click here to run the model. After running, a window will open with a browser that displays the XWorker homepage.

<?xml version="1.0" encoding="utf-8"?>

<Shell name="shell" text="Hello World!" descriptors="xworker.swt.widgets.Shell"
  width="800" height="600">
    <FillLayout name="FillLayout"></FillLayout>
    <Browser name="Browser" url="https://www.xworker.org"></Browser>

2. Features

  • Real-time programming
    The dynamic model itself is an abstract programming method that needs to be implemented and run in other languages. The dynamic model cannot be programmed in real time from the beginning, but when the model becomes more and more abundant, it can realize real-time programming, and eventually you will find that real-time programming is a major programming method using dynamic models.
  • Quick programming
    Models are structured data, which can be analyzed or written by various tools to process the model. Fast programming can be achieved through tools and real-time programming.
  • Save knowledge
    Models are structured data, which can be used not only for programming, but also for storing knowledge.  

3. Basic concepts

    The dynamic model is not complicated but may be a little abstract. The basic concepts are as follows.

  • Model: A model is an object. A model is composed of attributes and sub-models, and the model is a tree structure of data.
  • Actions: Dynamic models believe that any model can be transformed into actions, and actions are equivalent to methods and functions and can be executed.
  • Behavior: A model can take certain sub-models as its behavior.
  • Class: A model can use any model as its own class to inherit its behavior.
  • Inheritance: A model can inherit any other model, thus inheriting their behavior.     

    To implement a dynamic model, you need to implement a method that transforms the model into actions and can be executed. The principle of implementation is as follows.

  1. Any model can be transformed into an action, and when executed as an action, the behavior of the model object named run is executed.
  2. The behavior of an object is also a model, so the behavior of an object named run is also a model. To execute the behavior named run, go back to step 1.
  3.  The above is an iterative process. If the iteration is to be terminated, some models should be executed by a meta-system to explain the execution.

    The meta-system refers to the system that implements the dynamic model. For example, the dynamic model engine used by XWorker is written in Java, and Java is its meta-system.

5. Example

    The 33-second video below shows how to write and run the above browser example model in the model editor.

    For more information about dynamic models and XWorker, please refer to the tutorial, and more For multiple examples, please refer to https://gitee.com/xworker/apps.

Join us

    XWorker is a platform based on the Apache2.0 open source protocol, XWorker looks forward to your participation, please join us to improve it, QQ group: 312989786. x-meta




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