Software Virtualization tutorial in cloud computing

The tutorial provides the software virtualization concepts, advantages of software virtualization in the cloud computing environment The tutorial is useful for both beginners and professionals.

What is software virtualization ?

  • The software virtualization in the cloud computing also called the application virtualization.
  • The software virtualization is the mechanism which is similar to the virtualization process except that it abstracts the software installation procedure and creates a virtual software installation.
  • Each virtual machine is provided the virtual software for processing the application requests. Virtual Box,
  • Virtualized software is an application that will be “installed” into its own self-contained unit.
  • Software Virtualization.examples: VMware , Virtual Box

Advantages of Software Virtualization

  • provides easy client deployment process
  • provides easy software upgrades as each virtual machine uses the same software virtually
  • provides easy and quick software migration among platforms

Top 10 Popular virtualization software

Virtualization SoftwareHost OSGuest OSPrice
Microsoft Hyper -VWindows 64 bitWindows,
Linux
Free
Redhat Virtualization Linux Windows,
Linux
Free
VMWare Workstation PlayerWindowsWindows,
Linux,
Mac OS
Paid
VMWare FusionMac OSWindows,
Linux,
Solaris,
Netware
Paid
Oracle VirtualizationWindows,
Linux,
Mac OS ,
Solaris
Windows,
Linux,
Mac OS ,
Solaris
Free
QEMUAnyAnyFree
Apple Boot CampMac OSWindowsFree
Virtual BoxWindows,
Linux,
Mac OS
Windows,
Linux,
Mac OS
Free
Parallels DesktopMac OSMac OSPaid
Xen ProjectLinux
Windows
works with
hyperscale cloud
FreeSoftware VirtualizationSoftware Virtualization


Server Virtualization tutorial in cloud computing

The tutorial provides the detailing on the Server Virtualization concepts in the cloud environment, types of server virtualization, advantages and usage of server virtualization

What is Server Virtualization ?

Virtualization means “Virtual” and not actual. Virtualization is the technology through which multiple simulated environments or dedicated resources are shared from a single physical hardware. Read what is Virtualization ? for more details.

Server Vitalization is the concept of utilizing the Physical Server resources more efficiently by dividing into multiple unique and isolated Virtual Servers. Without Server Virtualization, the physical server workload was not distributed to the full server capacity and thus servers were underutilized with respect to resources.

Server Virtualization allows each virtual server to act as physical server by running its own applications and operating system. This increases the overall performance for request processing, optimum utilization of resources and thus increasing the overall capacity of each physical server.

Types of Server Virtualization

The below given are the Server Virtualization Types:

1) Full-Virtualization: Full Virtualization is the type of Server Virtualization which uses HyperVisor which acts as the layer between the operating system and the hardware. The HyperVisor are classified into below 2 types:

  • HyperVisor Type1 ( also known as bare metal or native hypervisor) which acts like a lightweight operating system and runs directly on the host’s hardware
  • HyperVisor Type2 ( also known as hosted hypervisor) which runs as a software on top of the operating system

Full Vitalization technique uses hypervisor for communicating directly with the physical server and CPU. It manages and provide the resources to each virtual server and keeps their execution isolated by making them run independently with the usage of hypervisor. Examples of full virtualization are VMware and ESX Servers.

The Full Virtualization depends highly on hypervisor which has its own processing needs which could impact the overall server performance.

2) Para-Virtualization: While Full Virtualization provides each virtual server to run independently with impacting each other, the Para-Virtualization uses the entire network as a unit and thus each operating system in the virutal sever is aware about other existing virtual servers. This reduces the Hypervisor processing needs to manage the operating system and enhances the overall server performance. Examples of para virtualization is Xen.

3) OS-Level Virtualization: The OS level Virtualization also called system level virtualization does not use HyperVisor rather it is the physical server operating system which performs all tasks of Hypervisor and creates virtual servers using the same operating system.

Key Benefits of Server Virtualization

  • Reduces the overall operating costs
  • Provides high server availability
  • Provides ease for managing virtual servers ( stop, restart services) without impacting other running virtual servers
  • increases the overall application performance
  • provides better disaster recovery support

Limitation of Server Virtualization

  • The application hosted using virtual servers are tightly bounded. The failure of server virtualization will impact all those applications.
  • Highly skilled manpower is required to setup the server virtualization
  • Requires high cost as consumes high memory and hardware

Top 10 Significant Cloud Migration Strategies

The tutorial provides the detailing on the cloud migration strategies, what points need to be considered when deciding cloud migrations. The tutorial is useful for both beginners and professional.

Cloud Assessment as part of cloud migration planning

The below given is the Cloud Migration Process to be considered when planning to migrate to cloud environment.

Cloud Migration Process

Cloud Assessment: The cloud migration planning should involve the below points for consider to conclude on the cloud assessment in advance.

