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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:25:58+00:00 2026-06-09T15:25:58+00:00

Hi I have document class with property Status (e.g doc.Status) and the situation is

  • 0

Hi I have document class with property Status (e.g doc.Status) and the situation is as follows: when the Status property is set to confirmed I want to create another relative document. When the doc status is set to other than confirmed I want to delete that relative document(if such exists). What’s the best way to achieve this? To set if clause in the property set method or to fire event with the same if clause when the property’s value have changed ?

  • 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-09T15:25:59+00:00Added an answer on June 9, 2026 at 3:25 pm

    It depends on the behavior you want to achieve for your functionality.

    1) Using “If Clause” in set property:
    In this method, once you will compile your document class, you cannot change the behavior as the set property becomes hard-coded then. So, if the only thing that is to be done is to create and delete relative document, then this method is preferable.

    2) Creating events for change in “status” property:
    This functionality should be used in case when you want to decouple the action performed after any change in “status” property from your document class. If the business-logic to be executed after the “status” property is changed, is not decided at the time of compilation of document class, then this method is preferable.

    The choice is yours!!

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

Sidebar

Related Questions

I have already set a variable in my document class Main.as. I am now
I have a class... class Document { public int GroupID { get; set; }
I have a class as follows: public class Document { public List<DocumentSection> sections =
I have a Document class, Intro class and Nav class. The Intro class runs
I have the following structure: class User include Mongoid::Document end class Resource include Mongoid::Document
I have an HTML document where I have two different tables. One is class
I have three models: class User include Mongoid::Document field :name, :type => String has_many
I have a model: class SimpleAction include Mongoid::Document field :set_date, :type => Date and
I have a relationship like this class User include Mongoid::Document include Mongoid::Timestamps embeds_one :setting
I have a C# class method that return a xml document not file. How

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.