Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Business logic in JavaScript. Fat client vs thin client

Is it a good idea to implement business logic on the client side with JavaScript?

What kind of logic should be there? Validation Logic? Related to GUI?

What would you do if the same logic want to be used in another application (exposed) implementing it in JavaScript would mean you can't reuse that logic.

On the other hand having all logic on the server side would mean more requests to the server.

What do you think?

like image 808
Alfredo Osorio Avatar asked Nov 10 '10 15:11

Alfredo Osorio


People also ask

What is the difference between fat client and thin client?

The biggest and most obvious difference between the two is that thin clients rely on a network connection for computing and don't do much processing on the hardware itself. Thick clients don't need the constant network connection and can do much of the processing for client/server applications.

Is business logic performed on the client side?

Business logic contains business rules. Application logic (and presentation logic) can be implemented on client-side. Business logic only on server-side. Thank you for answering a question on stack exchange!

Why are thin clients preferred over thick clients?

They are more secure than thick client systems when it comes to security threats. In Thin clients the system management is much easier as there are centralized servers. With the help of centralization, there is optimization of hardware and maintenance of software is also comparatively easier.

What is business logic in Javascript?

Kinvey Business Logic is a node. js code execution runtime that allows you to customize the behavior of requests to your backend by providing a means to implement server-side business logic.


1 Answers

One should never ever trust the client. Thus, any validation you do on the client side with JavaScript can only be to improve user convenience and usability. You always have to validate incoming data on your server later to make sure nobody injects data etc.

like image 50
Kissaki Avatar answered Sep 18 '22 18:09

Kissaki