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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:09:41+00:00 2026-05-26T05:09:41+00:00

I have a Request class that is used to retrieve a file resource from

  • 0

I have a Request class that is used to retrieve a file resource from an external process, using a method RetrieveResource(). This method takes approximately 10-15 seconds to complete. In addition, the Request class contains four child objects, which are instantiated using dependency injection during the construction of the class, to access the contents of the requested file.

The Request class is instantiated from the main class of the project. The main class calls RetrieveResource() approximately every 30 seconds. After each invocation, it may be necessary to adjust a particular property, for example, Property A, of one or more of the child objects of the Request class.

I would be interested to hear views of the best way to accomplish this. The following list describes three approaches that could be used to change the value of Property A:

  1. The main class explicitly sets the value of Property A on each child object of the Request object by calling the property directly. For example, Request.Object1.PropertyA = newValue;

  2. Create a method in the Request class to update the value of Property A on each child object, for example, UpdatePropertyA()

  3. When creating an instance of the Request class, pass a builder class that is responsible for creating a new Request instance, including the creation of the each of the four objects using DI. The builder class contains a property, for example, Property A, which is then used to set the value of the property of the name for each child object of the Request class.

Grateful to hear thoughts. Thanks.

  • 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-26T05:09:42+00:00Added an answer on May 26, 2026 at 5:09 am

    The problem with first two approaches you have suggested is that they are not flexible. If later your requirements would change (say you will have more child objects, or property A will be simply renamed, etc.), this will cause changes in the main class or in the Resource class, which is not good. Moreover, from my point of view this is not the job for these classes to update property A.

    Personally I would suggest slightly modified third approach, because it moves all the update logic to the builder object, which is a good and flexible solution. I would say that this object should have a method, say BuildUp(Request instance), and inside this method all the update should take place. The way that you implement the actual update does not matter here – it will all be left aside in a special class, and in case of any change it could be modified in a blink of an eye, without changing the main logic of the application classes.

    Furthermore you might want to create an interface for this builder, and operate with interface only in code of Resource class. It will be the main class who will know about the actual implementation of the builder being used. That way it would be a matter of a single line to substitute the implementation of the builder in case of any changes.

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

Sidebar

Related Questions

in AS3, I have an external class ImageLoader, that loads an image upon request.
I have an HTTP Request Dispatcher class that works most of the time, but
I have a class that builds a request based on a few passed in
I have a request for some contract work from an organization that uses Excel
I have a request in from a client that would like one of their
I have a dynamic Class that is a Value Object that is used to
I have a website running a basic ASP.NET application that is mostly used from
I have a parser class that is subclass of NSOperation. It is used to
I have a specific class in my project that used for load and hold
I tend to have this statement STKUser authenticatedUser = (STKUser) request.getSession().getAttribute(STKUserSession); in every method

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.