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

Ask A Question

Stats

  • Questions 263k
  • Answers 263k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Microsoft said they'll add the option to turn smart sql… May 13, 2026 at 12:04 pm
  • Editorial Team
    Editorial Team added an answer Alright; The answer seems to be: ^q:: Input Key, L1… May 13, 2026 at 12:04 pm
  • Editorial Team
    Editorial Team added an answer I would suggest setting the other tabs to disabled. This… May 13, 2026 at 12:04 pm

Related Questions

I have a reference of the dll file here: http://speex.org/docs/api/speex-api-reference/group__Codec.html What I'm wondering is,
In Visual Studio 2003, I am trying to set an environment variable in the
I am setting up a project using Hibernate 3.3.1 GA and PostgreSQL 8.3 .
I know this can be done and i have seen it done using some

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.