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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:58:31+00:00 2026-05-13T00:58:31+00:00

public class Fruit { // choose one public int Id { get; set; }

  • 0
public class Fruit
{
    // choose one
    public int Id { get; set; }
    public int FruitId  get; set; } // redundant or usefully more descriptive?

    // choose one
    public string Name { get; set; }
    public string FruitName { get; set;} // redundant or usefully more descriptive?
    public string Fruit { get; set; } // or what about this?
}

Which is your preferred convention for the fruit’s identification number and name? Why? Are there other examples where you would answer differently?

  • 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-13T00:58:32+00:00Added an answer on May 13, 2026 at 12:58 am

    In general, property names should be named after themselves, not the class.

    Five situations where the class name may be useful as a prefix or suffix on a member of the class:

    1. The desired property name is a reserved word in your language. For instance, FruitType instead of Type. In most cases it is better to just name the property something else.

    2. Where the class acts as a factory and returns instances of itself. For instance, if Fruit has a static method called “GetFruitById” that returns a fruit. In this case, you’d likely be better off having a separate FruitFactory class for that method.

    3. Where the class contains other things of its own type. In your example, perhaps, if Fruit is a graph showing the evolutionary links of fruit, each Fruit instance could contain a list of fruits descended from it in a called “DescendantFruitList”. Chances are, you could drop the word “fruit” and it would still be perfectly descriptive.

    4. The name of the class in your domain model matches a word used in common programming naming conventions. Example: an object representing a literal (real-world) Factory, List, Dictionary, etc. and also needing to use the same words for related classes in your programming.

    5. Compatibility with an O/R mapping to a database or implementation of an external Interface whose members happen to have the same word. For instance, if Fruit implements an existing IFruitStandProduct interface. In this case, you aren’t responsible for the coincidence of naming.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer 1. Detecting the overflow: x = a * b; if… May 13, 2026 at 2:00 am
  • Editorial Team
    Editorial Team added an answer You can use keypress and check the e.keyCode == 38,40… May 13, 2026 at 2:00 am
  • Editorial Team
    Editorial Team added an answer Still not sure what the error actually means, but the… May 13, 2026 at 2:00 am

Related Questions

Let's say I have: public class Fruit { public static List<String> Suppliers { get;
Is there a way to Take a given XML file and convert (preferably using
Upon reviewing a bunch of MVC style web applications, I'm noticing that it's common
The following code is for winforms: public partial class Form1 : Form { public
I have a windows forms app in C#. Platform is vS 2005. Following is

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.