Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2004

Tip: Looking for answers? Try searching our database.

Dynamic Properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Demetri - 28 Dec 2004 02:49 GMT
I would like to know if anyone can suggest how to implement the following:

We need to have classes who's properties are defined by a database. The
properties can not be hard coded. In addition properties datatype will also
be defined by the database and are subject to change in the future. So a
property that may return an int could in the future return a bool value.

Two questions:

1. How do you implement said senerio?

2. How do you implement it in a such a way that if the return value changes
your application can roll with it rather than causing an exception?

--Demetri
Cowboy (Gregory A. Beamer) - MVP - 28 Dec 2004 03:21 GMT
Using standard coding techniques, you are pretty much lost. In .NET, however,
you do have a very real option using Reflection and code generation.
Reflection.Emit is what you want to examine. It allows you to take code
created on the fly and compile in memory and use in your process. If the
dynamic classes are called again, you do have the option of saving off the
code. Not the easiest to implement, but flexibility is always a bit more time
consuming.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> I would like to know if anyone can suggest how to implement the following:
>
[quoted text clipped - 11 lines]
>
> --Demetri
Daniel Faensen - 28 Dec 2004 08:49 GMT
> I would like to know if anyone can suggest how to implement the
> following:
[quoted text clipped - 14 lines]
>
> --Demetri

There are some publications that could be helpful for you:

Yoder J.W.; Johnson, R.: The adaptive object-model architectural style.
http://www.adaptiveobjectmodel.com/WICSA3/ArchitectureOfAOMsWICSA3.htm

Riehle, D.; Tilman, M.; Johnson, R.: Dynamic Object Model. PLoP 2000

At least you should have a look at http://www.adaptiveobjectmodel.com/

Daniel
Bishoy Ghaly - 31 Dec 2004 17:11 GMT
From what you said i suppose you need variant datatype which in .NET is the
object class which is able to store (box) any datatype .
please give more details in order to help in the design

>> I would like to know if anyone can suggest how to implement the
>> following:
[quoted text clipped - 25 lines]
>
> Daniel
Cor Ligthert - 28 Dec 2004 09:28 GMT
Demetri,

What you want is in my opinion late binding. You can do that using Option
Strict Of in VBNet or reflection in another program language. However keep
in mind that both will decrease your performance.

Cor
James Curran - 29 Dec 2004 21:05 GMT
   Define what you mean by "Properties"..

   What you describe differs in many respects from "Properties" as defined
in C#. Before we can give you any meaningful answer, we need to know what
features of C# properties are needed in these "Properties".   (Notably, we'd
need to know how & where you plan as access these properties)

Signature

Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com       Work: www.njtheater.com
Blog: www.honestillusion.com  Day Job: www.partsearch.com

> I would like to know if anyone can suggest how to implement the following:
>
[quoted text clipped - 11 lines]
>
> --Demetri

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.