Document-based application, or not?

感情迁移 提交于 2019-12-03 17:22:56

Think about your problem domain. What would a "document" model? A dance academy? If so, and you think that your users will only be managing one academy, then the document-based model is unnecessary. On the other hand if you think that a document represents a teacher, then it's likely one academy manager will want to deal with multiple teachers so the document model seems appropriate.

The key question is one of independence. If all of the objects in your application's model are related then there's no need to manage independent documents. If, on the other hand, there is a loose collection of objects which each have their own set of related "children", then this seems like a collection of documents. This is why a word processor is document-based: the text, attributes and images in one file is unrelated to those in another file, so it makes sense to treat them as independent documents.

If you see benefit to go to NSDocument-based, go for it. The reason I say this is because if there is a lot of text writing/reading, then it should be a good choice.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!