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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:00:28+00:00 2026-05-20T20:00:28+00:00

I have a series of objects and each has meta-data associated with it. In

  • 0

I have a series of objects and each has meta-data associated with it. In the typical case, I have a class representing Object and Meta_Data and I can make Meta_Data an attribute of the Object.

+---------------+    +---------------+
|    Object     |--->|   Meta_Data   |
+---------------+    +---------------+

The issue arrises when I want to create a collection of Objects, each of which is associated with a particular instance of Meta_Data.

The Meta_Data needs to be able to access its own neighbors:

a[0] = Object();
a[1] = Object();

// a[0].meta needs to be able to interact with a[1].meta
a[0].meta = Meta_Data();
a[1].meta = Meta_Data();

If I just create a collection of Objects (with Meta_Data instances as attributes), then the Meta_Data instances are isolated and can only interact by going through the primary object. This seems less than ideal.

The only real alternative that I can think of is to create some container class that allows me to have:

  1. An ObjectStack attribute that contains a collection of Object instances
  2. A Meta_DataStack attribute that contains a collection of Meta_Data instances
  3. Some sort of interface that syncs up the two so that I can query the corresponding meta-data for any particular Object instance.

This again seems inefficient. So what is the best way to have to collections of objects that can be linked item-by-item?

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

    What you have then is something like this:

    [Object]--->[MetaData]<--+
                    |        |
                    +--------+
    

    Something needs to be in charge of connecting the MetaData objects and it can’t be any one particular Object object. You need a Factory or Builder of some sort that puts everything together properly.

    That doesn’t mean that the Factory needs to maintain a reference to every instance of both classes that exist, it just needs to make the connections.

    Object a = new Object();
    Object b = new Object();
    MetaData ma = new MetaData();
    MetaData mb = new MetaData();
    
    ma.setFriend(mb);
    a.setMetaData(ma);
    b.setMetaData(mb);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I have a series of objects based on a base class which are
I have a series of DataRow objects, each with a bunch of different fields.
I have a series of objects I have created: Item Order Song etc. Each
I have an array of event objects called events . Each event has markets
I have a series of <div class=clear-both></div> after a series of divs. I want
I have a project in which a series of NSThread objects do something and
I have these two models: class CommonVehicle(models.Model): year = models.ForeignKey(Year) series = models.ForeignKey(Series) engine
I have an array of jQuery objects. I'd like to interact with each item
I have a Python program that runs a series of experiments, with no data
I have a series of texts that are instances of a custom WebText class.

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.