Identifying the required Cloud Environment: Cloud planning first step in evaluation should be for the type of environment ( Private Cloud, Public Cloud , Hybrid Cloud) which is required to be used for cloud applications and the associated service models ( IaaS, PaaS, SaaS).

Requirement for Physical and Virtual Servers: Need to analyze and identify the complete list of Physical and Virtual Servers to be available in the cloud environment. The overall need for cloud physical or virtual servers cannot be same with the available on-premises servers as all applications will not be moved to cloud. So identification of applications, database servers ( MySQL, SQL Server, Oracle) or conversion of RDBMS Servers to NoSQL Database Servers like Cassandra, MongoDB, CoucheDB need to be analyzed. If application are requires more transformations for the migration to cloud environments, then it is required to be addressed in the planning phase to conclude on the migration cost. We also need to access the VMWare , HyperVisor and Hyper-V Virtulaization softwares which could be the best fit to provide virtual environments.

Identifying the right application(s) for migration: Understand the need of current and legacy application which requires application, software and hardware support. Only applications which are non-critical, new applications to implement business scenarios, or applications which are not managed using old technologies can be moved to cloud with minimal application and environment support changes.

Calculate Total Cost of ownership (TCO): As migration to cloud application is a digital transformation it is associated with the migration cost. The stakeholders should be involved and provided with the comparison of Total Cost of ownership for on-premises application migration and cloud migration provided by cloud service providers. If the Return on Investment is higher in the longer run, then TCO will be justified, else migrating application to cloud environment is not a feasible deal

Cloud Migration Plan: The fully analyzed cloud migration plan should be shared among stakeholders highlighting the activities and process to be followed from planning phase to deployment phase.

Automated Cloud migration Tool: Cloud applications requires more monitoring to ensure that application issues like latency, Database performance , APIs execution, memory management,storage management ,etc..can be tracked in advance and appropriate measures can be taken to avoid application failure. Thus organization should be clearly identifying the automated migration tools which are required to be available for generating monitoring reports.

Application Security: Cloud environments needs to be secured to be prevented from hacking and thus organizations should depend on industry-leading security features provided by cloud service providers. The recommendation security for a specific environment must be applied which includes application data security, storage device security, network resources security , Identity and access security, etc.

Location Transparency: The cloud environments are managed remotely and thus identifying the exact cloud location is not feasible. The multiple organization could share the same hardware platform but it is isolated and none of the organization knows about the actual data repository or application storage area.

This could also be an concern as organization cannot control the environment , install software’s or manages the overall cloud environment and always need to be dependent on the cloud service provider.

Scalable: The benefit of cloud environment is that they can be easily scalable. With few configuration changes, you can scale in and scale out the cloud environment. As scaling the application includes additional cost, organization should be aware about and how much change in configuration will suffice their application requirement.

Low Latency: The cloud environments should be available 24X7 up and running to ensure that application is accessible from any location to the end users.

Data Storage Services: IT Applications requires data storage and for that various RDBMS and NoSQL Databases should be available in the cloud environment for the organization to consume the application data. Cloud Service Providers like Amazon, Azure and Google provides different data storage facilities for immediate data access, non-frequent data access for data reporting and many more, Each organization should decide what sort of data storage will be useful in the long term to maintain application data.


How Cloud Computing is different from Virtualization

The tutorial covers the difference between cloud vs Virtualization concepts. The blog is useful for both beginners and professional.

The cloud and virtualization terms are used in the Cloud Environment and looks to be similar but they have different perspectives. The cloud is the Cloud computing environment which is comprises of different cloud types ( private cloud, public cloud , hybrid cloud) and provides various service models as IaaS ( Infrastructure as a service), PaaS (Platform as a service) ,SaaS (Software as a service). For more details , refer the blog Cloud Computing Tutorial – Overview & Features

Virtualization is the technology through which multiple simulated environments or dedicated resources are shared from a single physical hardware. The Virtualization is achieved by using virtualization software like HyperVisor which is layered on Physical Hardware, helps in abstracting the required machine resources and map these resource to the Virtual Environments called Virtual Machines. The HyperVisor are classified into below 2 types:

  • HyperVisor Type1 ( also known as bare metal or native hypervisor) which acts like a lightweight operating system and runs directly on the host’s hardware. The hypervisor passes through the operating system layer for each respective communication with the Hardware and thus has high latency.
  • HyperVisor Type2 ( also known as hosted hypervisor) which runs as a software on top of the operating system. The hosted hypervisors are also called as client hypervisor as they are mostly used for end users and software testing providing low latency.
Cloud Virtualization Diagram

