|Interdependent attributes [message #552874]
||Fri, 13 August 2010 23:06
Registered: July 2009
I have two int attributes A and B in my EMF model which need to follow the rule A + B <= 200. If A is 150 and B is 50 and then A is changed to 155, I want to set B automatically to 45. Similarly if B is changed to 55, A should be changed to 145 automatically.
I currently have all this logic for ensuring the <= 200 rule in my UI code. Is there a way to do this in the model? that is, if A is changed in the model, value of B should be adjusted automatically and vice versa, and also a notification should be sent to the UI when A or B is automatically changed so that the UI can display the new value.
If this can be done, my automated tests will be much simpler because they won't be UI-based any more.
Powered by FUDForum
. Page generated in 0.01583 seconds