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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:35:46+00:00 2026-05-22T22:35:46+00:00

Hi I have a question about using this pattern. When making listeners should the

  • 0

Hi I have a question about using this pattern. When making listeners should the names of the methods be what the name of the method in the model are that triggered the event? Such as:

(Trivial example that shows what I mean)
Model:

public void setName(String name) {...}
public void setAge(int age) {...}

Listener

void nameChanged(TheEventObject event);
void ageChanged(TheEventObject event);

Or should this be:

void personChanged(The EventObject event);

Where the person-prefix is the name of the Model class.

To recap should the methods in the interface be for each specific method that changed some value in the model, or should it be just one that says “Hey, model changed”?

  • 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-22T22:35:47+00:00Added an answer on May 22, 2026 at 10:35 pm

    I think that easier for future is to created in the another way in some parent abstract class that each been will be delivered, you could create a instance of some class that will manage the notification kind of property change manager(observer) that would fire a event after property change.

    firePropertyChange("properyName", newValue, oldValue); 
    

    To support this you could use the java.beans.PropertyChangeEvent

    Base interface for a property change observer:

    void fireBeforePropertyChange(String propertyName, Object currentValue, Object newValue) throws PropertyChangeException;
    void removeBeforePropertyChangeListener(BeforePropertyChangeListener beforePropertyChangeListener);
    Enumeration<BeforePropertyChangeListener> getBegorePropertyChangeListeners();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about using new[] . Imagine this: Object.SomeProperty = new[] {string1,
I have a question about using streams in .NET to load files from disk.
I have a question about using os.execvp in Python. I have the following bit
I have a question about best practices regarding how one should approach storing complex
I have a question about locking. This doesn't have to be only about record
I have a question about this question . I posted a reply there but
I have a question about tables in MySQL. I'm currently making a website where
I have a question about design winforms. Should I use, or not, group boxes
I'm learning GRASP pattern at school and I have a question about the Creator
I have question regarding about finding subview using '.tags' in one UIView. for (UIView

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.