3 ms·
> Why not? On UI layer I can always do: var response = bl.sendMessage("account.validate", accountData); if( response && response.valid) ... else if
by lmm 6y ago
> Why not? On UI layer I can always do:
var response = bl.sendMessage("account.validate", accountData);
if( response && response.valid) ...
else if( response && !response.valid )
Like I said, you're no longer encapsulating the validation in the component, where it logically belongs from a business point of view. You're being forced to distort your architecture for these operational concerns. And it gets worse as your structures and UI get more complicated - e.g. if I want to validate several fields within a single database transaction, that's the sort of thing that Rust's ownership system is ideal for - each datastructure can know how to validate itself given a borrowed connection handle.
> Again, we are doing the messaging for years now, AJAX/REST are messaging protocols ...
Yes, and the overhead of having to serialise everything is the biggest problem with web UI. If you're going to separate the UI from the business logic like that then why even bother making a native UI at all?