Tuesday, March 5, 2019

Tutorial 04 – Distributed systems

1. Explain the term “distributed systems”, contrasting it from “distributed computing”
Distributed systems
A distributed system is a network that consists of autonomous computers that are connected using a distribution middleware. They help in sharing different resources and capabilities to provide users with a single and integrated coherent network.

Distributed computing
A distributed computer system consists of multiple software components that are on multiple computers, but run as a single system. The computers that are in a distributed system can be physically close together and connected by a local network, or they can be geographically distant and connected by a wide area network. A distributed system can consist of any number of possible configurations, such as mainframes, personal computers, workstations, minicomputers, and so on. The goal of distributed computing is to make such a network work as a single computer.


Distributed computing is a field of computer science that studies distributed systems. A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another.

2. Compare and contrast the standalone systems with distributed systems, providing examples for advantageous use of both

Standalone systems
Advantages:
  • Security – users cannot see other users’ files unlike on stand-alone machines.
  • Files can easily be shared between users.
  • Data is easy to back-up as all the data is stored to a file server.
  • Network users can communicate by email and instant messaging.
  • Sharing devices, as printers can save money.
  • Software licences are likely to be cheaper than buying several standalone licences.
  • One internet connection can be used by many computers on the network.
  • Often computers for use on a network can be cheaper than standalone computers.

Disadvantages:
  • Purchasing the network cabling and file servers can be expensive.
  • If the file server breaks down the files on the file server become inaccessible.
  • Email might still work if it is on a separate server.
  • The computers can still be used but are isolated.
  • Viruses can spread easily to other computers throughout a computer network.
  • There is danger of hacking, particularly with wide area networks.
  • Managing a large network is complicated, requires training and a network manager usually needs to be employed.
  • It can be expensive to install cables, routers, and hubs, also servers and other networking components can be expensive and complicated to install and maintain.

Distributed systems
Advantages :
  • Scalability and Modular Growth
  • Fault Tolerance and Redundancy
  • Low Latency
  • Cost Effectiveness
  • Efficiency
Disadvantages : 
  • Complexity
  • Higher Initial Cost
  • Security Concerns
  • Conclusion
3. Discuss the elements of distributed systems 
  • Processing components 
  • Data networksfor components to communicate
  • Data stores (data bases) and Data 
  • Theconfiguration of the above elements
  • The components to share the computing resources ,increasing the processing power ,provide better user experience 
  • The users to share data and other resources, such as documents and files 
  • The engineers to have a centralized control
4. Identify different types of services, which can be gained from distributed systems, specifying the protocols used for them 
  • Mail service SMTP, POP3, IMAP
  • File transferring and sharing FTP
  • Remote logging (telnet) 
  • Games and multimedia RTP, SIP,H.26x
  • Web HTTP
5. Identify examples for both browser-based and non-browser-based clients of distributed systems 
  • The world wide web – information, resource sharing
  • Clusters, Network of workstations
  • Distributed manufacturing system (e.g.,automated assembly line)
  • Network of branch office computers -Information system to handle automatic
  • processing of orders
  • Network of embedded systems
  • New Cell processor (PlayStation 3)
6. Discuss the characteristics of different types of Web-based systems, including the RiWAs 
TTs  for  the  Browser-based  Client-Components  of RiWAs 
There  are  several  approaches  for  the  browser-based RiWAs, inherited  from RIAs. The  first approach, which is the proprietary plugin based approach, uses the technologies such as Adobe (former Macromedia) Flash/Flex [13], JAVA Applets,  or  MS  Silverlight  [5].  These  technologies  are enriched  with  utensils for  developing desktop  applications like rich GUIs. 

TTs for the  non-browser-based client-components of RiWAs 
The  standard desktop  application development TTs like JAVA  or  .Net  and  related libraries/frameworks  can  be utilized  for  non-browser-based  client-components development. For DC development, these frameworks  may contain  their  own  tools  or  some  third-party 
frameworks/libraries can be incorporated. 

7. Explain different architectures for distributed systems, explaining special features of each 

Client Server Architecture

The client server architecture has two major components. The client and the server. The Server is where all the processing, computing and data handling is happening, whereas the Client is where the user can access the services and resources given by the Server (Remote Server). The clients can make requests from the Server, and the Server will respond accordingly. Generally, there is only one server that handles the remote side. But to be on the safe side, we do use multiple servers will load balancing techniques.

As one common design feature, the Client Server architecture has a centralized security database. This database contains security details like credentials and access details. Users can't log in to a server, without the security credentials. So, it makes this architecture a bit more stable and secure than Peer to Peer. The stability comes where the security database can allow resource usage in a much more meaningful way.  But on the other hand, the system might get low, as the server only can handle a limited amount of workload at a given time.
Advantages:
  • Easier to Build and Maintain
  • Better Security
  • Stable
Disadvantages:
  • Single point of failure
  • Less scalable
Peer to Peer (P2P)

The general idea behind peer to peer is where there is no central control in a distributed system. The basic idea is that, each node can either be a client or a server at a given time. If the node is requesting something, it can be known as a client, and if some node is providing something, it can be known as a server. In general, each node is referred to as a Peer.

