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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:16:25+00:00 2026-06-15T13:16:25+00:00

We are having a dilemma with modelling our data for a new application. The

  • 0

We are having a dilemma with modelling our data for a new application. The situation is somewhat complex; so I write down a simplified situation that is equivalent to our problem:

  • In a web app, the administrator creates a list of products; title, discription, linked to certain product categories; etc. So there is a Product entity

  • In the front-end, a user orders certain products; so there is an Order entity with a array of OrderLine entities associated with it; each OrderLine entitity has a Product associated with it.

  • After a few days, multiple Products are ordered. The administrator however needs to alter the price of a Product, or even deletes a Product, since it is no longer available.

  • In the database, there are still Orders associated with OrderLines, which are linked to Products. What happens when the adminstrator reviews the Orders in the database which where recorded before the product was altered in the database and that are associated to the product that was altered?

  • With avoiding redundancy as much as possible; on a database-level, how would you model such a case?

  • 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-15T13:16:26+00:00Added an answer on June 15, 2026 at 1:16 pm

    I’ve modelled Products, Orders and OrderItems in a similar way; the only thing I have to add to @Neville K’s answer is that I’ve previously made ProductPrices domain entities in their own right; adding a new price isn’t the same thing as adding a new Product, after all. A ProductPrice has a price, a currency and a start and end date; modelling prices like this also makes it possible to have group-specific prices or discounts for particular customers.

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

Sidebar

Related Questions

I'm having a little dilemma with an iphone project. I'm getting some JSON data
Having just added a new button in my web application, I get an error
I'm having a dilemma. I have a field hashedX that is a hashed/salted value
I'm having a bit of an application structure design dilemma. I have created a
I'm having a dilemma with allowing users to upload images to my application. My
I'm having a hard time finding the resources to solve my particular dilemma. I'd
I am having a dilemma in the logic of this particular issue. Forgive me
I'm having a dilemma on whether or not to log SQL queries in production
I'm having something of a dilemma and would appreciate some input. I have this
Having a duh moment trying to implement a new content page Here's the structure

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.