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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:45:52+00:00 2026-05-21T07:45:52+00:00

I have a display object that displays a list of Users and provides a

  • 0

I have a display object that displays a list of Users and provides a menu for acting on that list – adding new users, adding them to groups, deleting them, etc. Right now the display configures its own menu, so it can add a menu command like doCreateNewUsers(). Unfortunately, this means that every instance of the display always has the “create new” option.

I want to configure the menu differently for different instances of the display – in the “Users” tab, it should include the “create new” option, and in the “Groups” tab, it shouldn’t. My first thought was to externalize the menu, so that I could configure it differently. The problem is that then I lose the ability to call the private doCreateNewUsers() function!

Is there a design pattern for this situation? I don’t like the idea of making doCreateNewUsers public because it shows a dialog that shouldn’t be triggered by external classes. I could make the display abstract, so that I could define the menu in anonymous subclasses, but that kind of messes up the way I reuse widgets right now – I’d like to configure the menu after the display has been created and initialized. I’m hoping there’s some industry-standard way of dealing with this!

  • 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-21T07:45:53+00:00Added an answer on May 21, 2026 at 7:45 am

    It sounds to me like you could possibly use the Strategy Pattern in this case.

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

Sidebar

Related Questions

When you have a domain object that needs to display as an interface control,
I have a UITableView that displays various nsstrings from a custom object called a
I have a List with array of object values. I have to display value
I have a coming_soon_controller that displays a form for users to subscribe to an
I have a TableViewController that displays a list of elements CoreData relationship. In my
I have simple application, that shows list of many items, where user can display
I have a List object, with nested Tasks. I have created a page that
I have an observable collection of objects that I'd like to display on the
I have an object of type X509Certificate2 and want to display it to the
I have an object of type IMAGE which holds image. I wanted to display

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.