Posts

Showing posts from February, 2020

Microservices and Node.js

Microservice and Node.js is one such software stack that enables modern-day organizations to achieve agility, protection, scalability and superior performance. Microservices or Microservice Architecture is a software design pattern (style) that splits the whole system into smaller, autonomous, and usable units, each able to run and scale independently. The term is widely used by world-renowned companies such as Uber, Netflix, Amazon, eBay, Groupon, etc. Certainly embracing microservices brings more business value but, at the same time, it requires a stable and secure technology like Node.js to develop apps without complexity. What is Microservices ? Microservices enable developers to develop software in small pieces. One of the important features of microservices is that the different teams can write each component of the application in different programming languages. The main idea behind Microservices is to create small, functional pieces of an application tha...

Closure Scope Chain

A closure is the combination of an enclosed structure with references to its surrounding state.A closure from an inner function gives us access to the domain of an external function. Closures are generated in JavaScript any time a function is created, at the time of creation of the feature. We have three scopes for each closure:          Local Scope (Own scope)          Outer Functions Scope          Global Scope A common mistake is not to understand that in the case where the outer function is itself a nested function, access to the scope of the outer function requires the outer function enclosing domain, effectively creating a chain of function scopes. EXAMPLE // global scope let a = 10; function sum(x){   return function(y){     return function(z){       // outer functions scope     ...

Solid Principles in java with examples

SOLID is one of the most popular sets of design principles when developing object-oriented software. It is a mnemonic acronym for the five design principles which follow: S ingle Responsibility Principle O pen- Close Principle L iskov Substitution Principle I nterface Segregation Principle D ependency Inversion Principle 1) Single Responsibility Principle (SRP) The Single Responsibility Principle (SRP) states that a class should only have one responsibility. Additionally, it should have just one reason to change. A lot of members can exist as long as they relate to the single responsibility. It could be that multiple class members may need modification when the one reason for change occurs. Multiple classes may need to be updated, too. Example: class Movie{      public String author(){...}      public void displayDetails(){...}      public void updateMovie(){...} } Here we have logic...