[英]What is the best way to create mapping from SQL database to GUI?
I think its quite usual task, but still solutions I saw look not so nice. 我认为这是很平常的任务,但是我看到的解决方案看起来仍然不太好。
For example in Qt used approach based on MVC pattern -- you must assign all connections manually. 例如,在基于MVC模式的Qt使用方法中,您必须手动分配所有连接。
Or I remember one PHP engine where pages were creating from DB schema. 或者我还记得一个PHP引擎,其中页面是根据数据库模式创建的。
Which are other approaches? 还有哪些其他方法? Which one you are prefer?
您更喜欢哪一个? What are the best practices?
最佳做法是什么?
Usually, there is not a one to one mapping from the database to the GUIThere are many subtle combinations that change between how you store the data and how that stored data is visualized and edited by the user. 通常,从数据库到GUI不存在一对一的映射。在存储数据的方式与用户可视化和编辑存储的数据的方式之间有许多微妙的组合。
however, you can automate a datamodel layer in your code with tools like Hibernate. 但是,您可以使用Hibernate之类的工具来自动化代码中的数据模型层。 You will still need to use the model as required to present your user interface.
您仍然需要根据需要使用模型来呈现用户界面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.