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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:52:13+00:00 2026-06-08T05:52:13+00:00

I have: Raw Object : contains raw data before importing to the system Module

  • 0

I have:

  • Raw Object: contains raw data before importing to the system
  • Module #1: Validator which will validate Raw Objects
  • Module #2: Updater which will use validated raw data (invalid data were removed) to generate Real Objects

Module #1 has to determine whether ItemCode (just an example, the actual number of keys are dozens) exists in the database or not. Module #2 has to get the Item object by querying ItemCode in the database.

A developer wants to add an alien property .TempItem to the raw object so that the Module #1 will assign the Item object to .TempItem property (because it is super easy to do that) and Module #2 just needs to use .TempItem without querying the database second time.

My technical expert advises that it is not good.

I want to follow programming principles and best practices but have no idea how.

Any help is 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-08T05:52:15+00:00Added an answer on June 8, 2026 at 5:52 am

    What you have with Module #1 and #2 is a pipeline process. The output of #1 passes into #2. Any information that #2 needs which #1 has already ascertained can (arguably should) be cached.

    I would create an additional object to pass this state information through the pipeline (@astander suggests a dictionary, but in many cases a hard-coded object that stores precisely the data you need will be simple to write and much more usable/maintainable)

    Using a “tempitem” is essentially the same mechanism, but a poor implementation of it – the idea is the same though (don’t read the same information from the database multiple times)

    By passing a state object through your pipeline you keep the pipeline processors loosely coupled (#2 doesn’t need to know about #1, it simply acts on the state information that is passed in), which makes it easier to add new pipeline stages or refactor your modules in future. By passing the data within a separate class, it also makes it really easy to add new state data to be passed through the system.

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

Sidebar

Related Questions

I have an extjs component in its raw object type, for example: var x
I have a raw image file that is saved in binary data (no encoding).
I have written a raw binary image file into a buffer which is an
I have an array of raw sound data samples, and I'm trying to make
I have a bunch of legacy code for encoding raw emails that contains a
I have a domain object that stores some metadata and some raw bytes. This
I have a JSON object created in PHP, that JSON object contains another escaped
I have created a SecretkeySpec object wich contains a 128 bit key. I would
I have a raw pixel data in a byte[] from a DICOM image. Now
You're not supposed to treat object pointers as pointers to raw binary data in

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.