NSDocument 与 sqlite 记录

发布于 2024-09-14 04:46:11 字数 467 浏览 8 评论 0原文

我正在开发一个可可应用程序,可用于管理小型企业中的客户和员工详细信息。

当我通读 NSDocument 架构时,我相信它为您提供的文档/窗口管理和工作流程非常出色,但是我试图弄清楚该架构如何适应(如果有的话)应用程序从数据库中读取每条记录,而不是从单个文件中读取。

我认为我可以“捏造”工作流程中的一些基于文件的操作来读取单个数据库行而不是文件,但我想知道这是否会在以后困扰我。

我是否最好放弃 NSDocument 路径并构建自己的窗口和文档控制器?有什么想法吗?

同样,可可世界中是否有描述“应用程序设计”的书籍? Hillegaas 的书在描述自下而上的方法方面非常出色,但如果能够获得一些有关设计/构建真实世界的复杂应用程序的指导,那就太好了(对于那些具有 Eclipse RCP 经验的人,有一本很棒的书,名为“Eclipse富客户端平台:设计、编码和打包 Java 应用程序”——对于 Cocoa 来说类似的东西就太棒了)。那里有类似的东西吗?

I'm developing a cocoa application that could be used to manage customer and employee details in a small business.

When I read through the NSDocument architecture, I believe that the document/window management and workflow it gives you is excellent, however I am trying to figure out how that architecture fits into (if at all) an application that reads each record from a database, instead of from individual files.

I think I could "fudge" some of the file-based operations in the workflow to read individual database rows instead of files, but I wonder if that is going to bite me later on.

Am I better off just ditching the NSDocument path and building my own Window- and Document-Controllers? Any thoughts?

Along the same lines, are there any books that describe "application design" in the cocoa world? The Hillegaas book is outstanding for describing the bottom-up approach, but it would be nice to get some guidance about designing/building real-world, complex apps (for those of you with Eclipse RCP experience, there is a great book called "Eclipse Rich Client Platform: Designing, Coding, and Packaging Java Applications" - something like that for Cocoa would be awesome). Anything out there like that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愚人国度 2024-09-21 04:46:11

您可以让您的应用程序由一个 sqlite 数据库支持,也可以将所有记录存储在一个文件中。

基于 NSDocument 的应用程序适用于应用程序读取/编辑/创建文件的情况。此类应用程序包括文本编辑器、图像编辑器、pdf 查看器等。

如果你希望你的用户能够创建/编辑/删除你创建的数据库,并且可能在他们的计算机上保留几个不同的数据库,NSDocument 可以让这变得超级方便。

如果您的目的是让用户访问一个数据库,并在其中添加/删除记录,那么您不想为 NSDocument 操心。

You could either have your application backed by one sqlite database or store all the records in a file.

NSDocument-based applications are for when your application reads/edits/creates a file. Applications like this include text editors, image editors, pdf viewers, that sort of thing.

If you wanted your users to be able to create/edit/delete the databases you create and perhaps keep several different databases on their computer, NSDocument makes that super convenient.

If your intent is to give your users access to one single database that they an add/remove records to, you don't want to bother with NSDocument.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文