In this network, any new node has to first join the network. After joining in, they can either request a service or provide a service. The initiation phase of a node (Joining of a node), can vary according to implementation of a network. There are two ways in how a new node can get to know, what other nodes are providing.

Centralized Lookup Server - The new node has to register with the centralized look up server an mention the services it will be providing, on the network. So, whenever you want to have a service, you simply have to contact the centralized look up server and it will direct you to the relevant service provider.
Decentralized System - A node desiring for specific services must, broadcast and ask every other node in the network, so that whoever is providing the service will respond.

8. Compare and contrast the micro-service architecture from monolithic architecture

Monolithic Architecture
Monolith means composed all in one piece. The Monolithic application describes a single-tiered software application in which different components combined into a single program from a single platform. Components can be:
  • Authorization — responsible for authorizing a user
  • Presentation — responsible for handling HTTP requests and responding with either HTML or JSON/XML (for web services APIs).
  • Business logic — the application’s business logic.
  • Database layer — data access objects responsible for accessing the database.
  • Application integration — integration with other services (e.g. via messaging or REST API). Or integration with any other Data sources.
  • Notification module — responsible for sending email notifications whenever needed.
Benefits:
  • Simple to develop — At the beginning of a project it is much easier to go with Monolithic Architecture.
  • Simple to test. For example, you can implement end-to-end testing by simply launching the application and testing the UI with Selenium.
  • Simple to deploy. You have to copy the packaged application to a server.
  • Simple to scale horizontally by running multiple copies behind a load balance.
Microservices Architecture
Microservices are an approach to application development in which a large application is built as a suite of modular services (i.e. loosely coupled modules/components). Each module supports a specific business goal and uses a simple, well-defined interface to communicate with other sets of services.
Instead of sharing a single database as in Monolithic application, each microservice has its own database. Having a database per service is essential if you want to benefit from microservices, because it ensures loose coupling. Each of the services has its own database. Moreover, a service can use a type of database that is best suited to its needs.
Consider the same example of the e-commerce application, which consists of several components/modules. Define each component/module as a separate loosely coupled service depending on the requirement, which may collaborate with each other based on the scenario. We can have following services for a complete application:

  • Authorization Service — Responsible for authorizing customer.
  • Order Service — takes an order and process it.
  • Catalog Service — Manage products and check products inventory.
  • Cart Service — Manage user cart, this service can utilize Catalog service as a data source.
  • Payment Service — Manage and Authorize payments.
  • Shipping Service — Ships ordered products.
Benefits:
  • Microservices Enables the continuous delivery and deployment of large, complex applications.
  • Better testability — services are smaller and faster to test.
  • Better deployability — services can be deployed independently.
  • It enables you to organize the development effort around multiple teams. Each team is responsible for one or more single service. Each team can develop, deploy and scale their services independently of all of the other teams.
  • Each microservice is relatively small
9. Explain the MVC style, indicating the limitations of it in the context of web-based systems
We can simplify MVC into Model-View-Controller that is a well-known word in software engineering and web application development space. It’s a terminology or pattern that is applied in web development to separate 3 main pieces of any application into their isolated environments. Though, this was originally developed for the desktop computing but adopted widely in all programming languages as architecture for World Wide Web applications. MVC changed the whole scenario of internal representations of information. It changed the way the information is presented to or accepted from the user.
MVC pattern has become the most popular and powerful framework since it improves development process of websites, web services and interactive web applications. It can be applied to JAVA, PHP, ASP.NET and many other programming languages and also facilities customization in World Wide Web applications.
The Controller, the View and the Model are the three components of MVC that actually does everything within an application such as:
  • The Controller – In the web environment, the Controller plays a role of the traffic cop of the application. The Controller handles incoming HTTP request. It is also directing traffic to where it should go, identifying which view needs to load up and is interacting with the appropriate models.
  • The View – The View in a web-based application is the representation of the user-interface. Buttons, forms and other information visible to the user on the web are all part of View. View is implemented when controller calls up the view after having interaction with the appropriate model that gathers the particular information to display in a particular view.
  • The Model – the Model is a place where all data is stored regarding the application in separate models. This is the place where data from controller and sometimes the view is actually passed into, out of, and is manipulated. There is no link between Model and HTTP, web servers or anything like that but it is responsible to check the data against the stored information in database and then to supply it accordingly
10. Identify different approaches of use of MVC for web-based systems and discuss their strengths and weaknesses

The Benefits of using The MVC 
  • Different views and controllers can be substituted to provide alternate user interfaces for the same model.
  • Multiple simultaneous views of the same model
  • The change propagation mechanism insures that all views simultaneously reflect the current state of the model.
  • Changes affecting just the user interface of the application become easier to make.
  • With MVC it can be easier to test the core of the application, as encapsulated by the model.

The problems of MVC2
  • There’s increased complexity as an apllication may use other patterns at the same time as MVC.
  • The view and the controller are closely coupled wich makes modification to one affect the other.
  • Changes to the model interface will necessitate changes to the controller and the view.
  • When the model is active frequent changes to model can result in excessive updates of the corresponding views.
