If you ever wander around the web development community, you might have encountered the term REST
sometime. In this article, let’s demystify the concept and see how this architecture has been getting more and more popular in recent years!
Imagine you are working as a backend developer. After a bunch of logic operations and database queries, you get an object type Person
, which you want to return to frontend. However, you have to return it as a JSON object instead of a Person
object, since it is the standardized protocol in transferring data.
Without external libraries, you will have to do it this way:
class Person:
def __init__(self, name, age):
self.name = name
self.age = ageperson = Person(name='Bill', age=19)
return_value = {
'name': person.name,
'age': person.age
}
You might also come across this problem when working with databases…
Note: as this article only focuses on Relational Database Management Systems (RDMSs), e.g MySQL, PostgreSQL, SQLite,…, in the scope of this topic, the phrase ‘databases’ will be associated with relational databases only.
Once upon a time, …
A long time ago, when humanity has yet to know about something called ‘ORM’, every time developers wanted to interact with databases (create, read, update, and delete data in tables), they had to write raw SQL queries and executed them in the program using connectors. …
CS & Math @ Conn