Wednesday 5 September 2018

Java Version Features (A brief History)

A popular interview question for any Java Developer is “what was new in Java version X?” and if you mention that you have worked with 2 different versions of Java then it's very likely to have a followup question "what was added in the later one?". So here are the important new features added in each major Java release with their code names(At least I was asked for code name once).

Java Version SE 8

Features

  • forEach() method in Iterable interface
  • default and static methods in Interfaces
  • Functional Interfaces and Lambda Expressions
  • Java Stream API for Bulk Data Operations on Collections
  • Java Time API
  • Collection API improvements
  • Concurrency API improvements
  • Java IO improvements
  • Miscellaneous Core API improvements

Java Version SE 7

Code Name: Dolphin Release Date: July 28, 2011.

Features

  • Strings in switch Statement
  • Type Inference for Generic Instance Creation
  • Multiple Exception Handling
  • Support for Dynamic Languages
  • Try with Resources
  • Java NIO Package
  • Binary Literals and underscore in literals
  • Diamond Syntax
  • Automatic null Handling

Java Version SE 6

Code Name: Mustang Release Date: December 11, 2006.

Features

  • Scripting Language Support
  • JDBC 4.0 API
  • Java Compiler API
  • Pluggable Annotations
  • Native PKI, Java GSS, Kerberos and LDAP support.
  • Integrated Web Services.
  • Lot more enhancements.

J2SE Version 5.0

Code Name: Tiger Release Date: September 30, 2004.

Features

  • Generics
  • Enhanced for Loop
  • Autoboxing/Unboxing
  • Typesafe Enums
  • Varargs
  • Static Import
  • Metadata (Annotations)
  • Instrumentation

J2SE Version 1.4

Code Name: Merlin Release Date: February 6, 2002 (first release under JCP).

Features

  • XML Processing
  • Java Print Service
  • Logging API
  • Java Web Start
  • JDBC 3.0 API
  • Assertions
  • Preferences API
  • Chained Exception
  • IPv6 Support
  • Regular Expressions
  • Image I/O API

J2SE Version 1.3

Code Name: Kestrel Release Date: May 8, 2000.

Features

  • Java Sound
  • Jar Indexing

J2SE Version 1.2

Code Name: Playground Release Date: December 8, 1998.

Features

  • Collections framework.
  • Java String memory map for constants.
  • Just In Time (JIT) compiler.
  • Jar Signer for signing Java ARchive (JAR) files.
  • Policy Tool for granting access to system resources.
  • Java Foundation Classes (JFC) which consists of Swing 1.0, Drag and Drop, and Java 2D class libraries.
  • Java Plug-in
  • Scrollable result sets, BLOB, CLOB, batch update, user-defined types in JDBC.
  • Audio support for Applets.

JDK Version 1.1

Release Date: February 19, 1997

Features

  • JDBC (Java Database Connectivity)
  • Inner Classes
  • Java Beans
  • RMI (Remote Method Invocation)
  • Reflection (introspection only)

JDK Version 1.0

This is where it all started. The first official release of Java as a Programming language. Code Name: Oak Release Date: January 23, 1996.

Introduction to ORM (Hibernate)

Hibernate, If you are a Java developer I am sure you heard this name already. Yes! it is one of the ORMs available in the market.
ORM tool or you can say an ORM Frameworks stands for Object Relational Mapping.
If you have never worked with any ORM tool then your project structure will be like this
As you have used JDBC for a long time and we know that it is very powerful API for a Java developer it gives a way to connect your application with the database but it still has some problems related to java’s best feature Object Oriented.

Demerits of JDBC approach-

  1. You will be using native SQL queries
  2. In case of changing your database vendor you have to change all your queries
  3. As Java is object-oriented, So you need to manually convert database ResultSet to Java Objects and vice-versa (Database object to Java Object and vice-versa)
  4. Java developer may require database specific knowledge (Database objects, SQL)
  5. State of Java Objects fetched from databse needs to be managed manually.
ORM tool basically solves the main problem of JDBC API, it maps database objects to Java objects. An ORM makes database operations Object Oriented. A developer can manage database by just handling simple java objects. But this is to keep in mind ORM internally using JDBC to manage your objects.

Benefits of ORM-

  1. Productivity: When using an ORM tool, the amount of code is unlikely to be reduced—in fact, it might even go up—but the ORM tool generates 100% of the data access code automatically based on the data model you define, in mere moments.
  2. Application Design: A good ORM tool designed by very experienced software architects will implement effective design patterns that almost force you to use good programming practices in an application. This can help support a clean separation of concerns and independent development that allows parallel, simultaneous development of application layers.
  3. Code Reduce: If you create a class library to generate a separate DLL (Data description language) for the ORM-generated data access code, you can easily reuse the data objects in a variety of applications. This way, each of the applications that use the class library need have no data access code at all.
  4. Application Maintainability: All of the code generated by the ORM is presumably well-tested, so you usually don’t need to worry about testing it extensively. Obviously, you need to make sure that the code does what you need, but a widely used ORM is likely to have code banged on by many developers at all skill levels. Over the long term, you can refactor the database schema or the model definition without affecting how the application uses the data objects.
One potential downside to using an ORM is performance. It is very likely that the data access code generated by the ORM is more complex than you’d typically write for an application. This is because most ORMs are designed to handle a wide variety of data-use scenarios, far more than any single application is ever likely to use. Complex code generally means slower performance, but a well-designed ORM is likely to generate well-tuned code that minimizes the performance impact. Besides, in all but the most data-intensive applications, the time spent interacting with the database is a relatively small portion of the time the user spends using the application. Nevertheless, we’ve never found a case where the small performance hit wasn’t worth the other benefits of using an ORM. You should certainly test it for your data and applications to make sure that the performance is acceptable.
There are lots of ORM tools available in the market.

List of ORM:

  1. Hibernate
  2. JPA
  3. Active JPA
  4. iBATIS
  5. IBM Pure Query
  6. See more on Wikipedia