473,387 Members | 1,641 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.

Business entity with additional properties

Hi all,

I'm designing classes for my application.

I'd like to create a business entity that could be expanded with other properties
when needed.

For example, this could be my entity:

MyBusinessClass
-> Property1
-> Property2
-> ...
-> OtherProperties

The "OtherProperties" property of the class could expose a name value collection
with the other properties associated to the entity.

Now, the question is:
can I use System.Configuration.SettingsProperty class to define the additional
property, and so declare the "OtherProperty" as SettingsPropertyCollection?

I mean: has someone used this before? Are this classes designed for this
purpose?

Thanks

Bye

Stefano
Feb 1 '06 #1
4 1554
Stefano,

You ^could^, but I don't think that this would be a good idea. The
reason for this is that every instance of your object (with each instance
representing separate entities) would share the same values, which is what I
am sure you don't want.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Stefano" <st*****************@giasoft.it> wrote in message
news:43*************************@msnews.microsoft. com...
Hi all,

I'm designing classes for my application.

I'd like to create a business entity that could be expanded with other
properties when needed.

For example, this could be my entity:

MyBusinessClass
-> Property1
-> Property2
-> ...
-> OtherProperties

The "OtherProperties" property of the class could expose a name value
collection with the other properties associated to the entity.

Now, the question is:
can I use System.Configuration.SettingsProperty class to define the
additional property, and so declare the "OtherProperty" as
SettingsPropertyCollection?

I mean: has someone used this before? Are this classes designed for this
purpose?

Thanks

Bye

Stefano

Feb 1 '06 #2
Hello Nicholas Paldino [.NET/C# MVP],
You ^could^, but I don't think that this would be a good idea.
The reason for this is that every instance of your object (with each
instance representing separate entities) would share the same values,
which is what I am sure you don't want.


I'm not sure that values will be shared.
Why did you say that?

I'm looking inside, using a reflector... that classes (SettingsProperty and
SettingsPropertyValue) doesn't have static members.

So, what is the correct use that we can do about this classes?

Thanks

Bye
Feb 1 '06 #3
Stefano,

It doesn't have static members, but the classes are meant to store
values that are used application-wide, not instance-wide.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Stefano" <st*****************@giasoft.it> wrote in message
news:43*************************@msnews.microsoft. com...
Hello Nicholas Paldino [.NET/C# MVP],
You ^could^, but I don't think that this would be a good idea.
The reason for this is that every instance of your object (with each
instance representing separate entities) would share the same values,
which is what I am sure you don't want.


I'm not sure that values will be shared.
Why did you say that?

I'm looking inside, using a reflector... that classes (SettingsProperty
and SettingsPropertyValue) doesn't have static members.

So, what is the correct use that we can do about this classes?

Thanks

Bye

Feb 1 '06 #4
Hello Nicholas Paldino [.NET/C# MVP],

thanks for the answer. You're right.

Anyway...

It could be great if the BCL had supplied a class that we could have used
in order to define a property, like the one that Vadym suggests:

public class CustomProperty
{
Name
PropertyType
Value
SerializedValue
....
}

Stefano,

It doesn't have static members, but the classes are meant to store
values that are used application-wide, not instance-wide.

"Stefano" <st*****************@giasoft.it> wrote in message
news:43*************************@msnews.microsoft. com...
Hello Nicholas Paldino [.NET/C# MVP],
You ^could^, but I don't think that this would be a good idea.
The reason for this is that every instance of your object (with each
instance representing separate entities) would share the same
values,
which is what I am sure you don't want.

I'm not sure that values will be shared.
Why did you say that?
I'm looking inside, using a reflector... that classes
(SettingsProperty and SettingsPropertyValue) doesn't have static
members.

So, what is the correct use that we can do about this classes?

Thanks

Bye


Feb 1 '06 #5

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

Similar topics

2
by: Balaji | last post by:
Hi I have three database tables - Location, Part and Detail. Location and Part have a one-many relationship to detail. Location and Part need to be inserted into the database before inserting a...
2
by: Craig | last post by:
Does anyone have any advice on which type to use for a business entity in the following situation.. If I want to populate a form with Employee details (windows or web) , I will get a business...
1
by: Donal McWeeney | last post by:
Just thinking out loud here and looking for feedback in case I missed something... I was to track some additional properties around an enum I have - for example a display name and a description....
6
by: Abdullah Kauchali | last post by:
How does one define additional attributes for elements in an XSD? So, I'd like something like this: .... <xs:element name="ClaimNumber" type="xs:string" mycustomproperty="xs:string"/> .... ...
1
by: RSH | last post by:
Hi, I have a situation where I need to add several "Hidden" properties to list items in a dropdownlist. By default the DropDownList item has two properties with regards to the listitems...
18
by: Narshe | last post by:
I've been struggling with this for a while. I have a business entity Employee that has a Company entity attached to it. Ex: public class Compay{ // blah } public class Employee
1
by: Karthik1979 | last post by:
I have a custom class inherited from List<T> collection. Along with the base class functionality, I have included my additional properties. When serializing, only the base class items are serialized...
2
by: sangam56 | last post by:
hi all.i have downloaded and studied the asp.net employee starter kit. I liked the way the business layer is created. it is too much time consuming to hand code all the business layer classes for so...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.