Java vs Spring
Java is one of the most popular object oriented programming languages in the world. Java is heavily used for software and web development. Spring is an open source application framework. Although it is not dependent on any programming model, Spring framework has become very popular among Java programmers. Spring framework acts as a replacement or an addition to Java’s own EJB (Enterprise Java Beans).
What is Java?
Java is one of the most widely used object oriented (and class-based) programming languages used for software development to web development, today. It is a general purpose and concurrent programming language. It was originally developed by Sun Microsystems in 1995. James Gosling is the father of the Java programming language. Oracle Corporation now owns Java (after buying Sun Microsystems recently). Java Standard Edition 6 is its current stable release. Java is a strongly typed language that supports a range of platforms from Windows to UNIX. Java is licensed under GNU General Public License. Java’s syntax is very much similar to C and C++.
Java source files have the .java extension. After compiling Java source files using the javac compiler, it will produce .class files (containing the Java bytecode). These bytecode files can be interpreted using the JVM (Java Virtual Machine). Since the JVM can be run on any platform, Java is said to be multi-platform (cross-platform) and highly portable. Typically, end users use the JRE (Java runtime Environment) to run the Java bytecode (or Java Applets on web browsers). Software developers use the Java Development Kit (JDK) for application development. This is a superset of JRE, which includes a compiler and a debugger. A nice feature of Java is its automatic garbage collection, where objects that are no longer required are removed from memory automatically.
What is Spring?
Spring is an open source application framework. It was developed by Rod Johnson and the first version was released in 2004. Spring 3.0.5 is the current version of the Spring framework. It is licensed under Apache 2.0 license. Any Java application can use the core features of the Spring framework. Spring has become widely used within the Java community, even though the framework is independent of any programming model. Spring framework is used either as a replacement or an addition to EJB model. Some of the most important modules of Spring framework are IoC (Inversion of Control), AOP (Aspect Oriented Programming), MVC (Model View Controller), Transaction Management, Data Access, Authentication, Authorization, Remote Access Management, Batch processing, Messaging and Testing.
What is the difference between Java and Spring?
Java is a programming language, while Spring is an open source application framework. Therefore, they cannot be directly compared. However, Java EE (which is Java’s own server programming platform) is often compared against Spring framework. In fact, Spring framework is very popular among Java programmers (even though Spring is language independent and can be used with any programming model) because it is often used as a replacement or an addition to EJB (which come with Java EE).