How Hypervisor provide Virtual Environments

  • HyperVisor is the Virtualization software which helps in creating and running virtual enviornments
  • HyperVisor helps in isolating the operating system and resources and makes it available for creating virtual machines
  • The Physical harware with Hypervisor layed on it is called as the Host
  • The Virtual machines(VMs) using the Hypervisor resources are called as guests
  • The HyperVisor maintains the pool for resources like CPU, memory and storage devices
  • The pool can be accessed by the existing Virtual machines or new Virtual machines
  • The HyperVisor also utilises other operating system components like process scheduler, I/O stack, device drivers, memory manager, security manager, etc..
  • Hypevisor allows to run multiple operating systems like Windows , Linux , Ubuntu and can still manages to share it with the Virtual machines.
  • Virtualization Software examples: VMware, Kernel-based Virtual Machine (KVM), Xen and Microsoft Hyper-V are few popular and commonly used Virtualization Software.
Cloud Computing Virtualization
The cloud is the Cloud computing environment which is comprises of different cloud types and cloud service models provided to the user as a service to be
accessed via internet connection.
Virtualization is the technology through which multiple simulated environments or dedicated resources are shared from a single physical hardware
Methodology basedTechnology based
Provides resources as a service to the users for a
specific purpose
Provides pool of resources like CPU, memory, storage by creating virtual machines for various operations
Template based configuration is supportedImage based configuration is supported
Cloud computing is user need basis and could be from few month to years.It is considered to be supported a long term process to support operations
Cloud Computing Cost:
Private cloud: High CAPEX, low OPEX
Public cloud: Low CAPEX, high OPEX
Virtualization cost:
High capital expenditures (CAPEX),
low operating expenses (OPEX)
Scale outCan be scaled up easily
maintains stateless workoadsmaintians stateful workloads
Comparison between Cloud Computing and Virtualization

ReactJS tutorial on List and Keys with examples

The tutorial provides the detail on the usage of Lists and Keys in React application, defining list components, defining keys, extracting components with keys, unique keys with arrays, List example in React, Key example in React

What is List in React ?

List is the way of representing the data in the orderly format using JavaScript. The below given is the simple example of array numbers using JavaScript map( ) function to return the list elements

const numbers = [11, 21, 31, 41, 51];
const listItems = numbers.map((number) =>
  <li>{number}</li>
);

The listItems object can be render directly to the DOM as given below

ReactDOM.render(
  <ul>{listItems}</ul>,
  document.getElementById('root')
);

Creating the List in React is similar to javascript. List in React uses the javaScript map( ) function for traversing the list element and for list element updates. The defined List Items are enclosed within the curly brackets { } . Use <ul> </ul> for returning the list items. The lsit items can be rendered using reactDOM.render () method.

import React from 'react';
import ReactDOM from 'react-dom';
const groceryList = ['Milk', 'Butter', 'Bread', 'Onions', 'Tomato'];
const groceryItems = groceryList.map((groceryList)=>{
    return <li>{groceryList}</li>;
});
ReactDOM.render(
    <ul> {groceryItems} </ul>,
    document.getElementById('app')
);
List Output using React


Private Cloud Overview and Features

The Tutorial provides the basic concept of Private Cloud, Private Cloud diagram, benefits of Private Cloud, limitation of Private Cloud. The tutorial is useful for the beginners and professional and who ever wants to know about the private cloud usage.

We have covered the Cloud Computing Overview in the previous blog. Let’s discuss the Private Cloud in detail.

What is Private Cloud?

  • The Private cloud is an isolated or private cloud environment where systems , applications and resources are accessible within an organization
  • Private cloud is also termed as ‘Internal Cloud’ or ‘Corporate Cloud’
  • Private cloud provides high security and data privacy through firewalls and internal hosting.
  • Business critical applications are deployed on private cloud by organization
  • Microsoft, Elastra-private cloud are few examples of Private Cloud

Advantages of Private Cloud

  • Provides more security on application data
  • Provides more controlled on the environment
  • Provides high performance

Disadvantages Private Cloud

  • Requires skilled manpower
  • Requires high cost in setting up private cloud
  • Accessible within the organization boundaries
  • Less scalable with available internal hosting resources

Hybrid Cloud tutorial for beginners

The Tutorial provides the basic concept of Hybrid Cloud, Hybrid Cloud diagram, benefits of Hybrid Cloud, limitation of Hybrid Cloud. The tutorial is useful for the beginners and professional and who ever wants to know about the hybrid cloud usage.

We have covered the Cloud Computing Overview in the previous blog. Let’s discuss the Hybrid Cloud in detail.

What is Hybrid Cloud?

  • Hybrid Cloud is the cloud computing type which is a mix of Public Cloud and Private Cloud.
  • Hybrid Cloud allows to create a unified, automated, and well-managed computing environment
  • Business critical applications are managed and secured using Private Cloud
  • Non-critical applications can be deployed and managed through Public cloud
  • Hybrid cloud provider companies are Amazon, Microsoft, Google, Cisco
  • Banking Applications could be considered as Hybrid Cloud

