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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:05:41+00:00 2026-05-27T08:05:41+00:00

What are the Pro’s Con’s on defining value types as either Methods or Properties

  • 0

What are the Pro’s Con’s on defining value types as either Methods or Properties on Interfaces

i.e

Are the only issues with threaded apps or are these pretty much interchangable ?

 public interface IFileSearch
    {
        int FilesNum();
        int FilesNum { get; set; }

        bool HasFinsihed { get; set; }

    }
  • 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-27T08:05:42+00:00Added an answer on May 27, 2026 at 8:05 am

    The reason that you wouldn’t want it defined as a method is if the implementor needs the value as a property, for example to send to a web service.

    In addition, of course, if the concept you are defining through the interface needs to be both readable and updateable then a property is usually a better solution than two methods (one for setting and one for getting).

    If the data is not to be updated, I often vacillate on whether to provide a method or a readonly property, but assuming no additional parameters are required and the concept being exposed is truly a piece of data as opposed to an action, I usually end up on the side of providing a property for databinding, reflection, and serialization purposes.

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

Sidebar

Related Questions

From: Pro PHP and jQuery: ■ Tip The values returned are CSS shorthand properties.3
What are the pro's and con's of maintaining a pool of frequently used objects
Project name : pro Project location : /home/cha0s/pro/ Applications location : /home/cha0s/pro/apps/ , where
From Pro C# Referring to New-ing Intrinsic data types... All intrinsic data types support
What are the pro's and con's of, for example, using a D3DXVECTOR3 (a directX
The recent MacBook Pro keyboard and the bluetooth keyboard layout has only one Control
I see the VS2010 Pro includes LightSwitch. But from the LightSwitch website only has
WinXP Pro Oracle 10g Instant Client 10.2.0.1 MS Access 2003 When I link a
In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if
How do you get Pro*c to work within MSVC 6? In otherwords compile a

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.