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

  • Home
  • SEARCH
  • 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 540437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:14:24+00:00 2026-05-13T10:14:24+00:00

Scenario: The Invoice has a reference to the class User. A user object is

  • 0

Scenario: The “Invoice” has a reference to the class “User”. A user object is delete through the user himself or an administrator, but the invoice object still needs a recepient (the user).

The user object could be marked as deleted instead of delete it physically. But I think it is a bad design to use an object, that is marked as deleted. In my opinion objects should only be archived for legal requirements after deletion but not used regularly.

To remove them physically makes some things easier: cascading deletes, selects, database backups …

How can I avoid using objects marked as deleted? What design do I need to be able to remove unused objects physically from the database? Are there best-practises?

Context: OOP (DDD) application based on Java EE and a relational database.

  • 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-13T10:14:24+00:00Added an answer on May 13, 2026 at 10:14 am

    Is this your real world scenario with invoice and user meaning what I think they mean?

    Because, I fail to see how an invoice can ever be deleted in the real world. If an invoice is issued to a customer in error, it could be voided, but the physical data cannot be deleted, otherwise you have no way to retain the information which comprises the invoice. If an invoice is valid but a user associated with it is terminated, you still need to be able to see the user associated with the invoice, otherwise you lose the information about who issued or approved the invoice or whatever.

    As far as avoiding using objects who are deleted, I don’t think it applies here, because none of these objects CAN actually be deleted. They obviously have an expired, voided, terminated or invalid status for a user creating new invoices or invoices being paid or collected on, but they certainly aren’t deleted in the sense of not existing or being considered to not ever having existed, because they obviously did exist at some point since transactions were committed.

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

Sidebar

Ask A Question

Stats

  • Questions 304k
  • Answers 304k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best way is to deep clone the parameter. For… May 13, 2026 at 8:46 pm
  • Editorial Team
    Editorial Team added an answer You really dont need to use jquery to lay out… May 13, 2026 at 8:46 pm
  • Editorial Team
    Editorial Team added an answer The solution I came up with was to redirect the… May 13, 2026 at 8:46 pm

Related Questions

Our development policy dictates that all database accesses are made via stored procedures, and
I want to develop a system that is similar to calculation of salary. A
Ok, I was deciding between a thread or BackgroundWorker process and based on the
I'm trying to map a relatively simple parent-children (Invoice-InvoiceEntry) scenario in NHibernate. Here are
I am a bit of an SSIS newbie and while the whole system seems

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.