Posts

Showing posts from 2020

ER- Diagram

Image
ER Diagram for the group project

Project

Link for the project: https://github.com/HansikaSamaraweera/Online-Shopping-Cart These technologies have been used in designing the project Frontend: React Backend : Springboot Functions; Add Category My Account Wishlist and Offers                

RESTful Web Services with Node.js and Express

What APIs? APIs (Application Programming Interfaces) allow consistent communication between software applications and other pieces of software. Either to connect internally to an application component, or to connect externally to a service. The production of API- based modules and services is also a great way to achieve scalability and flexibility, because it allows us to build several applications based on modular and interchangeable modules, enabling scalability and maintenance facilitation. Node.js Node.js is a server-side programming environment operating on JavaScript. Within that framework, we can use JavaScript to create our apps, our REST APIs, and use its APIs to invoke external services. This point is especially supporting more robust front-end applications, most backend services are now being built as simple APIs. If it’s online, mobile, or desktop, they are all feeding back to a single API. Developers should already familiar with JavaScript, making the t...

ReactJS Props Validation

If we need immutable data in our component, we can simply add props to reactDOM.render() function in main.js and use them within our component. Validation of properties is a valuable way of forcing good use of the components. This will help to avoid potential bugs and problems during development, once the application is larger. It also makes the code more readable, since we can see how to use every variable. Custom validators and collections We can also use custom validation functions with PropTypes.arrayOf and PropTypes.objectOf . Used in this way, the custom validation function will be called for each key in the array or object. Nevertheless, instead of three custom validation features will take five arguments.   propValue : The array of object itself key : The key of the current item in the iteration   componentName : The name of the component   location : The location of the validated data. It is usually “prop” propFullName : The fully resolv...

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...