Advantages of Hybrid Cloud

  • Provides flexibility to an organization to decide which applications are to be deployed on private or public cloud
  • Provides additional Security to critical applications deployed on private cloud
  • Provides cost effectiveness
  • Reduces overall risk for critical applications
  • Provides scalability

Disadvantages of Hybrid Cloud

  • Managing private cloud and public cloud increase complex networking requirements
  • Requires to incorporate organization security compliance
  • Requires additional manpower for managing networking and private cloud setup
  • Requires reliability on both public and private cloud environments up and running


Public Cloud tutorial for beginners

The Tutorial provides the basic concept of Public Cloud, Public Cloud diagram, benefits of Public Cloud, limitation of Public Cloud. The tutorial is useful for the beginners and professional and who ever wants to know about the public cloud usage.

We have covered the Cloud Computing Overview in the previous blog. Let’s discuss the Public Cloud in detail.

What is Public Cloud?

  • The public cloud is cloud hosting where user is allowed to access the system and services via internet. Public clouds are considered as shared platform among various clients or user provided by cloud service providers.
  • Public cloud charges are calculated as pay-per-use model where the user is charged only for services being used.
  • Public cloud examples: Microsoft Azure, IBM’s Blue Mix Cloud, Amazon Elastic Compute Cloud (EC2) and Google Cloud

The below given is the Public cloud Diagram where cloud environment is owned by the Cloud Service Providers and each client or organization gets the shared platform as per the need ( Infrastructure, Software’s and Development Platform) . The Cloud environment provides advanced security features and users mapped with roles and responsibility can login. Multiple organization might be using the same Data Center or Region but still they are separately logically.

Public cloud Diagram

Advantages of Public Cloud

  • Lower Cost: The public clouds are cheaper as they work on the shared platform concept
  • Pay per use: The public cloud charges for the services being consumed.
  • Location Independent: Public Clouds are location independent and thus can be accessed from anywhere via internet connection
  • No Maintenance Required: The Public cloud software installation , upgrades and server management are totally owned by the cloud service providers
  • Scalability: The public clouds provides easy scalability options through configurations
  • Reliability: The public clouds are always available without much interruption and thus makes it high reliable

Disadvantages of Public Cloud

  • Less control: As public clouds are owned by cloud service provides, it does provide much control to the end user
  • High Internet Speed: Public cloud performance depends on the availability of high internet speed
  • Security concern: Public Cloud is less secure because resources are shared publicly

Top 30 Java Design Pattern Interview Questions & Answers

Java Design Patterns is the core for building any robust and scalable web based application developed using Java. Java Design Patterns are the set of standards defined as best practices in the software industry. Design Patterns provides the common solution for the repetitive problems occurring again and again and helps in defining the standard approach for consumption in your code development.

The below given are the most commonly asked Design Pattern Interview Questions and answers in Job Interviews and other competitive entrance exams.

1. What is Gang of Four ?

The Java Design Patterns were first published in 1994 by Erich Gamma, Richard Hel , John Vlissides and Ralph Johnson who were computer scientists and authors by profession also known as “Gang Of Four”. The book published was titled “Design Patterns Elements of Reusable Object-Oriented Software” which provided the details on the best practices and the worst usage of Design Patterns.

2. What are the different categories in Java Design Patterns ?

The Java Design Patterns are classified into below given categories based on the problem analysis

Java Design Pattern CategoryJava Design Pattern Names
Creational Java Design PatternsFactory Pattern
Abstract Factory Pattern
Build Patterns
Prototype Pattern
Singleton Pattern
Structural Java Design Patterns Adapter Pattern
Bridge Pattern
Composite Pattern
Decorator Pattern
Proxy Pattern
Facade Pattern
Flyweight Pattern
Filter Pattern
Behavioral Java Design Patterns Interpreter Pattern
Template Pattern
Chain of Responsibility Pattern
Command Pattern
Iterator Pattern
Strategy Pattern
Visitor Pattern
J2EE Java Design Patterns MVC Pattern
Data Access Object Pattern
Transfer Object Pattern
Intercepting Filter Pattern
Front Controller Pattern

3. What are the benefits of using Java Design Patterns ?

As Java Design Patterns provides the set standards or practices for the common problems , it provides the below advantages when used in any application development

  • Design Patterns provides the industry standard approach for the recurring problems experienced by developers using object oriented programming.
  • Design Patterns are reusable and reduces total cost of ownership (TCO)
  • Usage of Design Patterns reduces the code development , make code easy to understand and debug for issues.
  • Design Patterns usage makes applications scalable and robust.

4. Provide examples of design patterns getting used in JDK library ?

The below given are few of the examples

Design PatternUsage in JDK Library
Singleton Patternused in the Calendar Classes
Observer Pattern used for handling events in AWT, Swing
Factory Patternused by wrapper classes for converting Integer, String values
Decorator Patternused by wrapper classes

5. What are creational design patterns ?

