wpf 应用程序、sql 数据库或 xml 的推荐内容
我想构建一个 wpf 应用程序(使用 mvvm dp),并且需要管理客户列表(最多 200 个客户) 建议的处理方法是什么? sql(mySql、sqlServer)或其他方式(xml、excel、access)?
我可以看到 xml 的优势,因为它不需要额外安装
I want to build a wpf app (with mvvm dp) and I need to manage a list of customers (200 customers maximum)
What is the recommended way to handle this? sql (mySql, sqlServer) or other way (xml, excel, access)?
I can see advantage in xml because its not required addition installation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在不同的计算机上有多个用户,并且这些计算机具有持久的共享网络连接(例如,它们位于同一网络上),那么您应该更喜欢使用中央数据库,例如(正如您提到的) SQL Server 或 MySQL。后者是免费的,前者提供免费版本 (Express) 适用于轻量工作负载。
如果您不需要在应用程序的不同用户之间共享数据(您不介意他们的客户数据是否不同步),那么请考虑轻量级嵌入式数据库,例如 SQLite 或 SQL Server精简版。非常简单且易于设置和维护,但数据保留在一台机器上。
您可以围绕不同机器之间的手动同步构建一个基础设施,有点像每当您插入 iPhone 时 iTunes 如何在您的计算机和 iPhone 之间同步数据,但相信我,如果可能的话,最好避免这些工作。数据库有很多内置的多用户同时做事的逻辑,如果可能的话,您希望利用它们。
If you've got multiple users on different machines, and those machines have a persistent, shared network connection (they're on the same network, for instance), then you should prefer to use a central database, like (as you mention) SQL Server or MySQL. The latter is free, and the former is available in a free edition (Express) for light workloads.
If you don't need to share data between the different users of your application (you don't mind if their customer data get out of sync), then look at lightweight, embedded databases, like SQLite or SQL Server Compact Edition. Very simple and easy to set up and maintain, but the data stays present on a single machine.
You could build an infrastructure around manual synchronization between the different machines, sort of like how iTunes synchronizes data between your computer and iPhone whenever you plug the latter in, but trust me, that's a lot of work that's best avoided if possible. Databases have a lot of built-in multiple-users-doing-stuff-at-the-same-time logic that you want to leverage if at all possible.
如果您唯一需要保留的是包含 200 个项目的列表并且您认为将来不会有任何其他持久数据需求,那么我会说平面文件就足够了。但是,这也取决于检索小数据的频率。
我是 SQL Server 的坚定支持者,而且 Express 是免费的。但你不想过度设计这个问题。除非我误解了你的问题,否则这就是我的评价。
If the only thing you need to persist is a list of 200the items and you don't see there as being any other persistent data requirements in the future, I would say that a flat file is plenty. However, this also depends on how often that small data will be retrieved.
I am a huge proponent of SQL Server, and Express is free. But you don't want to overengineer the problem. Unless I misunderstood your question, that is my evaluation.