Friday, March 15, 2019

Web services and SOAP

 web applications with web services, indicating the need for web services

Web services achieve this task with the help of XML, SOAP, WSDL and UDDI open standards. web services do not necessarily have a user interface since it is used as a component in an application. An application that the users access over the internet is called a web application.


There are three types of operations:
1. One way
2. Request response
3. Notification
Web Services vs Web Applications
  • Web Services can be used to transfer data between Web Applications.
  • Web Services can be accessed from any languages or platform.
  • A Web Application is meant for humans to read, while a Web Service is meant for computers to read.
  • Web Application is a complete Application with a Graphical User Interface (GUI), however, web services do not necessarily have a user interface since it is used as a component in an application.
  • Web Application can be access through browsers.


Discuss what WSDL is and the use of it in the context of web services

WSDL Web Services Description Language is an XML-based standard for describing a web service. A WSDL document (often itself just called a WSDL) describes the available functions of a web service, their expected arguments, and the data types for their return values. WSDLs are used by developers of client applications that consume XML-based web services.

Fundamental properties of a WSDL document and the use of WSDL document in web services and client development 

WSDL document is a document that is used to describe a web service. This is key for any client application to know where the web service is located. It also allows the client application to understand the methods available in the web service. '
At an abstract level, WSDL 2.0 describes a Web service in terms of the messages it sends and receives; messages are described independent of a specific wire format using a type system, typically XML Schema. An operation associates a message exchange pattern with one or more messages.

structure of the WSDL document, explaining the elements in WSDL

WSDL Document Elements. A WSDL document has a definitions element that contains the other five elements, types, message, port Type, binding and service. The following sections describe the features of the generated client code. WSDL supports the XML Schema specification (XSD) as its type system. 
A WSDL document contains the following elements −
  • Definition − It is the root element of all WSDL documents. It defines the name of the web service, declares multiple namespaces used throughout the remainder of the document, and contains all the service elements described here.
  • Data types − The data types to be used in the messages are in the form of XML schema.
  • Message − It is an abstract definition of the data, in the form of a message presented either as an entire document or as arguments to be mapped to a method invocation.
  • Operation − It is the abstract definition of the operation for a message, such as naming a method, message queue, or business process, that will accept and process the message.
  • Port type − It is an abstract set of operations mapped to one or more end-points, defining the collection of operations for a binding; the collection of operations, as it is abstract, can be mapped to multiple transports through various bindings.
  • Binding − It is the concrete protocol and data formats for the operations and messages defined for a particular port type.
  • Port − It is a combination of a binding and a network address, providing the target address of the service communication.
  • Service − It is a collection of related end-points encompassing the service definitions in the file; the services map the binding to the port and include any extensible definitions.
More details you can follow this link:-


PortType and operation elements in WSDL with the java equivalences

Service providers and consumers are free to implement their ends of the exchange in any way they want, as long as the actual messages they send match the service definition. The use of service definitions specifying XML message exchanges is what sets web services apart from earlier technologies for distributed programming.

Binding and service elements in WSDL 


WSDL Elements Definition − It is the root element of all WSDL documents.Binding − It is the concrete protocol and data formats for the operations and messages defined for a particular port type. Port − It is a combination of a binding and a network address, providing the target address of the service communication. 


Explain how SOAP is used with HTTP

SOAP is a protocol which is used to interchange data between applications which are built on different programming languages.SOAP is built upon the XML specification and works with the HTTP protocol.This makes it a perfect for usage within web applications. The SOAP building blocks consist of a SOAP Message.



Discuss how SOAP can be used for functional oriented communication?


SOAP ( Simple Object Access Protocol) is a message protocol that allows distributed elements of an application to communicate. SOAP can be carried over a variety of lower-level protocols, including the web-related Hypertext Transfer Protocol (HTTP). SOAP defines a header structure that identifies the actions that various SOAP nodes are expected to take on the message, in addition to a payload structure for carrying information.SOAP is a protocol which is used to interchange data between applications which are built on different programming languages.SOAP is built upon the XML specification and works with the HTTP protocol. This makes it a perfect for usage within web applications.
The SOAP building blocks consist of a SOAP Message.The concept of routing a message through a string of nodes that perform different functions is how SOAP supports things like addressing, security and format-independence. Essentially, the headers identify roles, which in turn provide the SOA features which SOAP then routes to. Stringing messages through a sequence of steps is uncommon in today’s microservice-centric development environments. 

