Lightweight engine

1. Preface

    Dynamic model is a lightweight programming method. The engine X-Meta used to interpret and execute models is also very small and can be embedded in your system.

    Since XWorker's model library is usually heavy (large), in order to avoid misunderstanding that dynamic model is also heavy, I will explain it in this article.

2. Dynamic model usage stage

    There are two main stages in using dynamic model.

  • Packaging and use of functions
    Encapsulate a functional model into a model, and then use it through the model. This stage is still lightweight.
      
  • Accumulation and iteration phase
    Integrate various things through models, and continuously iterate and develop on this basis. This phase is heavy.

    XWorker is also written using dynamic models. Because of continuous accumulation, it looks relatively large. But if you embed the dynamic model into your system and just reference some model libraries, it is still relatively lightweight.

3. Example

    The following example is an example of dynamic model programming. There is no reference to the XWorker model library here, only the dynamic model engine is referenced. You can see that the project is not large. The following is a running video of the example after packaging.

3.1. Project code

    HelloWorld.zip(319KB).

4. Summary

    In short, if you think the XWorker model library is not well defined, you can actually redefine it.

    Models are usually encapsulations of existing functional interfaces. Different experiences and usage habits will lead to different defined models, but different models of the same function can actually coexist.

    I hope you can define your own model library, or join XWorker to improve the model library.

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