Advantages of MVC
  • Faster development process: MVC supports rapid and parallel development. With MVC, one programmer can work on the view while other can work on the controller to create business logic of the web application. The application developed using MVC can be three times faster than application developed using other development patterns.
  • Ability to provide multiple views: In the MVC Model, you can create multiple views for a model. Code duplication is very limited in MVC because it separates data and business logic from the display.
  • Support for asynchronous technique: MVC also supports asynchronous technique, which helps developers to develop an application that loads very fast.
  • Modification does not affect the entire model: Modification does not affect the entire model because model part does not depend on the views part. Therefore, any changes in the Model will not affect the entire architecture.
  • MVC model returns the data without formatting: MVC pattern returns data without applying any formatting so the same components can be used and called for use with any interface.
  • SEO friendly Development platform: Using this platform, it is very easy to develop SEO-friendly URLs to generate more visits from a specific application.
Disadvantages of MVC
  • Increased complexity
  • Inefficiency of data access in view
  • Difficulty of using MVC with modern user interface.
  • Need multiple programmers
  • Knowledge on multiple technologies is required.
  • Developer have knowledge of client side code and html code.

11. Discuss the need for very specific type of communication technologies/techniques for the distributed/web-based systems 

12. Compare and contrast RPC with RMI 
RPC and RMI are the mechanisms which enable a client to invoke the procedure or method from the server through establishing communication between client and server. The common difference between RPC and RMI is that RPC only supports procedural programming whereas RMI supports object-oriented programming.

Another major difference between the two is that the parameters passed to remote procedures call consist of ordinary data structures. On the other hand, the parameters passed to remote method consist of objects

13. Explain the need for CORBA, indicating it’s use in web-based systems 
CORBA – Common Object Request Broker Architecture
CORBA is a standard for an object request broker architecture that was developed by the Object Management Group in the 1990s. It was hoped that this would be widely adopted and that implementations of the standard would be available from competing vendors. The OMG standards are available from their website.
The OMG’s vision of a distributed application is shown in Figure 1, which I have adapted from Siegel’s diagram of the Object Management Architecture (Siegal, 1998). This proposes that a distributed application should be made up of a number of components:
  • Application objects that are designed and implemented for this application.
  • Standard objects that are defined by the OMG for a specific domain. These domain object standards cover finance/insurance, electronic commerce, healthcare, and a number of other areas.
  • Fundamental CORBA services that provide basic distributed computing services such as directories, security management, etc.
  • Horizontal CORBA facilities such as user interface facilities, system management facilities, etc. The term horizontal facilities suggests that these facilities are common to many application domains and the facilities are therefore used in many different applicatio
14. Discuss the XML specification, highlighting the important sections such as element naming conventions

XML stands for Extensible Markup Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML).

XML tags identify the data and are used to store and organize the data, rather than specifying how to display it like HTML tags, which are used to display the data. XML is not going to replace HTML in the near future, but it introduces new possibilities by adopting many successful features of HTML.

There are three important characteristics of XML that make it useful in a variety of systems and solutions −
  • XML is extensible − XML allows you to create your own self-descriptive tags, or language, that suits your application.
  • XML carries the data, does not present it − XML allows you to store the data irrespective of how it will be presented.
  • XML is a public standard − XML was developed by an organization called the World Wide Web Consortium (W3C) and is available as an open standard.
XML Usage
A short list of XML usage says it all
  • XML can work behind the scene to simplify the creation of HTML documents for large web sites.
  • XML can be used to exchange the information between organizations and systems.
  • XML can be used for offloading and reloading of databases.
  • XML can be used to store and arrange the data, which can customize your data handling needs.
  • XML can easily be merged with style sheets to create almost any desired output.
  • Virtually, any type of data can be expressed as an XML document.s
15. Compare and contrast XML and JSON, indicating the pros and cons of both 
JSON (JavaScript Object Notation) is a lightweight data-interchange format and it completely language independent. It is based on the JavaScript programming language and easy to understand and generate.

XML (Extensible markup language) was designed to carry data, not to display data. It is a W3C recommendation. Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. The design goals of XML focus on simplicity, generality, and usability across the Internet. It is a textual data format with strong support via Unicode for different human languages. Although the design of XML focuses on documents, the language is widely used for the representation of arbitrary data structures such as those used in web services.

16. Identify other data formatting/structuring techniques available for the communication of web-based systems

In a web-based learning environment communication can be either:

Synchronous- communication takes place at the same time. This requires that all participants are present at the same time. This type of communication is used fairly rarely for specific purposes such as getting acquainted, changing opinions, working in small groups, brainstorming etc.

Asynchronous- communication takes place at different times or over a certain period of time. This allows more time to work on your messages and to react to other students' messages.

Communication can vary also depending on the amount of people it involves. Communication on the web can be divided into the following types, involving a different amount of participants at a time:

One to one- one person communicates with somebody else, for example a student sends an A&O e-mail message to his/her trainer
One to many- one person communicates with many others, e.g. a student posts a message in A&O's discussion forum
Many to many- many persons communicate with each other, e.g. via videoconferencing

The most relevant tools for communication in the VERT courses you are about to take are the 
following:

Internet e-mail- The regular e-mail can be sent to the instructor or other students e.g. if there is something that needs immediate attention.
A&O's mail- This e- mail is dedicated to studying and stays in A&O virtual learning environment.
A&O discussion forum- A tool for asynchronous, one-to-many communication for many purposes.

