473,706 Members | 7,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "OtherPropertie s" 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.Configur ation.SettingsP roperty class to define the additional
property, and so declare the "OtherPrope rty" as SettingsPropert yCollection?

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

Thanks

Bye

Stefano
Feb 1 '06 #1
4 1576
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.co m

"Stefano" <st************ *****@giasoft.i t> wrote in message
news:43******** *************** **@msnews.micro soft.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 "OtherPropertie s" 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.Configur ation.SettingsP roperty class to define the
additional property, and so declare the "OtherPrope rty" as
SettingsPropert yCollection?

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 (SettingsProper ty and
SettingsPropert yValue) 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.co m

"Stefano" <st************ *****@giasoft.i t> wrote in message
news:43******** *************** **@msnews.micro soft.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 (SettingsProper ty
and SettingsPropert yValue) 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.i t> wrote in message
news:43******** *************** **@msnews.micro soft.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
(SettingsProper ty and SettingsPropert yValue) 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
279
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 detail record. I am having problems designing the business entity objects for these tables becoase we have one composite that Depends on Two Parent Objects.
2
383
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 entity from the Employees class and use that business entity to fill all the textboxes etc. Using VB6, I would use a recordset as the business entity like so.. My Employees class would have a method like this.. Public Function GetEmployee...
1
1909
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. So I was thinking a building a class EnumDescriptor to store these properties - and make it generic so that it could be used for all enums. I also need to be able to store and manage a collection of these EnumDescriptor objects... for this I...
6
1632
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"/> .... Ideally, I'd like Visual Studio (2005) to allow the entry of these
1
3183
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 collection, Text and Value. I need to add a DivisionID, and DepartmentID. I assumed i could simply override the ListItem class and add the additional properties. is this in fact the case? If so what would the code look like?
18
1933
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
1246
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 not my additional properties. I have designed a business object collection like this and I have to pass it across the service layer. But in another end I’m getting partial data not all my information is getting de-serialized. Here is a sample...
2
1000
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 many objects of my newly started asp.net web application. Anyone there knows the best O/R mapper or business entity generator resembling or near to the structure of employee starter kit? I haven't found any such over Internet. Kindly help me. Thanks...
0
8778
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9281
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9044
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7899
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5935
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2497
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.