使用 DB 或本地文件的 POS 桌面应用程序?使用WPF
我计划为我的商店构建一个 POS 应用程序。我有足够的知识来使用数据库构建应用程序,并使用本地文件(system.IO - 二进制文件)来存储和访问我的应用程序的数据。但是,我没有部署经验,并且在选择数据存储选项时感到困惑。
使用 MDF 的数据库可能是一个不错的选择(可以简化大量编码),但我不想在我的桌面上安装 SQL Server。由于我使用 WPF 进行构建,我担心我的应用程序可能会由于 WPF 的服务器响应和设计渲染而变慢。
然后我尝试仅使用本地数据(二进制文件)来存储数据并使用类和对象进行检索。但是这个编码需要花费很多时间,所以在这个过程中我陷入了返回数据库的困境。请帮忙,就性能而言哪个更好。在实际世界中,在广泛使用的专业应用中..请提出建议..
I am planning to build a POS Application for my shop. I have enough knowledge to build the application using DB and also using local files( system.IO - binary files ) to store and access the data for my application. But , i have no deployment experience and confused in choosing data storing option.
Database using MDF may be good option ( may ease plenty of coding ) but i don't want to have SQL server on my desktop. as i am using WPF for building , my concern is that my application may get slow due to server response and design rendering of WPF.
Then i tried to use only local data (binary files) to store the data and retrive using class and objects. but this coding is taking lot of time , so in the middle of the process i struck in the dilemma of going back to Database . Please help , for performance wise whic one is better . and in Practical World ,in professional applications which one is widely using .. please give suggestions ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您不想使用 SQL Server 或 SQL Server Express,您可以认真查看 SQL Server Compact,它非常轻量但功能相当强大。就性能而言,您应该不会有任何问题,但这最终取决于您的编码方式:-)以及您将在数据库中存储多少项。
If you don't want to use SQL Server nor SQL Server Express, you could have a serious look at SQL Server Compact, it's very lightweight but quite powerful. In terms of performance, you should not have any problem, but that ultimately depends on how you code :-) and how many items you will store in the database.
您还可以使用 SQLite。它是一个广泛使用的轻量级、进程内 SQL 引擎。 ADO.Net 包装器使您可以使用几乎任何 .Net 数据访问技术来操作 SQLite 数据库文件,并且 SQLite 受到 ORM 的广泛支持。
You can also use SQLite. It is a light-weight, in-process, SQL engine with widespread use. The ADO.Net wrapper let's you manipulate SQLite database files using almost any .Net data access technology, and SQLite is widely supported by ORM's.
您在这里似乎有两个不同的问题:“我应该使用什么数据库?”是其中之一,“我应该使用数据库吗?”是另一个。
第一个问题很容易回答:对于您所描述的应用程序,SQL Server CE 几乎肯定是您想要的:一个易于部署的基于单用户客户端的数据库,易于开发,其开发工具内置于 Visual Studio 中。工作室。
第二个问题可能不太容易回答,因为在大多数情况下这取决于您的应用程序。但由于您的应用程序是一个销售点应用程序,可能会在使用时连续生成交易,因此我认为答案非常明确“使用数据库”。如果不这样做,您很快就会发现您已将“编写数据库管理系统”任务添加到您的项目计划中,并且您真的有时间这样做吗?
You seem to have two different questions here: "What database should I use?" is one, and "Should I use a database?" is another.
The first question's pretty easily answered: For the application you've described, SQL Server CE is almost certainly what you want: an easily-deployed single-user client-based database that's straightforward to develop for, and whose development tools are built into Visual Studio.
The second question's could be less easy to answer, because in most cases it depends on your application. But since yours is a point-of-sale application that will presumably be generating transactions continuously as it's used, I think the answer to that is pretty unambiguously "use a database". If you don't, you'll find very quickly that you've added the task "write a database management system" to your project plan, and do you really have time to do that?
使用文件在文件系统上存储数据是没有问题的,这就是大多数 POS 系统的工作方式,很少有 POS 系统使用数据库(至少对于快餐行业使用的 POS 系统是这样)。
对于第三方供应商来说,解析 100 种不同的格式是一件很痛苦的事情。
我会采纳上述建议并使用 SQLCE 之类的东西。
There's no problem using files to store the data on the file system, this is how most POS systems work, very few POS systems use databases (at-least this is true for POS systems used in fast food industry).
For 3rd party vendors tho it's a pain in the ass to parse 100's of different formats.
I would go with the above suggestions and use something like SQLCE.