ios - About usage CoreData: relationships or id -
i have quick question appropriate usage of framework coredata.
introduction: have application few uitableviewcontrollers offering different entities.
1 - list of events - entity "responseeventsitem"
every event had interrelated records:
- spakers (entity "responseeventsspeakersitem") - every record has 1 parent - responseeventsitem
- locations (entity "responseeventsspeakersitem") - every record has 1 parent - responseeventsitem
- schedule (entity "responseeventsspeakersitem") - every record has 1 parent - responseeventsitem, , other related records: responsespeakersitem and/or responselocationsitem
- sponsors (entity "responseeventssponsorsitem") - every record has 1 parent - responseeventsitem
2 - town (entity "responsecityaboutitem")
3 - attractions (entity "responsesightsitem")
4 - hotels (entity "responsehotelsitem") - can related responsebonusesitem
5 - fastfood (entity "responsefoodsitem") - can related responsebonusesitem
6 - entertainment (entity "responseentertainmentsitem") - can related responsebonusesitem
7 - special offers (entity "responsebonusesitem") - record related "responseeventsitem" , ("responsehotelsitem" or "responsefoodsitem")
question: best way use framework coredata?
1 - create single storage (store nspersistentstore) , load , establish connections based on relationship of cores (for instance, relationships to-many responseeventsitem.locations -> [responselocationsitem] )
or
2 - or create individual storage of each separate core ( in particular case not able use relationships because relationships exist within 1 given storage) , make sure selection of interrelated data done through id, in regular sql data base (mysql example).
when asking best way, mean efficient , common way (quickest response time)? there chance storage overload in case if data located in 1 storage?
the short answer: option 1
typically, use 1 nspersistentstore manage of these entities , relationships. also, easiest approach well.
Comments
Post a Comment