473,382 Members | 1,387 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,382 software developers and data experts.

Dynamic Properties

I have a question regarding dynamic properties.

I have an Object say

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType

This is in a Application Service Provider Model, so say Client 1 has
only those properties available for account.

NOW Client 2 has some additional requirments

That may look like so

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Entity
--ParentId
--LastContactDate

The Third Client may have these requrments

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Source
--HairColor

I am using .Net 2.0 with SQL 2005 for the Data, and DAAB for the DAL,
but IBatis or NHibernate are also options, and I am familiar with the
usage of both.

All of the above are the same through Suffix, but I would like to be
able to dynamically assign properties to these objects, the DAL can
support it so there is no problem there.

ON the interface layer I dont have a problem dealing with these, so no
problem there , my question is at the object level what is the most
EFFICIENT way to deal with these ?

What is the best (or any way and I can decide later) the best
implementation of allowing a "Per Client" config of properties on
several core objects, say Account, Transactions, Orders, Contacts, etc
?

I have several working possibilities, but quite frankly would like
some feedback before I implment this in production, some of the
solutions I have seem a little heavy handed.

I am seeking feedback on options I may not have sen, thought of or
pursued.

Thanks

Chris

Jul 24 '06 #1
5 2035
Hello cw******@gmail.com,

Three methods come to mind at once.

1. A base object that implements all the common fields plus one property
(lets call it .ClientExtensions). Then, for each client, build a new object
that you can assign to .ClientExtensions. Then use reflection (or the database)
to figure out whats in them.

2. Build your object assembly for each client dynamicly using System.Reflection.Emit
namespace. This is the method the company I work for has chosen for one
of our projects. It works quite well, but it takes a LOT of development
time to get the object/database interactions correct. And the flexibility
benefit is lost between the additional dev time and the intollerence for
mistakes in data entry (since the database basicly controls the object model).

3. Add a .Properties proeprty to your base object which is a Hashtable or
keyed Collection. Then you can just access values via key name.

-Boo
I have a question regarding dynamic properties.

I have an Object say

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
This is in a Application Service Provider Model, so say Client 1 has
only those properties available for account.

NOW Client 2 has some additional requirments

That may look like so

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Entity
--ParentId
--LastContactDate
The Third Client may have these requrments

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Source
--HairColor
I am using .Net 2.0 with SQL 2005 for the Data, and DAAB for the DAL,
but IBatis or NHibernate are also options, and I am familiar with the
usage of both.

All of the above are the same through Suffix, but I would like to be
able to dynamically assign properties to these objects, the DAL can
support it so there is no problem there.

ON the interface layer I dont have a problem dealing with these, so no
problem there , my question is at the object level what is the most
EFFICIENT way to deal with these ?

What is the best (or any way and I can decide later) the best
implementation of allowing a "Per Client" config of properties on
several core objects, say Account, Transactions, Orders, Contacts, etc
?

I have several working possibilities, but quite frankly would like
some feedback before I implment this in production, some of the
solutions I have seem a little heavy handed.

I am seeking feedback on options I may not have sen, thought of or
pursued.

Thanks

Chris

Jul 24 '06 #2
Thanks, I was pretty much on the same path as number 2 but I have to
agree thats what I have seen thus far with its limitations. I want to
make this as simple of an extension as possible.

On that note could you elaborate a little more on the first option ?
I am 90% sure I know what you are saying but I must be missing a little
something.

Thanks

Chris

GhostInAK wrote:
Hello cw******@gmail.com,

Three methods come to mind at once.

1. A base object that implements all the common fields plus one property
(lets call it .ClientExtensions). Then, for each client, build a new object
that you can assign to .ClientExtensions. Then use reflection (or the database)
to figure out whats in them.

2. Build your object assembly for each client dynamicly using System.Reflection.Emit
namespace. This is the method the company I work for has chosen for one
of our projects. It works quite well, but it takes a LOT of development
time to get the object/database interactions correct. And the flexibility
benefit is lost between the additional dev time and the intollerence for
mistakes in data entry (since the database basicly controls the object model).

3. Add a .Properties proeprty to your base object which is a Hashtable or
keyed Collection. Then you can just access values via key name.

-Boo
I have a question regarding dynamic properties.

I have an Object say

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
This is in a Application Service Provider Model, so say Client 1 has
only those properties available for account.

NOW Client 2 has some additional requirments

That may look like so

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Entity
--ParentId
--LastContactDate
The Third Client may have these requrments

Account
--Id
--Prefix
--Fname
--Lname
--Suffix
--RecordType
--Source
--HairColor
I am using .Net 2.0 with SQL 2005 for the Data, and DAAB for the DAL,
but IBatis or NHibernate are also options, and I am familiar with the
usage of both.

All of the above are the same through Suffix, but I would like to be
able to dynamically assign properties to these objects, the DAL can
support it so there is no problem there.

ON the interface layer I dont have a problem dealing with these, so no
problem there , my question is at the object level what is the most
EFFICIENT way to deal with these ?

What is the best (or any way and I can decide later) the best
implementation of allowing a "Per Client" config of properties on
several core objects, say Account, Transactions, Orders, Contacts, etc
?

I have several working possibilities, but quite frankly would like
some feedback before I implment this in production, some of the
solutions I have seem a little heavy handed.

