Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can one class set a property to be seen by another c
Message
 
 
To
27/02/2013 13:05:31
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01566989
Message ID:
01567063
Views:
27
>>>You can't. The Application class is NOT it's parent - it's just holding a reference to it. Countless other classes might also hold a reference to the same object.
>>
>>Any other way around this problem? E.g. in the application class I want to keep a reference to Database class, but from Database class I want to set properties of the application class?
>>
>>If, say, I add similar (or same) properties to the database class, can I somehow signal to the application class when database is setting its properties, so I can update application class properties?
>
>Having skipped quite a few posts in between so possibly off base, but might not a singleton pattern be the answer that was really needed when you talked about static class ? Benefit of singleton being easily modifiable, and being the "single datastore" when queried from many sources/classes ?

I am not sure I understand, can you demonstrate your idea with examples?

Basically, right now we have

MiddlewareBase - base class

Database - not based on anything - has some specific methods such as executing sql command

MiddlewareMain - this class is based on the "Base" class and it invokes the methods using invoke string parameter

Specific classes that implement these methods, such as "Sales" - this is the class I am working on and finished with the implementation of all methods (about 40+) already.

So, my immediate problem is that I want to toss Invoke string around. My bigger problem is that I want to get rid of OUT parameters in the database class and somehow utilize that new object properties instead.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform