Saturday, 25 October 2014

Java beans

Java bean is reusable software component for java. We can access them using getter and setter methods.

It has default or no argument constructor. We can create a bean for a class in xml file and then use their members in java code.

See in Java spring framework we will create beans with spring inbuilt classes.

Now a days it is a good idea to create an object of a class using Java bean.

We will create Java beans in xml file.

Thursday, 23 October 2014

Eclipse and Maven configuration.

Download Java and install it in your computer.

As you know you can even write your java code with command line and a txt editor but its not a good idea to develop a software. So there are some good Integrated Development Environments (IDEs) like :-

1) Eclipse

2) Netbeans

I prefer eclipse but it depends on you. Both are good and user friendly and both are open source and will be.

So download eclipse from above link.

What is Apache Maven ?

It is a build automation tool mainly used for Java projects. As we know that sometimes we need to use 3rd party jars. So we go to google.com and download that .jar file and then add that .jar file to our Java project.

But now a days this is not a good idea to deal with .jar files. So Apache Maven is used. When you create maven project in eclipse it generates pom.xml file for your maven project. So you just add dependency for that .jar file with version info and maven will download and add to your class path automatically.

Why Apache Maven ?

As you have seen how jar files can be used easily with maven then who thinks to download manually rather than automatically. As Maven downloads jar files automatically so more and more developers love to use it rather then tradition way. Also it is easy to use maven in eclipse using m2e eclipse plugin that you can get from eclipse market place.

Introduction to Java Spring Framework.

Spring framework is very famous open source framework based on Java. Now a days more and more web apps are made of Spring Framework because of its good features.

The first version was written by Rod Johnson and it was first released under Apache license.

There are some good modules of Spring Framework as described below :-

Spring Core Container: This is the base module of Spring and provides spring containers (BeanFactory and ApplicationContext).

Aspect Oriented Programming: Enables implementation of cross-cutting concerns.

Data Access: To work ORM (Object Relational Mapping) like Hibernate.

MVC: Model-View-Controller structure to easily manage your complex systems.

Inversion Of Control: It is to be done via Dependency Injection.

Why use Java Spring Framework ?

So you have seen modules as described above and you know that MVC structure is very famous now a days and Java and Spring Framework both are open source and other modules add advantage to this framework so now a days more and more Enterprise Applications made in Java Spring Framework. More and more developers use Spring Framework.

All know that Java is strong , secure and robust programming language and spring framework is easy to use so people love to use Java Spring Framework.