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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:48:11+00:00 2026-06-09T14:48:11+00:00

For routing action requests, I’d like to use a single ActionListener instance for all

  • 0

For routing action requests, I’d like to use a single ActionListener instance for all Components. Calls on actionPerformed could be differentiated using setActionCommand.

Is this advised ? Are there any potential downsides to this approach in an MVC context ?

  • 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-09T14:48:13+00:00Added an answer on June 9, 2026 at 2:48 pm

    “Is this advised ?” I’d imagine not, but a lot will depend on the size of you project.

    I think the statement “all your eggs in one basket” comes to mind.

    The size of the if statement could become unimaginably huge as you add new action branches to it. As you’re project increases in complexity, so will you action handler.

    Debugging potential problems could also become a headache.

    Maintenance of the code would become tedious and prone to misunderstandings and cause no end of new errors in the logic.

    You break the isolation of responsibility rule (you should try and isolate responsibility for the management of an action/event within it’s own object/class)

    If you’re looking for a way to re-use action handlers, look at the Action API instead. If you’re really eager, you could use a Factory to produce well know actions through out your code. This would allow for re-use while maintaining responsibility isolation.

    On a personal note, having had to spend the last 3 years unraveling the mess of a inexperience graduate who wrote the core libraries to our system and liked to code like this, please don’t. It’s so easy to break, so hard to read and is just a plain mess.

    IMHO it speaks of a lack of/or inability to design.

    That’s just my personal opinion based on my experience

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

Sidebar

Related Questions

I'm setting up a CakePHP project, and would like all requests passed in to
I want to route to more than one action, I make the routing configuration
I implemented the exception filter like here: http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling And registered it globally, like microsoft
I have a jquery routine that calls an MVC action which will do a
I have my own routing rules in routes.php, defined for all the pages that
I'm wondering if it is possibile to customize routing in a way that all
I have a index.php which handle all the routing index.php?page=controller (simplified) just to split
Say I will be passing below URL requests to the routing system, this is
I'd like to block requests to any .php or .cgi regardless of the pathing
I'm developing a PHP website that uses url routing. I'd like the site to

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.