Client-side business logic

Why do people say that business logic should be implemented on the server side (for example, EJB), and not on the client application code?

An example that I mean is validation of a business object in an EJB architecture. Is it necessary to delegate it to EJB or is it normal to run it on the client before the object is sent to the server, which will be saved?

+3
source share
4 answers

Validation can be performed on the client side to maintain feedback on the server. But the server must also perform the same check. Ideally, you can reuse the same classes on both the client side and the server side.

+10
source

There are two reasons. First, you will probably have the same business logic for multiple clients, so it makes sense to talk about it on the server. Secondly, you most likely cannot trust the client, which means that server validation is important.

+6
source

, - (, EJB), ?

, / ( ) . , - , . ( ) .

, , - EJB. EJB , ?

- , ( " " ) , . ( , , ..).

+5

, , .

, (, /)

, , HTML, json.

If the business rules were on the client, you will have to copy them to the new client.

Now do not confuse validation rules with others. They should also be placed on the client side.

+1
source

Source: https://habr.com/ru/post/1749596/


All Articles