RESTful? Be careful...
Well, I've seen more misuse of REST than the core idea being used correctly.
In simplest terms, REST recommends to offer the illusion of the presence of simple objects that are manipulated - as per the APIs. This helps the clients have a simpler model in their head.
Here is where things go terribly wrong...
It specifically avoids talking about your core business logic - only because it changes radically amongst applications. Thus, it's very hard to provide any recommendation on how to build it (in the context of the API consumers).
The best guidance offered by REST is - Despite the complexity of the business logic, don't expose them outside to the client. Have an illusion of simple objects built - and keep the client in the dark.
If this isn't consciously done, as the business logic changes, the clients need coordinated changes - which many times isn't possible either.
Thus, conscious thought creates a solid barrier between the client and the server.
Where do I see nonsense piling up?
Every single table is exposed as REST API. This is BS. Why? You strip the business logic completely of the backend, and just expose your SQL as a different language if you expose your tables as is.
This results in the client understanding the business logic - many times just owning it completely. This is pure nonsense. It's always best to have thin clients - and reserve control over the logics - because many times business needs to iterate quickly.
To the extent I know, this was never the intent of REST at all.
Drop in your comments on whether this makes sense to you. In case there's disagreement, let's discuss that too.
#coding
#CodingJourney
#CodingLife
#SoftwareEngineering
#softwareapplicationdevelopment