References
  • https://techdifferences.com/difference-between-rpc-and-rmi.html
  • https://medium.com/koderlabs/introduction-to-monolithic-architecture-and-microservices-architecture-b211a5955c63
  • https://ifs.host.cs.st-andrews.ac.uk/Books/SE9/Web/DistribSys/Corba.html
  • https://www.scribd.com/document/239346702/Advantages-and-Disadvantages-of-Using-a-Network-Compared-to-a-Stand-Alone-Computer

Tuesday, February 26, 2019

Tutorial 03 – Industry practices and tools 2

1. Discuss the importance of maintaining the quality of the code, explaining the different aspects of the code quality 

When you're making code in a project you will have to make sure others can comprehend what you're typing, someone who's less competent in programming may not understand in your group so you can just make the code usable so everyone can check and use the code.

So to conclude, the quality of code is as important to a programmer as the quality of food is to a chef, because you'll have others testing and tasting the code, others consuming and using it and etc. so you must make it have high quality code that can be understood by other systems and humans alike and also make it so that later down the line it is easy to fix and maintain 

  • Readability, consistency — how easy it is to read and understand sections of the code; this includes code clarity, simplicity, and documentation.
  • Predictability, reliability, and robustness — software behavior should be predictable, and not prone to hidden bugs.
  • Maintainability and extensibility— fixing, updating and improving software should be as simple as possible, not inherently complex.

Poor quality code can be usually caused by:
  • Lack of (or insufficient) coding style/standards.
  • No / poor documentation.
  • Poorly designed architecture (with no separation of responsibilities, as in MVC).
  • High method complexity
In this code 
  1. There is no function documentation, no comment lines, and no apparent coding standard is followed (seen, for example, in the usage of curly brackets and empty lines).
  2. The complexity is relatively high due to the number of different actions and processes (DB queries, view/output, and business logic), multiple nesting levels.
  3. There is an inconsistency in the ways to perform output and variable interpolation.

In this code 
  1. The code is simple and self-explanatory.
  2. Different logic sections are separated by empty lines.
  3. There are few nesting/indentation levels, with early return statements.
  4. There are proper design considerations (separation of responsibilities by different objects/classes).
  5. Due to the high code quality and clarity, the class/method should be easy to test and maintain, with low effort; the probability of bugs occurring should also be extremely low.
2. Explain different approaches and measurements used to measure the quality of code
  • Weighted Micro Function Points
  • Halstead Complexity Measures 
  • CyclomaticComplexity 
  • Lines of code 
  • Lines of code per method

3. Identify and compare some available tools to maintain the code quality 
SonarQube
 It is an open source web-based tool, extending its coverage to more than 20 languages, and also allows a number of plugins 

Coverity

Coverity Scan is an open source cloud-based tool. It works for projects written using C, C++, Java C# or JavaScript. This tool provides a very detailed and clear description of the issues which helps in faster resolution. A good choice if you are looking for an open source tool

Code Compare

CodCode Compare – is a file and folder comparison and merge tool. Over 70,000 users actively use Code Compare while resolving merge conflicts and deploying source code changes. Code Compare is a free compare tool designed to compare and merge differing files and folders. Code Compare integrates with all popular source control systems: TFS, SVN, Git, Mercurial, and Perforce. Code Compare is shipped both as a standalone file diff tool and a Visual Studio extension.
Key features:

  • Text Comparison and Merging
  • Semantic Source Code Comparison
  • Folder Comparison
  • Visual Studio Integration
  • Version Control Integration and moree Compare

GAMMA
Gamma is an intelligent software analytics platform, developed by Acellere. It supports developers and teams in building higher quality software in less time, by speeding up code reviews.


It automatically prioritizes hotspots in the code and provides clear visualizations. With its multi-vector diagnostic technology, it analyses software from multiple lenses, including software design, and enables companies to manage and improve their software quality transparently.

4. Discuss the need for dependency/package management tools in software development? 
Package managers automate the process of installing, upgrading, configuring, and removing computer programs from an operating system in a consistent manner. A package manager deals with ‘packages’ – distributions of software and data in archive files. Packages contain metadata, such as the software’s name, its purpose, version number, checksum and a list of dependencies necessary for the software to run properly. Upon installation, metadata is stored in a local package database. Package managers typically maintain a database of software dependencies and version information to prevent software mismatches and missing prerequisites. They work closely with software repositories, binary repository managers and app stores.


5. Explain the role of dependency/package management tools in software development
A software package is an archive file containing a computer program as well as necessary metadata for its deployment. The computer program can be in source code that has to be compiled and built first.Package metadata include package description, package version, and dependencies (other packages that need to be installed beforehand).

Package managers are charged with the task of finding, installing, maintaining or uninstalling software packages upon the user's command. Typical functions of a package management system include:

  • Working with file archivers to extract package archives
  • Ensuring the integrity and authenticity of the package by verifying their digital certificates and checksums
  • Looking up, downloading, installing or updating existing software from a software repository or app store
  • Grouping packages by function to reduce user confusion
  • Managing dependencies to ensure a package is installed with all packages it requires, thus avoiding "dependency hell"

