473,467 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

best way to track field and property changes?

PJ6
What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?

Paul
Aug 27 '07 #1
3 2584
On Aug 27, 3:52 pm, "PJ6" <no...@nowhere.netwrote:
What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?

Paul
Is this object one you created or one you don't have the source
available to? The simplest way to track changes (imo) is to fire an
event from the Set accessor of the property if the value changed. If
you can't modify the source, perhaps you could inherit the class and
add the functionality? If you don't have the source, and can't inherit/
override the properties things will be more difficult.

Thanks,

Seth Rowe

Aug 28 '07 #2
PJ6 wrote:
What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?
If you take the Windows Controls as an example, they all seem to sport
lots of *Changed events that get raised when the associated Property is
... er .. changed (e.g. TextChanged, SelectedIndexChanged, EnabledChanged).

"track changes to an object's public /fields/"?
Not a chance. If you expose a field, then you won't have the slightest
idea how or when it gets changed. Wrap it up in a Property.

HTH,
Phill W.
Aug 28 '07 #3
PJ6
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:fb**********@south.jnrs.ja.net...
"track changes to an object's public /fields/"?
Not a chance. If you expose a field, then you won't have the slightest
idea how or when it gets changed. Wrap it up in a Property.
Yep, that's what I thought. No getting around having to use IL... but this
will solve a problem I've been thinking about for years. More advanced than
I would have liked, but probably worth the investment.

Paul
Aug 28 '07 #4

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

Similar topics

1
by: JLuppens | last post by:
Does anyone know if there is a way to track changes in a text field like word does? I am using a SQL2000 database and can use either VB.Net or Access. The field is either ntext or Varchar. I...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
2
by: Uwe Range | last post by:
Hi to all, I am developing a database where, with time, it proved to be necessary to keep track of the changes to the data. It is fairly easy to keep track of the time when a record was changed...
9
by: Alfred Taylor | last post by:
I'm testing the waters of n-tier development and I ran into a scenario that I'm not sure what the best solution would be. I have a Company object which contains a collection of contacts retrieved...
5
by: Daniel Walzenbach | last post by:
Hi, I need to track all changes made to an object. Consider the following class: Public Class Dog
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: Tomas | last post by:
Hi, I am a VB.NET newbie that would like to know the best practise when working with objects and undo user changes to objects properties. Problem The system allows the user to change...
2
by: De_Cisse | last post by:
Hi all, I'm working on an application in which I already make some preparations to be able to work in a frontend and backend database, even if this isn't the issue a this moment. I'm using VBA...
3
by: dirksza2009 | last post by:
Hi, I've made a multi user (4 end users) database in Access 2000. I've made data tables, reference tables etc which sits on a shared drive and I've made individual front ends for the end users...
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
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.