Java Basic things to know

___________________________________

|    Classes – variables – methods :       |
___________________________________

private :  allow access only to the current class.

public : allow access to everybody regardless of the package.

protected : allow access only to subclasses or class of the same package.

default : allow access only to class of the same package.

transient : variable is not a part of a persistent object

final : class can’t be extended, method can’t be overriden and variable can’t be reinitialised.

static : class variable and not instance of class variable (useful for class constant used with final), class method can be called without create an instance of the class,

volatile : indicates that a thread must reconcile its working copy of the field with the master copy every time it accesses the variable.

__________________________________

|              Classes – Interfaces :             |
__________________________________

Implements : a class can implements several interfaces, but can extend only one class.

Extends : a class can only extend one another class, interface can extend an another interface.

Interfaces and Abstract classes  do not need to fully implement the interfaces they respectively extend or implement

______________________________________

|         Collections :   Set, List & Map :             |
______________________________________

Set : contains unique objects and no null elements are inserted.

HashSet : (Faster) but there absolutely no order.

TreeSet : (Normal) Object inside the set must implement the Comparable interface and compareTo method.

LinkedHashSet : (Slower) The order is respected regarding the order of objects inserted.

List : could contains null elements and duplicated objects, the order how the elements has been inserted is keeped.

ArrayList : (Faster) To get indexed element.  (Slower)  To delete or insert element.

LinkedList : (Faster) To remove or insert element.  (Slower) Have to traverse the list to get an element.

Map : contains a pair of element of key/object.

HashMap : No ordering.

TreeMap : Key ordering.

LinkedHashMap : Preserves the insertion order.

HashTable : is a synchronized hashmap.

______________________________________________

|      Interface:   Comparator & Comparable :        |
______________________________________________

Comparator :  To implement as an utility to compare two objects and override compare() method;

Comparable :  To implement on the object to compare and override compareTo() method;

Node JS

What is nodeJS ? Why use it ?

NodeJS is lightweight framework wich is scalable, non-blocking I/O model and written to be the most fast and efficient network application.

In order to use efficiently NodeJS, you might install NPM (Node Package Manager) to download and manage some required modules within your project. (Ex: Underscore, Backbone…)

Recently, i heard that Bower is a package that you can install throw NPM in order to help you in a better way to manage the dependencies inside your project; the difference between NPM and Bower is that the first one manage the dependency in a nested way while the second one use a flat dependency tree in order to avoid problems. This is for the Front end code.

A good example of an application using NodeJS and some module like Dust (Templating motor), Bower, Bootstrap (lightweight framework for building multi-platform app with some components as navbar, buttons…) and Kraken which extends ExpressJS (Useful Framework for building single and multi-page or hybrid web application with a well organized structure) is the Paypal application.

See this interesting article : http://www.infoq.com/news/2013/11/paypal-java-javascript

They build 2 projects one in a Java/Spring way and another with NodeJS.
They needed 5 months for each one but they obtain more performance for the project written in NodeJS, and now it’s more scalable.

 

Additional info :

Grunt is a javascript framework which helps you in the repetitive tasks as Maven in Java.
Mocha is a test framework as Jasmine.