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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:05:31+00:00 2026-06-04T00:05:31+00:00

What is a good pattern for how to handle a subset of objects. Say

  • 0

What is a good pattern for how to handle a subset of objects.

Say I’ve got a list of Lockers, inside each Locker is a set of Items. The UI is something akin to this – we’re going to hope that the ASCII art makes in through.

Locker#1    |    Item #1 in Locker #2
Locker#2 ** |    Item #2 in Locker #2
Locker#3    |    Item #3 in Locker #2
            |    Item #4 in Locker #2
            |    Item #5 in Locker #2
            |    Item #6 in Locker #2
            |    Item #7 in Locker #2
            |    Item #8 in Locker #2
            |

Locker #2 is selected (active). What I’ve been doing is setting a callback when locker #2 is activated and then doing a
ItemCollection.fetch({ data: { lid: LOCKER_ID }}) to fetch the subset of items that are ready for display. Which doesn’t feel very backbone like.

What’ the better approach –

  • Loading a subset of the models – if so is there a good example of how to do it?
  • Loading everything then doing Backbone filtering on the Collection?
  • Maybe an example of pagination that might be appropriate ?
  • 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-06-04T00:05:33+00:00Added an answer on June 4, 2026 at 12:05 am

    I think everything depends on the amount of your data.

    But I don’t see any problem fetching the items Collection every time the filter changes. I really feel it is as Backbone way :). And this solution works for both cases: a lot of data, and few data.

    As an optimization step you can cache the Collections and create new ones every time the filter changes. So you can reuse and already fetched one if the User click back to an already visited filter.

    But still this optimization step is adding distance between your User and the fresh data. The User should reload the whole application to refresh his cached Collections. Or… add more code to reset Collections every X seconds… start to be a hard way.

    So, in my opinion: re-fetch the Collection every time the User changes the filter sounds nice for me.

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

Sidebar

Related Questions

I am trying to find a good pattern to use for user access validation.
I've been looking around for a good pattern to implement a insert then cancel
as the title implies i am searching for a good pattern / schema collection
I was wondering if anyone could advise on a good pattern for loading textures
I would like to know if the following code would be a good pattern
I'm finding a good design pattern to skin an app. Suppose that... you 've
I am looking for good practice or pattern to write a lib in JS.
Where to find good material to study observer pattern? I need some examples, of
Can anybody tell me a good example of Singleton pattern? Also I've one doubt
is it good, that every PHP class implements a Singleton pattern? I think, it

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.