Saturday, June 11, 2016

spring mvc simple example


Hadoop Simple Example


Three friends went on trip , each paying bills which needs to be split among them.

We need to write a MapReduce Job

References

Hadoop


Hadoop is a programming framework used to process Big Data over a network. First we need to understand big data.The definition of Big data is as follows:

extremely large data sets that may be analysed computationally to reveal patterns, trends, and associations, especially relating to human behaviour and interactions.

Let us classify Big data into 3 types:
  • Structured Data
  • Semi Structured Data
  • Unstructured Data

Structured data is like the data stored in the SQL tables of Relational database.

Semi Structured data is like the data stored in the XMLs.

Unstructured Data is the data stored in word document or pdf .

To process big data over a network google has developed an algorithm known as MapReduce which Hadoop has made use of.

Let's try a Simple Example to understand

References

Agile Methodology

The definition of agile is
Agile software development is a set of principles for software development in which requirements and solutions evolve through collaboration between self-organizing, cross-functional teams

The methods of Agile are :

Scrum : A product owner lists down the requirements which are called as backlogs. Cross functional teams lead by the Scrum Master picks up the backlog according to the priority and deliver it in successive sprints .

Lean : it focusses on
eliminations of waste.
Deciding as late as possible , delivering as early as possible.
Amplifying learning , building integrity in and seeing the whole.

Kanban : principle of kanban are :
Visualize what you have done today.
Limit the amount of work in progress.
Enhance flow.

Extreme Programming :The supporting practices of this methodology are:
Planning Game
Small Releases
Customer Acceptance Tests
Simple Design
Pair Programming
Test-Driven Development
Refactoring
Continuous Integration
Collective Code Ownership
Coding Standards
Metaphor
Sustainable Pace

References

https://www.versionone.com/agile-101/agile-methodologies/

Spring Mvc Testing

Testing Spring MVC is used to test MVC applications developed in spring.To remove the dependency of the application server and few object we need to  Mock it.The web application dependency includes servlet handler , resource handler , exception handler , view handler.
This tutorial requires minimum of Junit 4.9 , javax-servlet-api 3.0.2. You might face Spring4TestRunner exception and NoClassDefFound javax.servlet.SessionCookieConfig
If there any autowired beans in your controller class you might face an exception like IllegalState Failed to load ApplicationContext
Reference:
http://blog.zenika.com/2013/01/15/spring-mvc-test-framework/
http://www.petrikainulainen.net/programming/spring-framework/unit-testing-of-spring-mvc-controllers-configuration/

Sunday, May 22, 2016

Hosting a SOAP Web Service Java


Step 1
Create a dynamic web project in eclipse
Create an endpoint interface
package org.myProject.passwordManager;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 @WebService public interface PasswordManagerWS {
 @WebMethod public abstract String getPassword(String appId);
 }
Create an implementation of Web Service
package org.myProject.passwordManager;
 import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding; @WebService(endpointInterface="org.myProject.passwordManager.PasswordManagerWS", serviceName="PasswordManagerWS")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
 public class PasswordManagerWSImpl implements PasswordManagerWS{
 @WebMethod public String getPassword(@WebParam(name="appId")String appId) { System.out.println("test ws"); return "test";
 }
 }

ec2-user@ec2 Permission denied