I am seeking feedback on options I may not have sen, thought of or
pursued.

Thanks

Chris
Jul 24 '06 #3
Hello cw******@gmail.com,

>1. A base object that implements all the common fields plus one
property
(lets call it .ClientExtensions). Then, for each client, build a new
object
that you can assign to .ClientExtensions. Then use reflection (or
the database)
to figure out whats in them.
2. Build your object assembly for each client dynamicly using
System.Reflection.Emit
namespace.
#1 is a hybrid of #2. You would code up a static library (DLL) that contained
your class. Then build a database model into which you will store the definitions
of each client's proprietary properties. Upon change of a client's definition
of their properties, build a dynamic DLL (using System.Reflection.Emit namespace).

Your class in the static library would contain all the shared properties
plus any common actions that may take place on the data as well as a property
(lets call it .ClientExtensions for now). This .ClientExtensions property
would accept any object. At runtime you create an instance of the dynamic
client class and an instance of the static class.. you assign the dynamic
object to the static's .ClientExtensions property.
I gotta say, option #3 (just using a hashtable) seems like much much less
work, is extensible, and provides a much higher return on investment.

-Boo
Jul 25 '06 #4
Im going to have to agree......

It just seem, I dono unclean for some reason.....

Oh well, thanks much for your input.

Chris

GhostInAK wrote:
Hello cw******@gmail.com,

1. A base object that implements all the common fields plus one
property
(lets call it .ClientExtensions). Then, for each client, build a new
object
that you can assign to .ClientExtensions. Then use reflection (or
the database)
to figure out whats in them.
2. Build your object assembly for each client dynamicly using
System.Reflection.Emit
namespace.

#1 is a hybrid of #2. You would code up a static library (DLL) that contained
your class. Then build a database model into which you will store the definitions
of each client's proprietary properties. Upon change of a client's definition
of their properties, build a dynamic DLL (using System.Reflection.Emit namespace).

Your class in the static library would contain all the shared properties
plus any common actions that may take place on the data as well as a property
(lets call it .ClientExtensions for now). This .ClientExtensions property
would accept any object. At runtime you create an instance of the dynamic
client class and an instance of the static class.. you assign the dynamic
object to the static's .ClientExtensions property.
I gotta say, option #3 (just using a hashtable) seems like much much less
work, is extensible, and provides a much higher return on investment.

-Boo
Jul 25 '06 #5
Hello cw******@gmail.com,

Of the options presented it's not terribly unclean. You lose intellisense
at design time.. but then, you prolly wont be coding against the client-specific
property values at design-time anyhow. You lose strong-typedness.. but VB's
late-binding will take care of that. It's really not a bad option.

-Boo
Im going to have to agree......

It just seem, I dono unclean for some reason.....

Oh well, thanks much for your input.

Chris

GhostInAK wrote:
>Hello cw******@gmail.com,
>>>1. A base object that implements all the common fields plus one
property
(lets call it .ClientExtensions). Then, for each client, build a
new
object
that you can assign to .ClientExtensions. Then use reflection (or
the database)
to figure out whats in them.
2. Build your object assembly for each client dynamicly using
System.Reflection.Emit
namespace.
#1 is a hybrid of #2. You would code up a static library (DLL) that
contained
your class. Then build a database model into which you will store
the definitions
of each client's proprietary properties. Upon change of a client's
definition
of their properties, build a dynamic DLL (using
System.Reflection.Emit namespace).
Your class in the static library would contain all the shared
properties
plus any common actions that may take place on the data as well as a
property
(lets call it .ClientExtensions for now). This .ClientExtensions
property
would accept any object. At runtime you create an instance of the
dynamic
client class and an instance of the static class.. you assign the
dynamic
object to the static's .ClientExtensions property.
I gotta say, option #3 (just using a hashtable) seems like much much
less work, is extensible, and provides a much higher return on
investment.

-Boo

Jul 25 '06 #6

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

Similar topics

3
by: Guy Harwood | last post by:
Hi, I have designed a textbox that inherits from the System.Windows.Forms.Textbox control. when the control is readonly the back color changes to a light blue to indicate that it is frozen. ...
1
by: jm | last post by:
I am using (trying) dynamic properties to store a database connection. However, I don't have a connection object on the form. I just do a OdbcConnection in my code. So I can't use the VS IDE to...
2
by: Codex Twin | last post by:
Hi I am designing a class (Q) which will contain provision for dynamic complex properties. For example, these properties could be any or all of the following complex properties: a)...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
5
by: Nate | last post by:
Good Morning All, What we have is a dynamic business object that has varying numbers and types of properties. What it models is a generic saleable product. Not all products have the same...
3
by: cwertman | last post by:
I have a question regarding dynamic properties. I have an Object say Account --Id --Prefix --Fname --Lname --Suffix
0
by: vnu | last post by:
Hi, Hi, I am working in .net emvironment using vs2005 and vb.net as the language. In one of my project, I need to display the properties of a com object which has dynamic properties(late bind...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
15
by: EDBrian | last post by:
My problem is this. Our clients create different fields they want to collect and we allow them build dynamic filters, reports etc... We run some TSQL to actually create the column and all works...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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
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: 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...

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.