关于如何组织 Core Data 视觉布局的建议?
Core Data
非常令人惊奇,我真的很喜欢使用 Xcode 提供的视觉布局
来组织事物并快速获取我放置的数据的示例。然而,有时我开始怀疑自己是否充分利用了它,因为一段时间后,箭头往往会变得如此多,以至于很难判断什么要去哪里。
我试图通过
- 将类似的对象分组在一起、
- 将抽象对象/父母与他们的孩子放在树上
- 等来
将其保持在最低限度,但混乱似乎是不可避免的。
您采用哪些方法来保持其最佳的组织性和可读性?
Core Data
is pretty amazing, and I've really enjoyed using the visual layout
Xcode provides for it to organize things and get a quick sample of what data I've placed where. At times I've started to wonder if I'm making the best use of it, however, as after a while there tends to be such a mass of arrows that it becomes difficult to tell what's going where.
I try to keep this to a minimum by
- grouping like objects together,
- abstract objects/parents in trees with their children,
- etc.
but the clutter seems inevitable.
What are some ways you employ to keep it optimally organized and readable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这在一般意义上很难回答。我认为这很重要,您认真考虑这一点是正确的。我倾向于痴迷于事物的视觉排列,因为我发现它对我的感知和对我自己图式的持续理解有着深远的影响。 Xcode 的数据建模器本质上是一个模式设计和设计文档工具。
我努力尽可能地划分我自己的设计。例如,如果您考虑类似 iTunes 的情况,您可能有一个控制器管理库源列表选择(一个简单的示例是播放列表),另一个控制器管理所选播放列表的成员。在该模式中,可能有几个“库相关”实体和几个“播放列表相关”实体,并且肯定有几个“歌曲相关”实体(专辑、艺术家和歌曲/曲目)。我会将与歌曲相关的内容紧密地组合在一起,以很好地排列关系线的方式,但这使这些实体在视觉上与播放列表和库相关的项目通过空间分开。
换句话说,如果您将相关项目放在明确定义的逻辑集群中,并用漂亮的空格分隔,并以与组织控制器相同的方式进行组织,那么概念就会保持相当清晰。
另一个问题是 Xcode 关系线的自动放置。不幸的是,我们无能为力让这些变得整洁。众所周知,我会花费(出于尴尬而编辑的实际时间)担心如何平衡清晰描述的关系与清晰描述的相互关联实体的集群。
祝你好运,快乐强迫症! :-)
This is difficult to answer in a general sense. I think it's important and you're right to give this some good consideration. I tend to obsess over the visual arrangement of things myself as I find it has a profound affect on my perception and ongoing understanding of my own schema. Xcode's data modeler is essentially a schema design and design documentation tool.
I strive to compartmentalize my own designs as much as possible. For example, if you consider an iTunes-like case, you might have a controller managing the library source list selection (a playlist, for a simple example), and another managing the members of the selected playlist. In the schema, there may be several "library-related" entities and several "playlist-related" entities, and there are definitely several "song-related" entities (album, artist, and song/track). I'd group the song-related stuff tightly together in a way that nicely arranges the relationship lines, but that keeps these entities visually separated by space from playlist- and library-related items.
In other words, if you keep related items together in clearly-defined logical clusters, separated by nice whitespace, organized in the same way you'd organize your controllers, the concepts are kept fairly clear.
The other problem is Xcode's automatic placement of the relationship lines. Unfortunately, there's little we can do about making those neat. I've been known to spend (actual time redacted out of embarrassment) worrying over balancing clearly-depicted relationships with clearly-depicted clusters of interrelated entities.
Good luck and happy OCD! :-)
这是更好的建议。
http://www.sebastianrehnby.com/blog/ 2013/01/15/structuring-an-ios-project/
另外,服务模块、帮助程序模块(您的应用程序实用程序类)
services - (调用外部服务,例如后端服务器、DBOject 服务)
另外,这个
http://www.slideshare.net/MassimoOliviero/architecting-ios-project
here's better suggestion.
http://www.sebastianrehnby.com/blog/2013/01/15/structuring-an-ios-project/
Additionally, Services module, Helper module(your app utility classes)
services - (calling external services like your back-end server, DBOject services)
Also, this one
http://www.slideshare.net/MassimoOliviero/architecting-ios-project