6. Compare and contrast different dependency/package management tools used in industry
Maven
 A repository in Maven holds build artifacts and dependencies of varying types.
There are exactly two types of repositories: local and remote. The local repository is a directory on the computer where Maven runs. It caches remote downloads and contains temporary build artifacts that you have not yet released


Yum

Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm. Yum has a plugin interface for adding simple features. Yum can also be used from other python programs via its module inteface.

NuGet

NuGet is the package manager for the Microsoft development platform including .NET. The open-source NuGet client tools provide users with the ability to produce and consume packages in a similar fashion to RedHat's yum, but with a software development focus. The central package repository for NuGet is known as the NuGet Gallery and is used by all package authors and consumers


Chocolatey
Chocolatey is a package manager for Windows. Designed as a decentralized framework for quickly installing applications and tools, it is built on the NuGet infrastructure and uses PowerShell to deliver packages. Chocolatey packages can be used independently, but also integrate with configuration managers like SCCM, Puppet and Chef.

7. What is a build tool? Indicate the significance of using a build tool in large scale software development, distinguishing it from small scale software development 
What does Build Tool mean? 
Build tools are programs that automate the creation of executable applications from source code. Building incorporates compiling, linking and packaging the code into a usable or executable form. In small projects, developers will often manually invoke the build process. This is not practical for larger projects, where it is very hard to keep track of what needs to be built, in what sequence and what dependencies there are in the building process. Using an automation tool allows the build process to be more consistent.

8. Explain the role of build automation in build tools indicating the need for build automation
BUILD AUTOMATION. Build Automation is the process of scripting and automating the retrieval of software code from a repository, compiling it into a binary artifact, executing automated functional tests, and publishing it into a shared and centralized repository
9. Compare and contrast different build tools used in industry 
Ant
Apache’s Ant is an open source Java library and command-line tool used for automating software build processes. It’s primarily used for building Java applications. Created in 2000, Ant is the original build tool in the Java space that’s still being used today. You’ll probably want to include Ivy with it if you want any dependency management capabilities.When to use it: If you want nearly total control over how your build tool runs and are willing to put in the extra effort to get that.Price: free
Pros:

  • XML base means it works well with automatic tools.
  • Once up and running, Ant gives you nearly full control over how things happen.
  • Rich plugin ecosystem opens up a lot of possibilities, and it’s easy to create custom plugins if what you need isn’t available.
  • Solid and extensive documentation.


Cons:

  • XML base means less customization capabilities.
  • Ant makes you do pretty much everything your self, which can be daunting.
  • Build scripts are often very different, which makes understanding other projects difficult.
  • As an old established tool, the community is fairly dead.

Maven
Apache’s Maven is a build automation tool primarily for Java projects, and is the most popular choice for Java developers today by the usage numbers. Unlike Apache Ant, it uses conventions for the build procedure, and only exceptions need to be written down.When to use it: If you want the de facto tool and plugin repository. If you’re running anything unusual with your other tools, Maven will support it. Well suited for large enterprises due to its very fast build speed.

Price: free

Pros:

  • Extensive ecosystem for plugins.
  • Common structure between builds makes understanding other projects easy.
  • Full support for almost any CI, app server, or IDE tool.


Cons:

  • Lots of download requirements for dependencies and plugins.
  • Up and down documentation quality.
  • Community is largely quiet.
  • Customization is weak.
Gradle
Gradle is an open source build automation system. With version 1.0 released in 2012, Gradle aims to “combine the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build.” Its build scripts are written in Groovy, not XML, which creates a host of different advantages and disadvantages compared to Ant or Maven. Despite being a newer tool in this space, it’s seen widespread adoption.When to use it: Gradle is designed for multi-project environments and incremental builds. It’s good if you’re comfortable with Groovy or are willing to get there. It’s also great for personal projects and SMBs.

Price: free

Pros:

  • DSL base means you have a more customizable and streamlined tool.
  • No required build script boilerplate makes for a simpler experience.
  • Excellent documentation and active community. For example, Gradleware is a company designed around facilitating the adoption and use of Gradle through consultancy and other guidance.
  • It’s simple to create custom plugins.


Cons:

  • DSL base means you have a less straightforward and standardized tool.
  • As the new kid on the block, the ecosystem for plugins and the like is less developed.
  • As a newer tool, its support for CI tools and app servers isn’t as fleshed out as Maven or Ant
10. Explain the build life cycle, using an example (java, .net, etc…) 

JAVA
  1. validate: validate the project is correct and all necessary information is available.
  2. compile: compile the source code of the project.
  3. test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
  4. package: take the compiled code and package it in its distributable format, such as a JAR.
  5. integration-test: process and deploy the package if necessary into an environment where integration tests can be run.
  6. verify: run any checks to verify the package is valid and meets quality criteria.
  7. install: install the package into the local repository, for use as a dependency in other projects locally.
  8. deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.



.NET

  1. Page request: The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.
  2. Start: In the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. The page also sets the UICulture property.
  3. Initialization: During page initialization, controls on the page are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
  4. Load: During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
  5. Postback event handling: If the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page. (There is an exception to this sequence: the handler for the event that caused validation is called after validation.)
  6. Rendering: Before rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream object of the page's Response property.
  7. Unload: The Unload event is raised after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and cleanup is performed.

