Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693120
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:20:26+00:00 2026-05-19T04:20:26+00:00

I am new to core data. I am banging my head on the wall

  • 0

I am new to core data. I am banging my head on the wall trying to understand how should I design the data model for this application.

I have to create a database for books.

Books have the following characteristics:
.englishName
.italianName
.frenchName
.spanishName
.number

Books can be of two kind: free or non-free.
Books can be sold individually or in bundles.
A bundle can represent a bunch of books.
A book can be in one or more bundles.

What I need:

  1. The ability to mark as paid a
    bundle or/and book.
  2. the ability to retrieve all non-free or all free
    books, all books from a bundle, all
    books that were bought.

How I imagine this could be done: I would create 3 entities: Bundle, Product and Type and make all products bundles, I mean, a bundle with 1 product or with multiple products.

Bundle
.Number
.Paid
-relation to product (fromBundle) to-many


Product
.nameEN
.nameIT
.nameFR
.nameSP
.Number
-fromBundle (relation to Bundle) to-many
-fromType (relation to Type)


Type
.kind
-relation to Product... to-many

But I am not sure this is not the way, simply because there’s no way to define a bundle name in all 4 languages and if I add those attributes to the bundle, I will end with a lot of redundancy…

please help meeeeeee! thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:20:26+00:00Added an answer on May 19, 2026 at 4:20 am

    You may be overcomplicating this by introducing Product and Type – all you should really need are the Book and Bundle entities, with a many-to-many relationship between them. Then, to deal with the use cases you presented:

    1. Marking a bundle or book paid: for a book, simply mark the book paid; for a bundle, mark all its books paid.
    2. For data retrieval:
      • To retrieve all non-free or all free books, just get instances of the Book entity with the free attribute set to the appropriate value (or the price value zero or nonzero, depending on how you’re storing this attribute)
      • To retrieve all books from a given bundle, just call [bundle books] – the many-to-many relationship gives you this directly
      • To retrieve all books that were bought, just look for books marked paid

    This way, you can keep your four name attributes on the Book itself and not worry about them (unless you have to name Bundles, but those should be distinct names anyway). Furthermore, it’s conceptually simple – you don’t have to worry about what precisely constitutes a Product or semantics of that manner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a tabbed application with core data persistence. when i create a new
With this version of an iPhone app, I'm trying to create a new core
I'm pretty new to Core Data, and I'm trying to wrap my head around
I am trying to create a new Core Data entity and copy [some of]
I'm using the new iOS 5 core data concurrency options. I have two threads:
I am new to Core Data and trying to think of the simplest and
So I'm fairly new to Core Data and KVO, but I have an NSManagedObject
I'm fairly new to the more complex parts of Core Data. My application has
I'm new to IPhone development and I'm currently trying my hand at Core Data.
I am new to Core Data. I have noticed that collection types are not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.