Greg,

I think what you would rather do is to bind your controls to a business
object rather then a dataset. This way the property procedures can have
business rule logic that fires when the data in the control is changed.

Later I will send you an example of business objects that support data
binding.

Keith

-----Original Message-----
From: Greg Gates [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 11:09 AM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Dataset not very useful in this scenario

Hi:

I have asked a similar kind of question to various newsgroups without
any
luck as far as a reply. I have considered the possibility that it is
either
a dumb question or an incoherent question. If that is the case, my
apologies.


I have come to the conclusion that the dataset is not very useful when
you
want a rich client windows interface and the business logic located on
the
client machine in a separate DLL.

If I have a business object that allows the UI to obtain a reference to
it's dataset field, my data is essentially not encapsulated. Sure, I
could
have events in the business object that executed validation logic in
response to changes in the dataset initiated by the UI, but what would
stop
the UI from also hooking into the dataset events with different logic.

If I have a business object that returns a copy of the dataset to the UI
and accepts the modified dataset in return, that would work for certain
scenarios. (This is the approach used in almost all the examples I have
seen)

A problem arises when immediate feedback is required by the UI. By
immediate, I am talking about validation occurring after a change in
each
field, not just after the the entire row is edited and submitted for
validation. As the client has only a copy of the dataset, the business
logic can't respond to changes until a submission of the data has been
made.
I suppose the UI could call  Validate(DataSet ds) after each field
change,
but that seems very wasteful as the same business rules would be
evaluated
numerous times unnecessarily.

Is there a solution to this dilemma?


thanks, Greg

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to