11. What is Maven, a dependency/package management tool or a build tool or something more?

At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:
  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution
If you want more background information on Maven you can check out The Philosophy of Maven and The History of Maven. Now let's move on to how you, the user, can benefit from using Maven


12. Discuss how Maven uses conventions over configurations, explaining Maven’s approach to manage the configurations 
Convention over Configuration

Maven uses Convention over Configuration, which means developers are not required to create build process themselves.
Developers do not have to mention each and every configuration detail. Maven provides sensible default behavior for projects. When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.

13. Discuss the terms build phases, build life cycle, build profile, and build goal in Maven 

Maven Phase
A Maven phase represents a stage in the Maven build lifecycle. Each phase is responsible for a specific task.

Build Profile
A Build profile is a set of configuration values, which can be used to set or override default values of Maven build. Using a build profile, you can customize build for different environments such as Production v/s Development environments.

Profiles are specified in pom.xml file using its activeProfiles/profiles elements and are triggered in variety of ways. Profiles modify the POM at build time, and are used to give parameters different target environments (for example, the path of the database server in the development, testing, and production environments).

Build Lifecycle 
The Maven build follows a specific life cycle to deploy and distribute the target project.
There are three built-in life cycles:
  • default: the main life cycle as it’s responsible for project deployment
  • clean: to clean the project and remove all files generated by the previous build
  • site: to create the project’s site documentation
Each life cycle consists of a sequence of phases. The default build life cycle consists of 23 phases as it’s the main build lifecycle.
On the other hand, clean life cycle consists of 3 phases, while the site lifecycle is made up of 4 phases

Maven Goal 
Each phase is a sequence of goals, and each goal is responsible for a specific task.
When we run a phase – all goals bound to this phase are executed in order

14. Discuss with examples, how Maven manages dependency/packages and build life cycle
Maven manages dependency/packages
Dependency management is a core feature of Maven. Managing dependencies for multi-module projects and applications that consist of hundreds of modules is possible. Maven helps a great deal in defining, creating, and maintaining reproducible builds with well-defined classpaths and library versions.

Maven build life cycle
A Build Lifecycle is a sequence of tasks we used to build a software. For example, compile, test, test more, package and publish or deploy are all tasks we need to do to build a software.
A Maven build lifecycle is a sequence of phases we need to go through in order to finishing building the software

15. Identify and discuss some other contemporary tools and practices widely used in the software industry 

Wrike
it offers a load of useful features including task management, task prioritization, real-time newsfeed, interactive timeline (Gantt chart), and workload management. These tools help both distributed and co-located project teams to work speedily and efficiently. With this solution, your team can schedule, discuss, and prioritize their tasks, and track progress in real time.

Monday.com
Monday.com is one of the leading collaboration and communication software for teams that syncs all information in a single, accessible hub, empowering agents and team members to make important decisions together. Its standout capability is streamlining contribution, helping teams and departments work and collaborate in the most efficient manner. Monday.com allows you to assemble and display progress data in a logical and understandable manner, enabling team members to keep track of projects and common tasks

ProjectManager
ProjectManager is an award-winning online project management tool designed to provide efficiency in project planning, budgeting, scheduling, execution, and reporting. One of the most trusted project management systems in the market today, this tool can help you successfully implement and complete any small or big projects, with either short- or long-term durations.
This platform essentially focuses and provides effective tools on the three major parts of a project—planning, monitoring, and reporting—plus a wide array of advanced add-on features. With ProjectManager, you can create and manage tasks via the cloud, and allows tasks to be updated by your team members even when they’re on-the-go. It also features real-time dashboards, automated emails, and quick report generation. 

Thursday, February 21, 2019

Tutorial 02 - Industry Practices and Tools 1

01.What is the need for Version control system (VCS)?
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
For the examples in this book, you will use software source code as the files being version controlled, though in reality you can do this with nearly any type of file on a computer.


If you are a graphic or web designer and want to keep every version of an image or layout (which you would most certainly want to), a Version Control System (VCS) is a very wise thing to use.

  • It allows you to revert selected files back to a previous state
  • revert the entire project back to a previous state
  • compare changes over time, see who last modified something that might be causing a problem
  • who introduced an issue and when, and more
  • generally means that if you screw things up or lose files, you can easily recover
2.Differentiate the three models of VCSs, stating their pros and cons
Local Version Control Systems
Local version control system maintains track of files within the local system. This approach is very common and simple. This type is also error prone which means the chances of accidentally writing to the wrong file is higher.



Centralized Version Control Systems
In this approach, all the changes in the files are tracked under the centralized server. The centralized server includes all the information of versioned files, and list of clients that check out files from that central place.
Example : CVS, Subversion, and Perforce
                                    
Distributed Version Control Systems
Distributed version control systems come into picture to overcome the drawback of centralized version control system. The clients completely clone the repository including its full history. If any server dies, any of the client repositories can be copied on to the server which help restore the server.
Every clone is considered as a full backup of all the data

Example : Git, Mercurial, Bazaar or Darcs




