M
msnews.microsoft.com
On of the nice aspects of a business object and localizing all the logic for
validation / updates in a single object is that it lightens the load for the
UI deveoper not to have to worry about such issues.
So, for example, lets say that an Order that isn't an odd lot can't be
submitted to the BE. Ideally I would want to bind the Size property to a
sizeTextBox and an IsValid property to the submitButton. This way, if any
rules are broken (and the size is not % 100) the send button won't enable.
This provides real nice encapsulation. But on the flip side, setting the
Size in the object will ALSO notify all the bound controls of the new size.
That is undesirable. Becasue, for example, if there was an order blotter, I
wouldn't want it to update also.
The problem becomes more difficult when you think about the following
situation ... an order with a size of 100,000. I open the order entry screen
and change the size to 50,000. Then, while I am editing the object, the
order size (lets say from a different trader) is changed to 200,000. If I
had the order blotter open, I should see that change (and prob be notified
in the order entry screen that the size chagned, but that is a different
story.)
So while I agree that the buiness object approach is a great way to go, I am
having difficulty resolving issues like the one mentioned above.
So ... was wondering if anyone else has worked on such problems ...
validation / updates in a single object is that it lightens the load for the
UI deveoper not to have to worry about such issues.
So, for example, lets say that an Order that isn't an odd lot can't be
submitted to the BE. Ideally I would want to bind the Size property to a
sizeTextBox and an IsValid property to the submitButton. This way, if any
rules are broken (and the size is not % 100) the send button won't enable.
This provides real nice encapsulation. But on the flip side, setting the
Size in the object will ALSO notify all the bound controls of the new size.
That is undesirable. Becasue, for example, if there was an order blotter, I
wouldn't want it to update also.
The problem becomes more difficult when you think about the following
situation ... an order with a size of 100,000. I open the order entry screen
and change the size to 50,000. Then, while I am editing the object, the
order size (lets say from a different trader) is changed to 200,000. If I
had the order blotter open, I should see that change (and prob be notified
in the order entry screen that the size chagned, but that is a different
story.)
So while I agree that the buiness object approach is a great way to go, I am
having difficulty resolving issues like the one mentioned above.
So ... was wondering if anyone else has worked on such problems ...