The creational design patterns provides the mechanism of creating objects by instantiating the class object directly using the new keyword. It provides the abstraction on the object creation process.

Employee emp = new Employee();

The new Keyword creates the instance for the class Employee.

6. What is a singleton design pattern ?

The concrete class can have multiple instance as per the object invocation from other concrete classes but when we need to strict the class with only one instance to be existed in the Virtual Java Machine, then such class need to be created as singleton class.

Singleton Design Pattern restricts and ensure that class only 1 instance should exist for the class. The class using singleton pattern creates an object and ensure only single instance is returned.

Examples:

  • Database class can be considered as singleton class implementing the singleton design pattern.
  • Java JDK implements singleton design pattern for calendar class.

Singleton Pattern can be created in 2 ways:

  • Early Instantiation: which means the creation of singleton instance at the startup / load time
  • Lazy Instantiation : which means the creation of singleton instance at the run-time.

7. What is the difference between a static class and a singleton class ?

The below are the primary differences between a static and singleton class

Static ClassSingleton class
Static class members are all staticSingleton class is not bounded only with static members.
Static class are loaded at startupsingleton class can be loaded at startup or lazy loaded ( at run-time)
Static class cannot be the top level class and cannot implement interfaces A singleton class can be a top level class and can also implement interfaces
Static class is stored as stack in memory spacesingleton class is stored as Heap in memory space

8. Can a singleton class be cloned ?

Yes, singleton class can be cloned. However to prevent singleton class from cloning, we can throw exception within the body of the clone( ) method.

9. What is a Factory Pattern?

  • The Factory Pattern is one of the most popular and commonly used Creational Design Pattern.
  • Factory Pattern is used in JDK library, Spring and Struts frameworks.
  • The factory pattern ensures the class instantiation from the client program to the factory class.
  • The factory pattern is useful when the super class have multiple sub-classes and based on the object instantiation one of the sub-class to be returned.
  • Factory Pattern is also known as Virtual Constructor.

10. What is a Abstract Factory Pattern ?

  • Abstract Factory Pattern is part of the Creational Design Patterns and helps in creating objects.
  • Abstract Factory Pattern is similar to the Factory Pattern but it is considered as factory of factories.
  • Abstract Factory Pattern defines the abstract class for creating the objects of related objects and provides the abstraction about the concrete sub-classes.
  • Abstract Factory Pattern is one level up from factory pattern

11. What is a Builder Pattern ?

Builder Design Pattern provides the way for handling more number of fields including optional fields and their inconsistent state by providing the mechanism to manage and return the final object.

Let’s consider that you have employee data where each field need to set . Like Employee firstName, lastName, emailAddress, contact, residential address, etc; In the normal java practice, we set each field separately but with the usage of Builder Pattern we can combine the values and pass it as a common method to set those values.

12. What is a Prototype Pattern ?

  • Prototype Design Pattern provides the mechanism to copy the original object to a new object for modifications.
  • Prototype pattern internally uses java cloning for copying the object.
  • Prototype pattern are quite useful when object creation is costly.
  • Example: Database operations uses Prototype pattern where the cloned object is cached , allowed for modifications and update the database which overall reduces the database calls.

13. What is an Adapter Pattern?

  • The adapter design pattern is one of the structural design patterns.
  • The adapter design pattern provides the mechanism to combine the functionalities of multiple incompatible class to generate a reusable class.
  • The adapter design pattern acts as the wrapper.
  • Example: Mobile Memory Card is an external device but gets connected to the Mobile and allows you to extend the overall mobile memory by getting connected through the mobile memory reader.

14. What is a Bridge Pattern?

  • The bridge design pattern is one of the structural design patterns.
  • The bridge design pattern provides the mechanism to decouple the interface(s) from the implementation by hiding implementation details (abstraction) from the client calls.
  • The bridge design pattern ensure that the concrete classes are independent from interface implementation classes

15. What is a Facade Design Pattern ?

  • The facade design pattern is one of the structural design patterns.
  • The earlier implementations had the tight binding between client and database operations or other system calls. Facade design patterns provides the mechanism to hide the complexities between the system calls and provides interface to the client to access the required implementations.
  • Example: The methods exposed by facade patterns can be consumed by the client program and hides the implementation of the database operations

16. What is a Composite Design Pattern ?

  • The composite design pattern is one of the structural design patterns.
  • The composite design pattern provides the mechanism to combine the group of objects as a single object providing the common structure for all objects.
  • The composite design pattern contains group of objects and allows modifications on those objects.

17. What is a Flyweight Design Pattern ?

  • The flyweight design pattern is one of the structural design patterns.
  • The flyweight design pattern provides the mechanism for reducing the number of objects created for the class by sharing the existing objects.
  • In case of no existing object found, flyweight pattern then creates the new object.
  • The flyweight design pattern avoid high memory consumption and helps in enhancing performance.