Explain the structure of SOAP message in message oriented communication, indicating the elements used

The SOAP specification establishes a standard message format that consists of an XML document capable of hosting RPC and document-centric data (see Figure 3.19). This facilitates synchronous (request and response) as well as asynchronous (process-driven) data exchange models.SOAP is a communication protocol designed to communicate via Internet. 
The envelope element is the mandatory element in the SOAP message and is used to encapsulate all of the data in the SOAP message. The header element can be used to contain information such as authentication information or the definition of complex data types.


Importance of the SOAP attachments, explaining the MIME header

This document defines a SOAP feature that represents an abstract model for SOAP attachments.It provides the basis for the creation of SOAP bindings that transmit such attachments along with a SOAP envelope, and provides for reference of those attachments from the envelope. 
The MIME stands for Multi-Purpose Internet Mail Extensions. As the name indicates, it is an extension to the Internet email protocol that allows it’s users to exchange different kinds of data files over the Internet such as images, audio, and video. The MIME is required if text in character sets other than ASCII. Virtually all human-written Internet email and a fairly large proportion of automated email is transmitted via SMTP in MIME format. Actually, MIME was designed mainly for SMTP, but the content types defined by MIME standards are important also in communication protocols outside of email, such as HTTP. In 1991, Nathan Borenstein of Bell core proposed to the IETF that SMTP be extended so that Internet (but mainly Web) clients and servers could recognize and handle other kinds of data than ASCII text. As a result, new file types were added to "mail" as a supported Internet Protocol file type.

more details :-


Explain the annotations in JAX-WS, providing examples of their use 


JAX-WS Annotations (JSR 224). Describes the supported JAX-WS annotations and their associated properties. The @Action annotation specifies the WS-addressing action that is associated with a web service operation.

There are two types of web services:
  1. SOAP Web Services
  2. Restful Web Services




How a web service can be tested using different approaches

What is the testing approach towards web services?Testing of web services is one of the important type of software testing approach, which is mainly used to determine the expectations for reliability, functionality, performance.
As these days Automated testing is considered as one of the most trending methodology in the field of software testing, hence testing web apps based on Restful APIs through automation will provide effective test results. Some of the best & popular tools for web services testing are:
  1. Soap UI,
  2. Testing-whiz,
  3. Softest
  4. Test Maker,
  5. Postman, 











Thursday, March 7, 2019

Explain the term 'distributed systems', contrasting it from 'distributed computing'


 A distributed system is a network that consists of autonomous computers that are connected using a distribution middle ware. They help in sharing different resources and capabilities to provide users with a single and integrated coherent network.
Distributed computing is a computing concept that, in its most general sense, refers to multiple computer systems working on a single problem. In distributed computing, a single problem is divided into many parts, and each part is solved by different computers.





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

 Operating system is developed to ease people daily life. For user benefits and needs the operating system may be single user or distributed. In distributed systems, many computers connected to each other and share their resources with each other. There are some advantages and disadvantages of distributed operating system that we will discuss.


Advantages of distributed operating systems:-
  • Give more performance than single system
  • If one pc in distributed system malfunction or corrupts then other node or pc will take care of
  • More resources can be added easily
  • Resources like printers can be shared on multiple pc’s
Disadvantages of distributed operating systems:-
  • Security problem due to sharing
  • Some messages can be lost in the network system
  • Bandwidth is another problem if there is large data then all network wires to be replaced which tends to become expensive
  • Overloading is another problem in distributed operating systems
  • If there is a database connected on local system and many users accessing that database through remote or distributed way then performance become slow
  • The databases in network operating is difficult to administrate then single user system



Discuss the elements of distributed systems


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. The components interact with one another in order to achieve a common goal.



