我正在开发一个 ZK 项目,并且有一个基于 EMF 的第三方域模型。 我需要找到一种将 ZK View 与 EMF 模型绑定(bind)的方法。但我没有找到任何相关内容。
最佳答案
EMF 是一个代码生成框架。
来自他们的网站:
Three levels of code generation are supported:
Model - provides Java interfaces and implementation classes for all the classes in the model, plus a factory and package (meta data) implementation class.
Adapters - generates implementation classes (called ItemProviders) that adapt the model classes for editing and display.
Editor - produces a properly structured editor that conforms to the recommended style for Eclipse EMF model editors and serves as a starting point from which to start customizing.
接下来是您需要实现的服务器层,以便您可以插入/保存/更新/删除您的项目。
接下来只是使用 ZK 中生成的类。
zul 只需要来自生成对象的 getter/setter。 Those are generated by EMF, as you can see in this tutorial.
ViewModel/Controller 需要服务来加载/保存您的对象。
提醒一下,ZK只是一个 GUI 框架,您使用什么模型/持久性并不重要。
关于java - 将 ZK 与 EMF 绑定(bind)(java),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33416876/