18. What is a Decorator Design Pattern ?

  • The decorator design pattern is one of the structural design patterns.
  • The decorator design pattern allows to modify the functionality for an object at run-time without impacting its existing structure.
  • Example: You have the class Pizza which provides Pizza Type ( Thin Crust, Thick Crust). You have another class as PizzaToppings which includes ( ‘Tomato, Onions, Olives, Peanuts, Extra Cheese,,etc) The decorator class can combine the Pizza and PizzaToppings and returns the output.
  • Example: BufferedReader and BufferedWriter classes in java

19. What is a Proxy Design Pattern ?

  • The proxy design pattern is one of the structural design patterns.
  • The proxy design pattern provides the mechanism to control the access of implementation class by extending a new class for handling the operations. If the received request is validated, then proxy pattern invokes the original class to provide the functionality.
  • The proxy design pattern helps in hiding the details of actual implementation class to the outside world.
  • Example: SOA Architecture provides the OSB Proxy which receives the request and then invokes the original web service for the functionality.

20. What is a Chain Of Responsibility Design Pattern ?

  • The chain of responsibility design pattern is one of the behavioral design patterns.
  • The chain of responsibility design pattern provides the mechanism where the request from the client program is passed to the Chain of Objects for processing the request. The chain object validates the received request, assigns the request to the object for execution.
  • The chain of responsibility design pattern adds the decoupling between the sender and receiver of the request as per request type.

21. What is a Command Design Pattern ?

  • The command design pattern is one of the behavioral design patterns.
  • The command design pattern is a data driven design pattern in the request-response model.
  • Provides the mechanism where the request is sent to the invoker, invoker passes the request to the command object (encapsulated), the command object passes the request to the appropriate receiver for processing.
  • Example: The command object can provide implementation for the Open File , Save File , Delete File, etc by providing the File command Pattern for receiving the client program request for each of these operations.

22. What is an Interpreter Design Pattern ?

  • The interpreter design pattern is one of the behavioral design patterns.
  • The interpreter design pattern provides the interpreter to define the grammatical representation of the language.
  • Example: Java JVM which interprets the java source code and converts it into byte code.

23. What is an Iterator Design Pattern ?

  • The iterator design pattern is one of the behavioral design patterns.
  • The iterator design pattern provides the mechanism to traverse the elements of collection object in the sequential order.
  • Example: Java Collection Framework uses Iterator Pattern.

24. What is a Visitor Design Pattern ?

  • The visitor design pattern is one of the behavioral design patterns.
  • The visitor design pattern provides the mechanism to perform operations on the similar objects.
  • The visitor class changes the calculation algorithm on the element class
  • Example: User logged in to an electronics online shopping and adds Laptop , mobile charger, mouse. When check out is clicked, it returns the listing of items with the total price and discounts applied which is applied on top of the available items in the cart.

25. What is a Strategy Design Pattern ?

  • The strategy design pattern is one of the behavioral design patterns.
  • The strategy design pattern provides the mechanism to have multiple algorithm for a specific task and client program decides which algorithm to be invoked at run-time.

26. What is an Observer Design Pattern ?

  • The observer design pattern is one of the behavioral design patterns.
  • The observer design pattern provides the mechanism where the object state change is notified.
  • The object that watch on the state of another object are called Observer
  • The object that is being watched is called Subject
  • Example: Event handling in java for AWT , Swing, Java Message Services

27. What is MVC Design Pattern ?

  • MVC is the one of the most common design pattern used in building java based web applications.
  • MVC stands for Model-View-Controller Pattern
  • Model : model represents the Java POJO or an java object carrying application data
  • View: View represents the Front End representation of the data that is returned by model
  • Controller: handles the request and response for each user action. It controls the data flow into model object and returns the updates model to the view.

28. What is a Template Design Pattern ?

  • The template design pattern is one of the behavioral design patterns.
  • The template design pattern provides the mechanism where an abstract class provides the template for invoking methods.
  • The template methods could provide the default implementation which is common for all sub-classes or specific method invocation to the sub-classes

29. What is State Design Pattern ?

  • The state design pattern is one of the behavioral design patterns.
  • The state design pattern provides the mechanism where the class bhavior changes on the change of the state

30. what is Business Delegate Design Pattern ?

  • The business delegate design patterns decouples the presentation layer and business layer where
  • Client: manages the presentation or view layer using JSP, JSF, servlets
  • Business Delegation: provides entry point to the client program to access business service methods
  • Lookup Service: Lookup Service object provides the reference of the business object required for implementation as per client request received.
  • Business Service: is an interfaace for the Concrete classes to provide actual business implementation logic

Beginner’s guide for Cloud Computing tutorial online

The tutorial provides the basic concepts of cloud computing, cloud computing overview and features, increasing demand for cloud computing applications, characteristics and advantages of cloud computing, cloud deployment models, cloud service models. The cloud computing tutorial is useful for both beginners and professionals.