Identify different types of services, which can be gained from distributed systems, specifying the protocols used for them 


  1. Mail service (SMTP, POP3, IMAP)
  2. File transferring and sharing (FTP)
  3. Remote logging (telnet)
  4. Games and multimedia (RTP, SIP,H.26x)
  5. Web (HTTP)




Identify examples for both browser-based and non-browser-

based clients of distributed systems  


A browser-based (or web-based) tool, application, program, or app is software that runs on your web browser. Browser-based applications only require an internet connection and an installed web browser on your computer to function. Most web-based applications are installed and run on a remote server that you access with your web browser.
client does not share any of its resources, but requests a server's content or service function.Clients therefore initiate communication sessions with servers which await incoming requests. Examples of computer applications that use the client–server model are Email, network printing, and the World Wide Web.
 


Discuss the characteristics of different types of Web-based systems, including the RiWAs 



  • Type 1: server-side HTML web application.
  • Type 2: JS generation widgets (AJAX)
  • Type 3: service-oriented single-page web apps 

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

A distributed system is a software system that interconnects a collection of heterogeneous independent computers, where coordination and communication between computers only happen through message passing, with the intention of working towards a common goal. The idea behind distributed systems is to provide a viewpoint of being a single coherent system, to the outside world. So, the set of independent computers or nodes are interconnected through a Local Area Network (LAN) or a Wide Area Network (WAN).
In this blog, I would like to talk about the available Distributed System architectures that we see today and how they are being utilised in our day to day applications. Distributed system architectures are bundled up with components and connectors. Components can be individual nodes or important components in the architecture whereas connectors are the ones that connect each of these components. 

  • Component: A modular unit with well-defined interfaces; replaceable; reusable
  • Connector: A communication link between modules which mediates coordination or cooperation among components
 So the idea behind distributed architectures is to have these components presented on different platforms, where components can communicate with each other over a communication network in order to achieve specifics objectives.

Architectural Styles

There are four different architectural styles, plus the hybrid architecture, when it comes to distributed systems.  The basic idea is to organise logically different components, and distribute those computers over the various machines.

  • Layered Architecture
  • Object Based Architecture
  • Data-centred Architecture
  • Event Based Architecture
  • Hybrid Architecture

Layered Architecture

The layered architecture separates layers of components from each other, giving it a much more modular approach. A well known example for this is the OSI model that incorporates a layered architecture when interacting with each of the components. Each interaction is sequential where a layer will contact the adjacent layer and this process continues, until the request is been catered to. But in certain cases, the implementation can be made so that some layers will be skipped, which is called cross-layer coordination. Through cross-layer coordination, one can obtain better results due to performance increase.

 Object Based Architecture

This architecture style is based on loosely coupled arrangement of objects. This has no specific architecture like layers. Like in layers, this does not have a sequential set of steps that needs to be carried out for a given call. Each of the components are referred to as objects, where each object can interact with other objects through a given connector or interface. These are much more direct where all the different components can interact directly with other components through a direct method call.

Compare and contrast the micro-service architecture from 

monolithic architecture

Micro services Architecture. The idea is to split your application into a set of smaller, interconnected services instead of building a single monolithic application. Each micro service is a small application that has its own hexagonal architecture consisting of business logic along with various adaptors.


Explain the MVC style, indicating the limitations of it in the context of web-based systems

Design Patterns - MVC Pattern. MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns. Model - Model represents an object or JAVA POJO carrying data. 

As consumers continue to migrate online to do their shopping, it’s natural that companies follow suit by moving their customer service options to Web-based platforms. Doing so can take care of issues quickly, linking customers to relevant policies and forms to expedite solutions. However, this capability comes with disadvantages as well.


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.
nother 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.
  1. Comparison Chart
  2. Definition
  3. Key Differences
  4. Conclusion





Explain the need for CORBA, indicating it’s use in web-based 

systems 

