Actually, BindUtils
can be more powerfull then @NotifyChanged
If you are gonna use it in the same way I don't think there is a big performance difference.
The only big difference is that @NotifyChange
only works on setters and commands and that BindUtils
can be called from each method.
Now, when will there a difference?
Assume you have a list what you get with this :
public List<User> getUsers() {
return users;
}
Assume that we have buttons next to each user and the button fires a command that changes that user (like blocking that user)
What we can do is put the @notifyChanged("users")
what will mean in zk asking getUsers();
If we use BindUtils
we can do the following :
BindUtils.postNotifyChanged(null,null,user,"*");
or
BindUtils.postNotifyCHanged(null,null,user,"blocked");
Even we don't have a getter for that user in our VM this will still be executed and only that user in the whole list will update.
With the first command all data is refreshed, with the second only the blocked is updated.
Now the second isn't always possible cause maybe you don't know what field or all fields are updated but still you update 1 user in stead of getting all x users.