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

The Archive Base Latest Questions

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

I have created a class that I’ve been using as the storage for all

  • 0

I have created a class that I’ve been using as the storage for all listings in my applications. The class allows me to “sign” an object to a listing (which can be created on the fly via the sign() method like so):

manager.sign(myObject, "someList");

This stores the index of the element (using it’s unique id) in the newly created or previously created listing “someList” as well as the object in a 2D array. So for example, I might end up with this:

trace(_indexes["someList"][objectId]); // 0 - the object is the first in this list
trace(_instances["someList"]); // [object MyObject]

The class has another two methods:

  1. find(signature:String):Array
    This method returns an array via slice() containing all of the elements signed with the given signature.

  2. findFirst(signature:String):Object
    This method just returns the first object in a given listing

So to retrieve myObject I can either go:

trace(find("someList")[0]); or trace(findFirst("someList"));

Finally, there is an unsign() function which will remove an object from a given listing. This function basically:

  1. Stores the result of pop() in the specified listing against a variable.
  2. Uses the stored index to quickly replace the specified object with the pop()‘d item.
  3. Deletes the stored index for the specified object and updates the index for the pop()‘d item.

Through all this, using unsign() will remove an object extremely quickly from a listing of any size.

Now this is all well and good, but I’ve had some thoughts which are making me consider how good this really is? I mean being able to easily list, remove and access lists of anything I want throughout the application like this is awesome – but is there a catch?

A couple of starting thoughts I have had are:

  1. So far I haven’t implemented support for listings that are private and only accessible via a given class.
  2. Memory – this doesn’t seem very memory efficient. Then again, neither is creating arrays for everything I want to store individually either. Just seems.. Larger.. Somehow.

Any insights?

I’ve uploaded the class here in case the above doesn’t make much sense: https://projectavian.com/AviManager.as

  • 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-26T19:19:03+00:00Added an answer on May 26, 2026 at 7:19 pm

    Your solution seems pretty solid. If you’re looking to modify it to be a bit more extensible and handle rights management, you might consider moving all those individually indexed properties to a value object for your AV elements. You could perform operations like “sign” and “unsign” internally in the VOs, or check for access rights. Your management class could monitor the collection of these VOs, pass them around, perform the method calls, and the objects would hold the state in a bit more readable format.

    Really, though, this is entering into a coding style discussion. Your method works and it’s not particularly inefficient. Just make sure the code is readable, encapsulated, and extensible and you’re good.

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

Sidebar

Related Questions

I have an ExpenseType object that I have created with the following migration: class
I have created a class that extends JLabel to use as my object moving
I'm using Entity Framework 4 and I have created a UnitOfWork class that creates
I have created a class, MonitoredCollection<T> , that basically encapsulates/mimics List but allows me
Inside a container object, I have created a class Factory , that is responsible
I have created a benchmark class that allows the user to insert for example
I have created a benchmark class that allows the user to insert for example
I am using spring 3 mvc/security frameworks. I have created a Controller class that
Currently I have created a ABCFactory class that has a single method creating ABC
I have created a button CSS class that uses background images with different positions

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.