The Common Object Request Broker Architecture (CORBA) is a standard developed by the Object Management Group (OMg) to provide inseparability among distributed objects. CORBA is the world's leading middle ware solution enabling the exchange of information, independent of hardware platforms, programming languages, and operating systems. CORBA is essentially a design specification for an Object Request Broker (ORB), where an ORB provides the mechanism required for distributed objects to communicate with one another, whether locally or on remote devices, written in different languages, or at different locations on a network.
The CORBA Interface Definition Language, or IDL, allows the development of language and location-independent interfaces to distributed objects. Using CORBA, application components can communicate with one another no matter where they are located, or who has designed them. CORBA provides the location transparency to be able to execute these applications.
CORBA is often described as a "software bus" because it is a software-based communications interface through which objects are located and accessed. The illustration below identifies the primary components seen within a CORBA implementation.



 Discuss the XML specification


XML code, a formal recommendation from the World Wide Web Consortium (W3C), is similar to Hypertext Markup Language (HTML). Both XML and HTML contain markup symbols to describe page or file contents. HTML code describes Web page content (mainly text and graphic images) only in terms of how it is to be displayed and interacted with.




 Compare and contrast XML and JSON, indicating the pros and 

cons of both 


JSONXML
JSON strengths
Fully automated way of DE-serialising/serialising JavaScript objects, minimum to no codingDevelopers have to write JavaScript code to serialise/DE-serialise to/from XML
Very good support by all browsersWhile XML parser are built-in into all modern browsers, cross-browser XML parsing can be tricky, e.g., see this article
Concise format thanks to name/value pair -based approachVerbose format because of tags and namespaces
Fast object DE-serialisation in JavaScript (based on anecdotal evidence )Slower DE-serialisation in JavaScript (based on anecdotal evidence )
Supported by many AJAX toolkit and JavaScript librariesNot very well supported by AJAX toolkit
Simple API (available for JavaScript and many other languages)More complex APIs
JSON weaknesses
No support for formal grammar definition, hence interface contracts are hard to communicate and enforceXML Schema or DTD can be used to define grammars
No namespace support, hence poor extensibleGood namespace support, many different extensible options in Schema
Limited development tools supportSupported by wide array of development and other (e.g., transformation) tools
Narrow focus, used for RPC only, primarily with JavaScript clients (although one can argue that it's one of the strengths)Broad focus - can be used for RPC, EDI, metadata, you name it
No support in Web services -related products (application servers, ESBs, etc), at least not yetSupported by all Web services products


Friday, March 1, 2019

Industry practices and tools

 Importance of maintaining the quality of the code, explaining the different aspects of the code quality

When we talk about clean code, we talk about reader-focused development style that produces software that’s easy to write, read and maintain. Clean code is code that is easy to understand and easy to change.
The word “clean” became very trendy nowadays, if you look at design, photography, etc. people go for clean things, because nowadays our life is extremely complicated and we want to choose clean and clear options, because it calms us down and saves our precious time. Same in software development & architecture, if you have more code than you need, it shouldn’t be there, there shouldn’t be anything extra.
Importance of Code Quality and Coding Standard in Software Development .These procedures can be for various aspects of the program written in that language.If the source code maintains consistency, a clear view of how code fits in the.Too much explanation will make your code look clumsy.



Explain different approaches and measurements used to measure the quality of code

There are many reasons to why we want to measure quality. Some developers like to use metrics to identify areas of the code that could be improved. Others use metric as a quality gate; if the code doesn't satisfy a certain 'quality' criteria, the build fails.
Managers may have different reasons to why they want to measure quality. Although they may say otherwise, the most common reasons to why they want software quality to be measured are:
  • Lack of trust.
  • Fear of being responsible for things they don't understand.
  • Find other people to blame in case something goes wrong.
  • Try to find a justification for the general dissatisfaction among the people building or using the software.
  • Show they are in control.
  • Cover their backside, showing that they are doing something to control quality (ticking a box).
  • Annual targets and bonuses (normally associated to the percentage of test coverage).
With the exception of a few developers and academics, the people that are keener to find a way to measure software quality are the ones that don't write software on a daily basis. Many of them don't even understand how some of the metrics are calculated, but they want a way to control what they don't understand. How many times have we heard stories about managers who force their teams to keep test coverage above a certain percentage? Do they really know what it means? Would they be able to help the teams to achieve that? Can they distinguish good tests from bad tests.Quality Management Measurement - Learn Software Quality .These attributes describe not only the code but also the other documents that support .A clear understanding of goals can be used to generate suggested metrics for a The GQM approach provides a framework involving the following three steps.

Identify and compare some available tools to maintain the code quality 

Code quality is a group of different attributes and requirements, determined and prioritized by your business. Here are the main attributes that can be used to determine it:
  • Clarity: Easy to read and oversee for anyone who isn’t the creator of the code. If it’s easy to understand, it’s much easier to maintain and extend the code. Not just computers, but also humans need to understand it.
  • Maintainable: A high-quality code isn’t over complicated. Anyone working with the code has to understand the whole context of the code if they want to make any changes.
  • Documented: The best thing is when the code is self-explaining, but it’s always recommended to add comments to the code to explain its role and functions. It makes it much easier for anyone who didn’t take part in writing the code to understand and maintain it.
  • Refactored: Code formatting needs to be consistent and follow the language’s coding conventions.
  • Well-tested: The less bugs the code has the higher its quality. Thorough testing filters out critical bugs ensuring that the software works the way it’s intended.
  • Extensible: The code you receive has to be extensible. It’s not really great when you have to throw it away after a few weeks.
  • Efficiency: High-quality code doesn’t use unnecessary resources to perform a desired action

 Discuss the need for dependency/package management tools in software development

Dependency management has always been hard. One of the best illustrations of the problem is Microsoft’s aptly named “DLL Hell.” Back in the 1990s and early 2000s, Microsoft products were built with the Component Object Model (COM). COM was a complex system. Still, one of its benefits was the ability to expose an application programming interface (API). Integrating API functionality in other applications was done via Dynamic Linked Libraries.
A package manager or package management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner. It typically maintains a database of software dependencies and version information to prevent software mismatches and missing prerequisites.


Compare and contrast different dependency/package management tools used in industry 

In the world around you a dependency is the state of existence of an entity or an item such that its stability is dictated by another entity or resource.For example children are dependent on their parents for care and sustenance. The elderly are often dependent on their progeny for the same. And workers are largely dependent on corporations for money and income.

JVM ecosystem is dominated with three build tools:
  • Apache Ant with Ivy
  • Maven
  • Cradle
 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 

A build tool is a programming utility that is used when building a new version of a program. For example, make is a popular open source build tool that uses make file, another build tool, to ensure that source files that have been updated (and files that are dependent on them) will be compiled into a new version (build) of a program.






Explain the role of build automation in build tools indicating the need for build automation 

In the context of software development, build refers to the process that converts files and other assets under the developers' responsibility into a software product in its final or consumable form. The build may include:
  • compiling source files
  • packaging compiled files into compressed formats (such as jar, zip)
  • producing installers
  • creating or updating of database schema or data
The build is automated when these steps are repeatable, require no direct human intervention, and can be performed at any time with no information other than what is stored in the source code control repository.Ant is used to automate a build process, but a build process is often much more than compiling. Ant has "tasks" that can be used to perform miscellaneous useful functions.
This is useful for instance to differentiate between test and production builds where deployment paths, database instances, etc.

Compare and contrast different build tools used in industry 


 Explain the build life cycle, using an example

Maven is based around the central concept of a build life cycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined.
For the person building a project, this means that it is only necessary to learn a small set of commands to build any Maven project, and the POM will ensure they get the results they desired.
There are three built-in build life cycles: default, clean and site. The default life cycle handles your project deployment, the clean life cycle handles project cleaning, while the site life cycle handles the creation of your project's site documentation
  • validate - validate the project is correct and all necessary information is available
  • compile - compile the source code of the project
  • test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  • package - take the compiled code and package it in its distributed format, such as a JAR.
  • verify - run any checks on results of integration tests to ensure quality criteria are met
  • install - install the package into the local repository, for use as a dependency in other projects locally
  • deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.


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

Taking Java as an example. In java , you may include all the related classes (functionality wise or any criteria) in the same package.Dependency is used to refer when something requires another thing to get executed itself. Simply, ‘A’ depends on ‘B’.
 Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.


 Maven uses conventions over configurations, explaining Maven’s approach to manage the configurations

Maven uses Convention over Configuration, which means developers are not required to create build process themselves. 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.