Core Data Opinion

Improve Chapters 1-4

I have read the Core Data by tutorial hopping to find a definite solution to the problem of finding a clear book in the topic.

here is my first impression:

a. The begin is good trying to implement the big picture of Core Data directly with an example.

b. But, in the next chapters gets a liitle bit confusing because it tells first will be explained the hardway despite exists the easy way. I expected that at some point the easy way will be shown but it never came. Instead the chapters continue to other fetching topics.

c. DataModel Editor. Would be really helpfull to explain further the Editor

d. The CoreData Stack. I will read it again. I got a little bit confused by all the code needed first to setup the tableViewController and before actually using CoreData.

e. The Easy Way. How to use efficiently the code automatically generated by Xcode with a balance on effort dedicated to explain the hard way.

f. The core for a newbie is only in my opinion wants to know: 1. Learn the Data Model Editor, 2. How to Save. 3. How to Fetch. 4. Advanced Fetching. With this clear would be solid base to continue to versioning, unit testing and the other interesting and helpuful topics the books has.

In summary I will do my dueDiligence reading it again but maybe the first 4 chapters could be improved for next book releases.

Despite my comments you are doing a great job filling the gaps for newbies like me and you are the best source of tutorials and books i have found

good job

Best Regards.

HC

@hcastellanos22 Thanks very much for your question, and my apologies for the delay in responding to you. To answer your questions:

A. Good to hear!

B. With respect to the “difficult” vs “easy” components, some of the sections may look difficult, but that is because the author can’t introduce multiple topics at once in a single chapter. For example, showing how to add properties to a Managed Object subclass is much easier, but then without creating subclasses, but this unfortunately is a topic of discussion that is discussed in a later chapter. So rather than confuse the user by bombarding them with multiple concepts at once, the user is gradually introduced to these topics one at a time, and in the process, yes, some concepts initially may be more difficult than they need to be. Another reason to consider why “difficult” approaches are introduced to the user before the “easy” one’s is so that the user can appreciate the “easy” approach that is available for them to use, as well as show the user an alternative approach, and then let the user decide what works best for them. What may be easy for some, may not be for others. :slight_smile:

C. The discussion of the DataModel editor occurs throughout the book, since it is constantly being used (it’s where you model your data so naturally it cannot be ignored), so it wouldn’t make sense to allocate a chapter solely on the Data Model. As the user develops their skills, the subsequent chapters build on the previous topics. Also understand that like most areas of iOS, you honestly can’t focus on a particular component of that topic in isolation. Core Data has multiple moving parts, and so one needs to learn how they all work together at the same time, albeit gradually. You can’t teach, A by itself, then B, then C, then D, and then show how A,B,C,D all fit together. I hope this makes sense.

D. This topic is very important, but understand that the point of the Core Data Stack is to initialize Core Data so that you can use the appropriate components throughout the app. The Core Data Stack should run once at the beginning when your app first launches, and that’s it. The reason why UITableViews are important, especially with Core Data, is that Core Data has very nice tools that allow to nicely integrate with UITableViews (i.e. NSFetchedResultsController). Thus, you can’t teach it, without the use of UITableViews. Even without the use of NSFetchedResultsController, the UITableView is one of the best ways to display a list of items, and therefore this becomes a necessity to demonstrate certain concepts in Core Data.

E. By “easy way” I believe you are referring to the topic of Managed Object Subclasses. This approach should be the way users work with entities, and properties in Core Data, and this is why a chapter is dedicated to it, as well as use this approach throughout the book. More emphasis is given later on to the “easy way” (i.e. Managed Object Subclasses) because they are more practical, and the user can do much more with this approach. It wouldn’t make sense to discuss both “easy” and “difficult” equally, when one is the more ideal solution.

F. Everything you listed here is covered, and much more! :slight_smile: In some cases, you may find that you need more clarity on certain topics, and that’s ok. This is what the point of the forums are! The point of the book is to give the user a good hands on approach to teach the subject of Core Data, and then with this knowledge, the user can then apply these concepts to their own projects. By all means, if there is something you want to explore further, then come to the forums and ask your questions!

I hope this helps. :slight_smile:

All the best!