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 433779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:12:29+00:00 2026-05-12T20:12:29+00:00

I am just setting up a simple library application, basically a collection of Members

  • 0

I am just setting up a simple library application, basically a collection of “Members” and a collection of “Books”. My idea was to implement both of these as NSMutableArrays so that I could easily add and remove objects. What I would like to ask is what is the best way to implement the link between a “Member” and a “Book” when they take a book out of the library?

Initially for simplicity I was thinking of limiting each member to withdrawing only a single book at a time, but I would be interested in ideas to represent multiple book withdrawals too.

EDIT

Can I just ask if the correct way to do this would be to create a “Library” object as a top level object that holds the “Book” and “Member” collections. I was just thinking about this as otherwise these would need to be created in main() which seems a little un-object oriented.

many thanks for any help / info.

gary

  • 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-12T20:12:29+00:00Added an answer on May 12, 2026 at 8:12 pm

    Give each Member object a mutable-collection (either array or set, your choice) property containing the member’s books. Also give each Book object a non-owning property identifying the member who has it checked out (if anybody; nil if nobody).

    You needn’t remove a Book from the array of all books unless the library sells, gives away, or loses a book.

    Can I just ask if the correct way to do this would be to create a “Library” object as a top level object that holds the “Book” and “Member” collections.

    Yes.

    You’ll want to decide whether this is a controller object or a model object. If it’s a model object, you’ll need to create a controller to own the Library (and the Library window), and you’ll expose the library in AppleScript. If it’s a controller, it’s the object that owns the Library window (as well as the Books and Members), and you won’t expose it in AppleScript.

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

Sidebar

Related Questions

I'm setting up a program that has three different windows. I'm just using ..
I am just setting up a new VPS learning to setup my own web
I am working in flex and I am just setting a variable to false.
I just finished setting up my Eclipse with the Android plug-in. (i.e https://dl-ssl.google.com/android/eclipse/ )
I've just finished setting up a project using MVC 3, Fluent nHibernate, AutoMapper, and
I've run into a really annoying problem, and I'm hoping it's just a setting
I am setting up the development environment for my start-up just now. I use
We just switched to Glassfish V2. We are now getting errors when setting a
I just started using db4o on C#, and I'm having trouble setting the UniqueConstraint
I've followed this tutorial for setting up a static library with common classes from

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.