Hi,
Just want to trigger your thought process on the above topic.
NodeJS & JavaScript is emerging as strong contender and alternative to J2EE for and real time as well as enterprise applications to some extent in view of the following
- JAVA , J2EE is 20 year old technology and bulky and needs massive JVM, J2EE server, build systems , IDEs etc. NodeJS is small (15 MB) light weight easy to get started with especially for smaller and real time application.
- JAVA’s threading and synchronization issues are avoided with NodeJS’s single threading approach.
- Though JavaScript gives rise to other issues like its asynchronous execution, call back hell and depth of nesting etc, but new extensions such as async are available now to bring synchronicity when ever required. Each language has its own strengths and weeknesses.
- With ES6 extensions JavaScript is becoming a strong yet simple language. You can achieve a lot with a few lines of JavaScript code (some of the NPM’s are 10 , 20 lines of code). Where as there is a famous joke about JAVA , that if you want an API for banana in JAVA , you get gorilla holding the banana and the entire jungle behind the gorilla.
- Being Interpreted language, its easy to run and debug the JavaScript code. Just refresh the browser to run the code in browser, or on server nodemon will automatically restart on a code change. JAVA will involve re build and rerun to debug/ correct a small error.
- NodeJS has few 100 thousand NPMs , you can pick and choose the ones that you want for your application. Some very useful libraries such as Socket.IO, file system, web RTC, websockets etc.are available.Most libraries have both synchronous and asynchronous versions. NodeJS is even coming out with scientific library for use in scientific applications. Its not an immature community!
- JavaScrpt’s is defacto standard for client side scripting for dynamic pages since its beginning, in fact it was designed for it initially as DOM manipulation language in the browsers. With advent of Canvas/ SVG/ WebGL standards and client frameworks like Angular/React/Vue it has become even more powerful for client side programming.
- NodeJS gives a seamless single programming environment on client as well as server side for developing full stack applications.
- What’s the support for JAVA in future? It has changed hands from SUN to ORACLE to who next? IBM? We don’t know. Where as NodeJS is built on Google’s JS V8 run time and NPMs are open source.
In summary, in my opinion, NodeJS and JS are emerging as a serious contender and alternative to J2EE for certain type of applications such as real time and small footprint applications requiring low system resources and fast response. J2EE is and overkill for such applications. The advantages of NodeJS over J2EE far outweigh the disadvantages for such real time and light weight applications in my opinion. Of course there will be resistance from legacy users of J2EE who will try to laugh if off and brush aside and snub the NodeJS community, due to fear of unknown and in order to defend JAVA, but in my opinion both technology will coexist but newer ones will prefer NodeJS as far as possible as its advantages far out weigh its disadvantages. Your reaction is welcome.
best regards