Integration

1. Description

    Various functions can be wrapped into models and integrated through the models. Here are some core methods of encapsulating models.

2. Define the usage interface as a model

    The basic model is generally an encapsulation of various functions, usually the usage interface of these functions, so you need to have certain experience in using these functions.

3.Framework

    Basic models generally define various frameworks for flexibility and for third parties to participate in model construction.

3.1. Agreement

    The framework generally has some conventions. For example, in XWorker, the WEB model needs to implement the httpDo() method, the HTML model needs to implement the toHtml() method, the SWT model needs to implement the create() method, etc.

3.2. Index model

    The function of the index model is to centralize scattered models. The method is to inherit the distributed model through child nodes, or register the model to the index model. In this way, when the main model of the framework inherits the index model, these models can be added through child nodes in the editor.

    For example, XWorker's HTML framework has an xworker.html.Widgets model. After you write an HTML component model, you can register it under the xworker.html.Widgets model as a child, so that others can use your component model.

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