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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:36:40+00:00 2026-05-23T00:36:40+00:00

I got a complex question involving many different components of an application. I hope

  • 0

I got a complex question involving many different components of an application. I hope to be clear enough.

In my app, the application object, a singleton, provides a model (singleton too) to many activities. The main activity, presents a list of timed data to the user. These data come from the model.

I also have a widget and I want it to :
– update when timed data is updated from within the model (via the GUI)
– as time passes, update to only display the 2 first timed data of the list, removing the ones that are now obsolete.

To reach the second objective, I designed a service that asks the model to get some data, and uses timers to wakeup after the first data expired, and remove it from the list then sends a broadcast to the widget with some data in intent, that the widget will display.

This works fine.

But I also want the widget to update as soon as data changes in the model (not because time passes, but because of the user asking for some other data through the GUI).

But, and here is my problem:

how can the model tell the widget to update? Everything is in place for the service to update the widget but the engine can not know if there is a widget. I don’t want the model to call the service as maybe there is no widget and no need to have an additional process for the service.

How can this interaction be redesigned elegantly?

I am really missing something here.

  • 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-23T00:36:41+00:00Added an answer on May 23, 2026 at 12:36 am

    You can use the Observer pattern to have the engine fire off events to whichever components in the app are interested whenever things are updated, without the event-producing component having any real knowledge of the event-consumers.

    The Event object sent as a parameter should contain all of the relevant info about the event for the UI widget to update itself, etc., so that only this abstract “event” object needs to be passed – and your layers do not bleed into each other.

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

Sidebar

Related Questions

Got a complex reflection question. Given the code below how would you implement the
I'm sorry for complex question. I've got a website that reading contents from MySQL
I've got a question on making an navigation app more faster and more stable.
We've got a fairly complex httphandler for handling images. Basically it streams any part
I've got some rather complex forms, that need to be configured by web designers.
I've got some SQL which performs complex logic on combinations of GL account numbers
Got a problem with ADOMD.NET 8.0, SQL2008 and our app. It isn't giving us
I've got a complex SQL where clause that just got more complex because of
I've got a complex class in my C# project on which I want to
I've got a moderately complex iterator written which wraps the FindXFile apis on Win32.

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.