vendredi 27 janvier 2017

What design patter / general approach should I use?

I've wrote a JavaScript (Node.JS) crawler, however although it does work, it does not satisfies me. The code I produced is not what I could qualify as elegant, scalable or really read-able.

I would like to rewrite it using a design pattern and a more elegant approach (with OOP), however I am quite new to this aspect of programming and does not know what should I chose.

Basically my application is designed like this:

  • A home page which displays the crawler results according to filters chosen by the user
  • A crawling page where you can refresh the results (only each x hours to avoid overloading the server)

So far I implemented a very basic architecture using an app.js, my_route.js and views/*.pug ; my_route being either home or crawl.

What would be the best approach to this? I would like to chose a DP and a few ideas on how should I implement OOP (what classes should do what etc).

Thanks,

Aucun commentaire:

Enregistrer un commentaire