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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:30:47+00:00 2026-06-13T20:30:47+00:00

Regarding the event driven programming model. Normally the employer raise the question simulate the

  • 0

Regarding the event driven programming model. Normally the employer raise the question “simulate the event driven programming model in Java without any external library”. I think it is a simple question and can answered with usage of design pattern.

My solutions is have 2 queue in place as the publish subscribe(aka. observer) channel. publish channel will register event targeted to particular event type such as click.

poll element -> button 1 click || button 1 click again || button 1 click certain time. <- publisher queue

another subscribe channel will store the event listener, if new publish comes up,

poll element -> listener 1 || listener 2 || -< subscriber queue.

it will push into the publish queue first and poll it on another time allow subscriber to consume. The subscribe will consume the publisher element and apply to each element in subscriber channel (in this case each event listener). Observer design pattern allows component agnostic. publisher doesn’t know anything of subscriber.

This scenario resembles email newsletter subscription.

In the OO implementation, there will be Publishers object and Subscribers class. Actually a queue of detailed publishers implementation and detailed subscriber implementation. Also the Mediator design pattern is incorporated to coordinate publishers class and subscribers class.

Is there any flaw on my solution?

  • 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-13T20:30:48+00:00Added an answer on June 13, 2026 at 8:30 pm

    No, not really. Your solution is pretty standard and sound.

    Observer/subscriber for basic events and Mediator if you need to coordinate sending events in a specific order.

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

Sidebar

Related Questions

I have a question regarding the onkeypress event on JavaScript. Is it possible to
I have a question regarding the OnItemDataBound event and I'm hoping someone can help
Quick question regarding delegateEvents in a View - can we specify multiple event bindings
This is somewhat of a general question regarding Windows programming: Are Window messages "reliable"?
What is event-driven programming and has event-driven programming anything to do with threading? I
I have a question regarding events in c#. Lets say I have an object
Is there anyway to encorporate Dragon NaturallySpeaking into an event driven program? My boss
I had a question regarding generating a specific computer ID for licensing purposes. Preferably
I've got a question regarding the difference between PropertyPlaceholderConfigurer (org.springframework.beans.factory.config.PropertyPlaceholderConfigurer) and normal filters defined
There is a similar question here but regarding the class path. ClassNotFoundException com.mysql.jdbc.Driver I've

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.