3.Git and GitHub, are they same or different? Discuss with facts          
                                                                 
                               Git and GitHub are different. 
Git is a revision control system, a tool to manage your source code history
GitHub is a hosting service for Git repositories
 Git is the tool, GitHub is the service for projects that use Git.



4.Compare and contrast the Git commands, commit and push

Since git is a distributed version control system, the difference is that commit will commit changes to your local repository, where as push will push changes up to a remote repo. git commit record your changes to the local repository. git push update the remote repository with your local changes.

git commit "records changes to the repository" while git push" updates remote refs along with associated objects"

5. Discuss the use of staging area and Git directory
Staging area
Git makes it easier for you to do this by allowing you to specify exactly what changes should be committed. To accomplish this, Git uses an intermediate area called the staging area. You can add files one at a time to the staging area
Git directory
The Git directory is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer. The working directory is a single checkout of one version of the project

6. Explain the collaboration workflow of Git, with example
Gitflow Workflow is a Git workflow design that was first published and made popular by Vincent Driessen at nvie. The Gitflow Workflow defines a strict branching model designed around the project release. This provides a robust framework for managing larger projects.

7. Discuss the benefits of CDNs 
1. Your Server Load will decrease:
As a result of, strategically placed servers which form the backbone of the network the companies can have an increase in capacity and number of concurrent users that they can handle. Essentially, the content is spread out across several servers, as opposed to offloading them onto one large server.

2. Content Delivery will become faster:
Due to higher reliability, operators can deliver high-quality content with a high level of service, low network server loads, and thus, lower costs. Moreover, jQuery is ubiquitous on the web. There’s a high probability that someone visiting a particular page has already done that in the past using the Google CDN. Therefore, the file has already been cached by the browser and the user won’t need to download again

3. Segmenting your audience becomes easy:
CDNs can deliver different content to different users depending on the kind of device requesting the content. They are capable of detecting the type of mobile devices and can deliver a device-specific version of the content.

4. Storage and Security:
CDNs offer secure storage capacity for content such as videos for enterprises that need it, as well as archiving and enhanced data backup services. CDNs can secure content through Digital Rights Management and limit access through user authentication.



  1. Performance: reduced latency and minimized packet loss
  2. Scalability: automatically scale up for traffic spikes
  3. SEO Improvement: benefit from the Google SEO ranking factor
  4. Reliability: automatic redundancy between edge servers
  5. Lower Costs: save bandwidth with your web host
  6. Security: KeyCDN mitigates DDoS attacks on edge servers
8. How CDNs differ from web hosting servers?
  • Web Hosting is used to host your website on a server and let users access it over the internet. A content delivery network is about speeding up the access/delivery of your website’s assets to those users.
  • Traditional web hosting would deliver 100% of your content to the user. If they are located across the world, the user still must wait for the data to be retrieved from where your web server is located. A CDN takes a majority of your static and dynamic content and serves it from across the globe, decreasing download times. Most times, the closer the CDN server is to the web visitor, the faster assets will load for them.
  • Web Hosting normally refers to one server. A content delivery network refers to a global network of edge servers which distributes your content from a multi-host environment.


9. Identify free and commercial CDNs

Commercial CDNs
Many large websites use commercial CDNs like Akamai Technologies to cache their web pages around the world. A website that uses a commercial CDN works the same way. The first time a page is requested, by anyone, it is built from the web server. But then it is also cached on the CDN server. Then when another customer comes to that same page, first the CDN is checked to determine if the cache is up-to-date. If it is, the CDN delivers it, otherwise, it requests it from the server again and caches that copy.
A commercial CDN is a very useful tool for a large website that gets millions of page views, but it might not be cost effective for smaller websites.
  • Chrome Frame
  • Dojo Toolkit
  • Ext JS
  • jQuery
  • jQuery UI
  • MooTools
  • Prototype

Free SDNs
We use a lot of open source software in our own projects and we also believe it is important to give back to the community to help make the web a better, faster, and more secure place. While there are a number of fantastic premium CDN solutions you can choose from there are also a lot of great free CDNs (open source) you can utilize to help decrease the costs on your next project. Most likely you are already using some of them without even knowing it. Check out some of the free CDNs below.
  • Google CDN
  • Microsoft Ajax CDN
  • Yandex CDN
  • jsDelivr
  • cdnjs
  • jQuery CDN

10. Discuss the requirements for virtualization
Virtualization separates the backend level and user level for creation of a seamless environment between the two. Virtualization is used for deployment of models of cloud computing services including Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS) among others.

11. Discuss and compare the pros and cons of different virtualization techniques in different levels
Guest Operating System Virtualization

Guest OS virtualization is perhaps the easiest concept to understand. In this scenario the physical host computer system runs a standard unmodified operating system such as Windows, Linux, Unix or MacOS X. Running on this operating system is a virtualization application which executes in much the same way as any other application such as a word processor or spreadsheet would run on the system.

Shared Kernel Virtualization

Shared kernel virtualization (also known as system level or operating system virtualization) takes advantage of the architectural design of Linux and UNIX based operating systems. In order to understand how shared kernel virtualization works it helps to first understand the two main components of Linux or UNIX operating systems. At the core of the operating system is the kernel. The kernel, in simple terms, handles all the interactions between the operating system and the physical hardware. The second key component is the root file system which contains all the libraries, files and utilities necessary for the operating system to function. Under shared kernel virtualization the virtual guest systems each have their own root file system but share the kernel of the host operating system.