What is cloud ?

The cloud term depicts the usage of application through internet or network. In other words, applications which are not installed within the organization premises but can be accessed by organization staff through network ( LAN, WAN, VPN) or internet.

What is cloud computing ?

Cloud computing is the virtualization based technology which allows users to create, configure, install applications, development platform, security services, virtual machines, servers and memory allocation, database servers including NoSQL databases like MongoDB, CouchDB, Cassandra, File processing, image processing, documents and videos via an internet connection. These applications are not installed and managed locally but are provided as services to the end users based on their need. Amazon AWS Cloud Services, Microsoft Azure Cloud Services , Oracle Cloud Services and Google Cloud Services are the few popular cloud service providers.

Cloud computing provides the platform independence as it is managed by cloud service providers and not installed locally and thus makes it more suitable options for the customers for reducing their hardware cost, software cost and maintenance and upgrade of the overall infrastructure.

What are Cloud Types ?

The availability of applications to the customers are broadly divided into below given types:

Cloud Types Diagram
  • Private Cloud: The Private cloud is an isolated or private cloud environment where systems , applications and resources are accessible within an organization.
  • Public Cloud: The public cloud is an cloud environment where systems , applications and resources are accessible to the general public.
  • Hybrid Cloud: Hybrid cloud is a mix of private cloud and public cloud where critical applications are maintained and accessed through private cloud and non-critical applications are managed and accessed by public cloud. For example , Banking Applications with customer and business data could be managed through private cloud and Banking process , user complaints and other non-critical applications through public cloud.
  • Community Cloud: The community cloud allows systems , applications and resources to be accessible through group of organizations.

Cloud Service Models

The cloud service providers like Amazon, Microsoft , Oracle and Google provides the cloud environment to their customers based on the below given cloud service models:

  • SaaS (Software-as-a-service) : SaaS is the computing service which allows users to access the software applications as a service. Oracle Cloud Procurement, Oracle Cloud Financials are few commonly used software applications.
  • PaaS (Platform-as-a-service): PaaS is the cloud computing service where provides the cloud environment for application development, application deployment and application tools, etc
  • IaaS (Infrastructure-as-a-service): IaaS is the cloud computing service which allows users to manage the Infrastructure through internet. Users can configure the required physical servers, virtual servers, memory allocation based on their usage.
Cloud Service Model Diagram

Increase demand of Cloud computing

The cloud services are becoming popular among the users due to the below given advantages:

  • The cloud applications are accessible to the users as a service via internet
  • The cloud applications are configurable as per the user need
  • The hardware and software installations , maintenance and upgrade is managed by the cloud service providers
  • PaaS service provides the development platform, development and deployment tools.
  • The cloud computing provides users the option to access cloud application based on pay-per-use model which includes charges as per the usage of services.
  • The cloud computing provides different ways for data storage for file, images and application data. Users can also classify which data is required for immediate access and which is required for data reporting and cloud service charges applicable accordingly.
  • The cloud computing provides advanced security features which also makes it a secure option for data processing.

Limitation of Cloud computing

Although cloud computing provides numerous advantages but still has some limitations

  • Customer will have limited control as cloud environments are owned and managed by cloud service providers.
  • Cloud applications are accessible through internet. Slow internet connectivity may leads to the slowness of the application
  • Usage of cloud applications over internet open the threat of misuse of critical client data through hacking.
  • Customers using the specific cloud service provider cannot shift or transfer to another cloud service provider as each cloud service provider has its own cloud platforms and thus requires high efforts in redeploying and stabilizing the running applications

Monolithic Architecture Tutorial for beginners

The tutorial covers the topic on what is Monolithic Architecture, Monolithic Architecture Diagram, Benefits of Monolithic Architecture , Limitations of Monolithic Architecture , examples using Monolithic Architecture.

What is Monolithic Architecture ?

Monolithic dictionary meaning is ” formed of a single large block of stone , organization or people”. The IT meaning of monolithic could be the combination of different components as single code piece of application deployment. An application consist of front-end , user authentication process, handling request and response data , business data processing , database operations, interacting with third party API Integrations. The monolithic applications were deployed as the single code piece even though having multiple modules developed for application integration. The traditional java applications used to be deployed as WAR file for the web-based application even though they contain separate components for handling application execution.

Example of Monolithic Architecture

Lets consider the online application store example for Amazon with the Monolithic Architecture. The high level module could be User Authentication, Customer Process, Item Listing with Prices, Order and Shipment Process, Payment Process, User Notification, Return Orders and many more. Each module could have a corresponding service to retrieve or update the process or third-party services which further requires database operations to process the details. Even though internally these are divided into components or modules but still all the application code is to be deployed as part of the single deployment ( WAR file) process which makes it supported with the monolithic architecture.

Monolithic Architecture Diagram

