473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Object Properties not set any issues

Hi,

I have created an C# Class with 12 properties. I am using only two
properties. Are there any performance issues in doing that. or I have
to create a Class with only two properties. I created 12 properties
because I might use them in future.

Example:

class car
{
int vehicleNo;
int make;
int model;
Sep 2 '08 #1
3 983
"vital" <vi***********@gmail.comwrote in message
news:48**********************************@25g2000h sx.googlegroups.com...
I have created an C# Class with 12 properties. I am using only two
properties. Are there any performance issues in doing that.
Not likely. Of course, the backing fields for the properties will still be
there, whether you've changed their values or not. But unless you're going
to have thousands of those objects around, it is hardly going to matter.
Sep 2 '08 #2
On Sep 2, 4:38 am, "Pavel Minaev" <int...@gmail.comwrote:
"vital" <vital.madd...@gmail.comwrote in message

news:48**********************************@25g2000h sx.googlegroups.com...
I have created an C# Class with 12 properties. I am using only two
properties. Are there any performance issues in doing that.

Not likely. Of course, the backing fields for the properties will still be
there, whether you've changed their values or not. But unless you're going
to have thousands of those objects around, it is hardly going to matter.

Why I asked it because some of the properties are of type
"HttpPostedFile". Which
I am not using now but I might use later. From ur reply I understood
it doesn't matter.
in performance. Can I use structs instead of class here
Sep 2 '08 #3
On Sep 2, 4:55*pm, vital <vital.madd...@gmail.comwrote:

<snip>
Why I asked it because some of the properties are of type
"HttpPostedFile". Which
I am not using now but I might use later. From ur reply I understood
it doesn't matter.
If you don't set any values, the backing variables will just have
values of null.
in performance. Can I use structs instead of class here
Why would you particularly want to? It's very unusual to create your
own structs in C#. Are these naturally "fundamental" value types?

Jon
Sep 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
3
by: Roger Maynard | last post by:
1
by: Chris Dunaway | last post by:
I have a main process that will spawn several threads for processing. Before this happens, the main process creates an instance of a class that hold configuration data. This configuration data...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
3
by: Techno_Dex | last post by:
I'm wanting to create a Wrapper (or Extender depending on how you look at it) for a Serializable object that I then want to send over a webservice. Basically I want to create a Serializable Object,...
2
by: =?Utf-8?B?TWFyZWs=?= | last post by:
Hi I have a class which has its own type converter that adds some additional properties using overridden GetPropertiesSupported and GetProperties methods. All works fine if an instance of the...
7
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id -...
3
by: Jeremy | last post by:
I've created a serializable class and put attributes around all the properties that should be serialized. I return the class from a web service, but my problem is that the wsdl for the web service...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.