Kernel Level Virtualization

Under kernel level virtualization the host operating system runs on a specially modified kernel which contains extensions designed to manage and control multiple virtual machines each containing a guest operating system. Unlike shared kernel virtualization each guest runs its own kernel, although similar restrictions apply in that the guest operating systems must have been compiled for the same hardware as the kernel in which they are running. Examples of kernel level virtualization technologies include User Mode Linux (UML) and Kernel-based Virtual Machine (KVM).

12. Identify popular implementations and available tools for each level of visualization 
Data visualization's central role in advanced analytics applications includes uses in planning and developing predictive models as well as reporting on the analytical results they produce.

13. What is the hypervisor and what is the role of it
Hypervisor 
A hypervisor is a hardware virtualization technique that allows multiple guest operating systems (OS) to run on a single host system at the same time. The guest OS shares the hardware of the host computer, such that each OS appears to have its own processor, memory and other hardware resources.
A hypervisor is also known as a virtual machine manager (VMM).

Hypervisor. ... A computer on which a hypervisorruns one or more virtual machines is called a host machine, and each virtual machine is called a guest machine. The hypervisor presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems.
14. How does the emulation is different from VMs?

Virtualization vs. Emulation

Virtualization is a technology that allows you to create multiple simulated environments or dedicated resources from a single, physical hardware system. This includes splitting a single physical infrastructure into multiple virtual servers; letting it appear as through each virtual machine is running on its own dedicated hardware and allowing each of them to be rebooted independently

Emulation

Emulation is what we do to imitate the behavior of another program or device. It’s like a concept of a sandbox, allowing you to replicate the behaviors and characteristics of a particular software or program on hardware not designed for them.


Virtualization

Virtualization is a technology that allows you to create multiple simulated environments or dedicated resources from a single, physical hardware system. This includes splitting a single physical infrastructure into multiple virtual servers; letting it appear as through each virtual machine is running on its own dedicated hardware and allowing each of them to be rebooted independently.

15. Compare and contrast the VMs and containers/dockers, indicating their advantages and disadvantages 

Both VMs and containers can help get the most out of available computer hardware and software resources. Containers are the new kids on the block, but VMs have been, and continue to be, tremendously popular in data centers of all sizes.

What are VMs?
A virtual machine (VM) is an emulation of a computer system. Put simply, it makes it possible to run what appear to be many separate computers on hardware that is actually one computer.

The operating systems (“OS”) and their applications share hardware resources from a single host server, or from a pool of host servers. Each VM requires its own underlying OS, and the hardware is virtualized. A hypervisor, or a virtual machine monitor, is software, firmware, or hardware that creates and runs VMs. It sits between the hardware and the virtual machine and is necessary to virtualize the server.

Since the advent of affordable virtualization technology and cloud computing services, IT departments large and small have embraced virtual machines (VMs) as a way to lower costs and increase efficiencies
Benefits of VMs
  • All OS resources available to apps
  • Established management tools
  • Established security tools
  • Better known security controls
Popular VM Providers
  • VMware vSphere
  • VirtualBox
  • Xen
  • Hyper-V
  • KVM
What are Containers?
With containers, instead of virtualizing the underlying computer like a virtual machine (VM), just the OS is virtualized.

Containers sit on top of a physical server and its host OS — typically Linux or Windows. Each container shares the host OS kernel and, usually, the binaries and libraries, too. Shared components are read-only. Sharing OS resources such as libraries significantly reduces the need to reproduce the operating system code, and means that a server can run multiple workloads with a single operating system installation. Containers are thus exceptionally light — they are only megabytes in size and take just seconds to start. Compared to containers, VMs take minutes to run and are an order of magnitude larger than an equivalent container.

In contrast to VMs, all that a container requires is enough of an operating system, supporting programs and libraries, and system resources to run a specific program. What this means in practice is you can put two to three times as many as applications on a single server with containers than you can with a VM. In addition, with containers you can create a portable, consistent operating environment for development, testing, and deployment.
Types of Containers
Linux Containers (LXC) — The original Linux container technology is Linux Containers, commonly known as LXC. LXC is a Linux operating system level virtualization method for running multiple isolated Linux systems on a single host.

Docker — Docker started as a project to build single-application LXC containers, introducing several changes to LXC that make containers more portable and flexible to use. It later morphed into its own container runtime environment. At a high level, Docker is a Linux utility that can efficiently create, ship, and run containers.

Benefits of Containers
  • Reduced IT management resources
  • Reduced size of snapshots
  • Quicker spinning up apps
  • Reduced & simplified security updates
  • Less code to transfer, migrate, upload workloads
Popular Container Providers
  • Linux Containers
  • LXC
  • LXD
  • CGManager
  • Docker
  • Windows Server Containers









Tutorial 11 – Client-side development 2 - RiWAs

1. Distinguish the term “Rich Internet Applications” (RIAs) from “Rich Web-based Applications” (RiWAs).  Definition What does Rich Inter...