The below given diagram depicts the Monolithic Architecture where application view, user authentication, Item Module, Ordering Module, Payment Module are combined together within single application code repository which is deployed as single application WAR file.

Monolithic Architecture Diagram

Benefits of Monolithic Architecture

  • Ease of development: Monolithic applications are simple to develop at least in the initial phase as it maintains single code repository
  • Ease of deployment Monolithic applications provides easy deployment process as it combines all application code in the single artifact
  • Ease of Application Testing : Monolithic applications provides running applications with all components available and thus makes it easy to perform end-to-end testing scenarios.
  • Ease of Scalability: Multiple Monolithic applications can run behind the load balancer which makes it easily scalable.

Limitations of Monolithic Architecture

  • Difficult to maintain: Large and complex applications supported with monolithic architecture becomes difficult to understand and debug the application issue to provide issue resolution.
  • Complete application Deployment: We need to deploy the complete application every time whenever any update happens in the application code.
  • Does not support continuous deployment: It is difficult to provide continuous deployment for every single update as same code base is updated by multiple developers and could impact the ongoing testing.
  • slow down application up-time: The larger application takes more time for application start up as it sometimes overloads the web container.
  • Impacting application scalability: Each module in the monolithic application could have different behavior. Some modules might requires more memory for processing , some might require more memory and high I/O traffic and thus it comes difficult to deploy and make such applications scalable on cloud.
  • Technology dependent: Monolithic applications are less flexible for adapting to the new technology changes and need to be dependent on the used application frameworks and technology stack.
  • Cannot scale development: multiple developers could be assigned with different tasks to update the same application file which becomes difficult to work independently and adds dependency among team members

Does MVC supports Monolithic Architecture?

MVC stands for Model-View-Controller Framework which segregates the Model ( Persistence) , View ( User Interface) and Controller for handling the application execution ( Request and Response).

Although Monolithic Architecture can be supported with different approaches but we can say that the MVC Framework is the most modern representation of the Monolithic Architecture.


Handling events with ReactJS

The tutorial provides the usage of events in React Application, synthetic events in React, event declaration in React, event example in React.

What is an event in React ?

Any user action on the Application front end or system generated action creates an event , triggered to perform specific operations. The click on the mouse, pressing keyboard, application operations each classifies as an event. Although the event handling in React is similar to handling events in the DOM , but few points need to be considered:

  • React events are named using camelCase
  • React JSX uses function as event handler rather than string
<button onClick={updateUser}> Update </button>
  • React cannot return false to prevent default behavior rather need to use preventDefault explicitly
function ActionLink() {
  function handleClick(e) {
    e.preventDefault();
    console.log('handling onclick event...');
  }
  return (
    <a href="#" onClick={handleClick}>
      Click Event
    </a>
  );
}

Synthetic Event in React

The event handling in React uses the Synthetic Event mechanism , a cross-browser wrapper around the browser’s native event and provides the native event interfaces like stopPropagation() and preventDefault().. In the above example, e is a Synthetic Event which is defined according to the W3C spec.

Synthetic Event Pooling:

Synthetic events supports pooling. The object in synthetic events can be reused and all properties will be nullified after the event callback is invoked. To access the event properties in an asynchronous way, event.persist() should be called on the event which removes synthetic event from the pool to allow reference to the event.

Registering Event in Capture Phase: Events can be registered for the capture phase. Appending the Capture to the event name instead of using onClick (example – onclickCapture) allows to handle the capture phase. The below given are the supported events:

  • Clipboard Events – onCopy onCut onPaste
  • Composition Events – onCompositionEnd onCompositionStart onCompositionUpdate
  • Keyboard Events – onKeyDown onKeyPress onKeyUp
  • Focus Events – onFocus onBlur
  • Form Events – onChange onInput onInvalid onReset onSubmit
  • Generic Events – onError onLoad
  • Mouse Events – onMouseMove onMouseOut onMouseOver onMouseUp
  • Pointer Events – onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture
  • Selection Events – onSelect
  • Touch Events – onTouchCancel onTouchEnd onTouchMove onTouchStart
  • UI Events – onScroll
  • Wheel Events – onWheel
  • Media Events – onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted
  • Image Events – onLoad onError
  • Animation Events – onAnimationStart onAnimationEnd onAnimationIteration
import React from 'react';
class App extends React.Component {
   constructor(props) {
      super(props);
      this.state = {
         userInput: 'Default input text shown ...'
      }
      this.updateState  = this.updateState .bind(this);
   };
   updateState() {
      this.setState({userInput: 'Text updated on event click ...'})
   }
   render() {
      return (
         <div>
            <button onClick = {this.updateState }>Update</button>
            <h4>{this.state.userInput}</h4>
         </div>
      );
   }
}
export default App;
Forms example in ReactJS - Default Input Text
Forms example in ReactJS – Default Input Text
Forms example in ReactJS - text update on event click
Forms example in ReactJS – text update on event click