Various functions can be packaged into models and integrated through the models. Here are some core methods of encapsulating models.
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.
Basic models generally define various frameworks for flexibility and for third parties to participate in model construction.
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.
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号