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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:13:09+00:00 2026-05-12T06:13:09+00:00

Can anyone suggest some guidance for designing and implementing good Properties? I am concerned

  • 0

Can anyone suggest some guidance for designing and implementing good Properties? I am concerned with aspects such as:

  • Side-effects
  • Mutual Exclusivity
  • Concurrency
  • Symmetry and Reversibility
  • Error Handling/Exceptions

Pointers to existing write ups that answer these topics would be great. I am NOT looking for help with WPF Dependency Properties.

  • 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-12T06:13:10+00:00Added an answer on May 12, 2026 at 6:13 am

    As a rule, properties shouldn’t contain almost any logic other than possibly some boundary checks and type checks (depends on language). Thus, every item on the list other than Error Handling / Exceptions should not be factors when implementing properties.

    W.R.T Error handling, it is absolutely OK to throw exceptions from properties (i.e. when a calling block attempts to set a property to an invalid value). Also, using try…catch statements are appropriate when attempting to parse data.

    An example of this would be in using a property to hide a request parameter in a web application:

        public int UserId
        {
              get {
                   string x = Request["userid"];
                      int userid = -1;
                      if (!int.TryParse(x, out userid))
                          throw new ApplicationException("UserID must be a valid integer");
    
                      return userid;
                  }
        }
    

    this is a bit of a contrived and simplified example, but I hope it illustrates the point. In a real-world application, you might want to have a different method of error handling and/or parsing to check for valid ranges of ID’s and such, all depending upon your circumstances.

    The wikipedia entry for properties may also be a good place for more information

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

Sidebar

Related Questions

Can anyone suggest some good materials for learning more about the Linux filesystem and
Can anyone please explain or suggest some good tutorial for the method of matrix
Can anyone suggest some good implementation examples or usage scenarios where SQL parsers can
Can anyone suggest some good resources, preferrably free, that I can read to thoroughly
Can anyone suggest me some good CMS plugin for an existing Rails 3 application
Can anyone suggest some good books that practically describe Silverlight and WCF?
How to write a unit test framework? Can anyone suggest some good reading? I
Can anyone suggest some good browser add-on tools/extensions to help with development? I have
Can anyone suggest some good way to generate Graphics2D object form SVG data? I've
Hi, can anyone suggest me some good resources to learn JNI for Android and

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.