jeudi 20 septembre 2018

ExpressJS/NodeJS and Object Orientated Programming

I'm new to the industry, but it seems like most companies seem to test/emphasize OOP knowledge heavily during the interview process even when their stack is based mostly in javascript/NodeJS/typescript.

I'm confused how this would be applicable to developing backend applications/APIs using a framework like ExpressJS?

For example, a sample GET route in pseudo code:

app.get('/', async(req, res) => { 
  const exampleData = await database.querySomething()
  res.send(exampleData)
})

It seems to me the coding style for creating these REST APIs is somewhat procedural. E.g. receive a request, make some database action or query based on the parameters, add in calculations/data wrangling, send back the final data.

Where does OOP come into play? What would be a use case for OOP in back end nodejs applications?

Aucun commentaire:

Enregistrer un commentaire