Wednesday 26 February 2014

Login Application demo using Spring MVC, JAX-WS, JPA , Hibernate , Mysql

Login Application demo using Spring MVC, JAX-WS, JPA , Hibernate , Mysql

https://github.com/milandashara/Spring-MVC-JAX-WS-JPA-Hibernate-Mysql-Demo
 

Sunday 16 February 2014

Test Driven Development



Write the tests before development. Gradually correct the failed tests by writing implementation code.

So overall quality of code is good and is according to requirement specification.

It also reduces programmers debugging effort. Tests produced helps in improving readability and understanding of code.

Testing and Good Design are related. So It also improves overall Design.

How To Identify Tests

1. Identify tests with +ve / correct outcome
2. Identify tests with -ve / incorrect outcome
3. Identify tests which may cause exception i.e Destructive tests.

For example , sum(int a,int b) where a,b are +ve integer.
Tests
1. sum(5,7)
2. sum(-5,7)  -ve integer input is invalid
3. sum(null,null) null is not integer

There are various benefits and shortcomings of test drive development. So make sure that it fits proper in your development process before using it.

Monday 10 February 2014

how to decide to choose abstract class or an interface (Java or .Net)

The abstract class inheritance is used when the subclasses / childs / derived shares the core properties and behaviour of the abstract class. The kind of behaviour that actually defines the class.

On the other hand interface inheritance is used when the classes share peripheral behaviour, ones which do not necessarily define the derived class. It is used to separate implementation and specification. For example , your impl class is called by client using rmi , if there is any change impl class. You are not required to give impl class to client. Client can call impl using specification / interface.



For eg.
Abstract Class : A Car and a Truck shares a lot of core properties and behaviour of an Automobile abstract class,
Interface : They also share some peripheral behaviour like Drillers or PowerGenerators share and doesn't necessarily defines a Car or a Truck, so Car, Truck, Driller and PowerGenerator can all share the same interface IExhaust.