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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:15:59+00:00 2026-06-17T12:15:59+00:00

Suppose this is a configuration data object that I read from DB/XML: class ConfigurationClass{

  • 0

Suppose this is a configuration data object that I read from DB/XML:

class ConfigurationClass{

     //some configurations
     public String getString(){

     }
}

Now this is the class that uses this configuration object

class ConfigurationUser implements Reloadable{

     private ConfigurationClass configuration;

     //some extra logic required for making object ready to use
     public void init(){
         // some new object is created based on configuration
         SomeObject obj = new SomeObject(configuration.getString());

         //register to configuration manager 
     }

     @Override
     public void reload(){
        //does whole reloading stuff
        //creates a new instance of configuration class and reads new configuration which is not appropriate
     }
}

Now when I have to reload the configuration then suppose I create a new instance of ConfigurationClass and inject it in ConfigurationUser class.
But I will also have to re-initialize the object, so that it can create new configuration dependent objects.

Is this a proper design to do it or there is a better approach? I thought of using Spring or Google Juice for DI, but again I will have to provide the callback to the configuration user class, that configuration has been reloaded.

I am new to using IoC containers so dont know if it is possible. Need to use this in real time server application so have to be strict about garbage production and performance.

Current solution:

public interface Reloadable{

    public void reload(); 
}

I have a configuration manager to which I register all the configuration user instances, and when reload is to be done, manager just calls reload and it reads new configuration and re initializes all dependent objects.

Any help would be appreciated.

  • 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-17T12:16:00+00:00Added an answer on June 17, 2026 at 12:16 pm

    I think you’re looking for an Observer/Listener design pattern. Your configuration user should be an “observer” and a configuration itself will be a “subject”. First, the observer registers itself in a subject. Next, every time a subject is changed it notifies all observers, and they reload (or do anything they wish).

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

Sidebar

Related Questions

Suppose this is my URL route: (r'^test/?$','hello.life.views.test'), How do I make it so that
hi i am working on a shellscript.. suppose this is the data my shell
i don't understand this little thing: Suppose, we have Condition model class Condition <
I'm trying to cache some application data that only needs to be instantiated when
Every time I open the Master Data Services Configuration Manager, all options that I
i want to use XML to save some configuration for elements in my app.
I have a QThread that fetches data from the web. Sometimes the user asks
Instinctively, I would say that this is impossible, as NHibernate needs to know some
Suppose i started a project name abcd doing this rails new abcd. So some
I've the following scenario: I've a byte[] that contains the .class data of a

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.