472,967 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 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 978
"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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.