Kayıtlar

Java 10 New Features

Java SE 10 was released in March 2018. The full list of new features in JDK 10 can be found here: http://openjdk.java.net/projects/jdk/10/ In this tutorial, we will look at some of these new features and examine some of them. 1. JEP 286: Local-Variable Type Inference To decrease the boilerplate coding, Java 10 introduces local-variable type inference feature. With this feature it is not mandatory explicitly declaring the type of a local variable. Instead, the compiler infers the type of the expression. Without JEP 286:  List<String> list = new ArrayList<>(); Stream<String> stream = list.stream(); With JEP 286: var list = new ArrayList<String>(); var stream = list.stream(); 2. JEP 307: Parallel Full GC For G1 The G1 garbage collector was made the default in JDK 9. However it uses a single threaded mark-sweep-compact algorithm. With Java 10, G1 now does full GC in parallel. The number of threads used during parallel phases of the...

It's Time For Faster Releases

According to the article published on 2017.09 by Mark Reinhold, the chief architect of the Java Platform Group; Java will have feature releases every six months rather than the present multiyear cycles. Here is the keynotes:  Java will have feature releases every six months rather than the present multiyear cycles. Af ter Java 9 , a strict, time-based model will be followed with a new feature release every six months, update releases every quarter, and a long-term support release every three years. Feature releases can contain any type of feature, including not just new and improved APIs but also language and JVM features. New features will be merged only when they’re nearly finished, so that the release currently in development is feature-complete at all times. Feature releases will ship in March and September of each year, starting in March of 2018 . Update releases will be strict...

Java 9 New Features

Java SE 9 was released in September 2017 with a rich feature set.  The full list of new features in JDK 9 can be found here: http://openjdk.java.net/projects/jdk9/ In this tutorial, we will look at some of these new features and examine some of them. 1. Modular System – Jigsaw Project The Java platform is modularized into numerous modules in Java 9.  Developers can now create custom runtimes consisitng of the only modules needed by the target application. We already examine the outlines of Jigsaw project in the following article: https://www.javalopment.com/2018/03/project-jigsaw.html    2. JEP 223: New Version-String Scheme Java version-string is a string format that contains information about the Java version. Prior to Jdk 9, it was hard to identify version information from JDK version-string. With JEP 223, version-string was rearranged with a more systematic naming scheme. Java version-string consists of major, minor, security and patch version nu...

Project Jigsaw

Resim
Jigsaw is the name of the project to build a Java Platform Module System (JPMS) into the Java 9 platform. http://openjdk.java.net/projects/jigsaw/ Modularizing the Java SE platform has been challenging to implement, and the effort has taken many years. JSR 277: Java Module System was originally proposed in 2005 for Java 7. This JSR was later superseded by JSR 376: Java Platform Module System and targeted for Java 8. The Java SE platform is modularized in Java 9, but only after Java 9 was delayed until September 2017. The Java platform is modularized into numerous modules in Java 9. The number of modules will clearly change with the new features added to the platform. Developers can now create custom runtimes consisitng of the only modules needed by the target application. For example, if the application is cli-based, then the runtime might not include the GUI modules and this will considerably reduce the size of runtime. 1. C ompetitors   JBoss Modules...

Java Lambdas & Stream API

Resim
Lambda Expressions are the most remarkable feature added to the Java platform with Java 8.   It's specified in JSR 335  and JEP 126 . The very need for this feature is to gain the capabilities supplied by functional programming. The main idea behind this concept is to be able to parametrize the functions for subsequent executions of them. Till Java 8, this can be simulated via the use of anonymous inner classes with some design patterns like command pattern and functors. However the adoption of lambda expressions gave way to the direct use of this concept. 1. What is a Lambda Expression ? A lambda expression is a piece of code that is giving an alternative way to the anonymous class to pass the function as parameter to other methods, constructors and etc..  In this approach, a function can be referenced with a variable and passed as reference to be exec...

Java EE 8, The Open Source Way

In 2017, towards the end of the year, Oracle has announced that along with the Java EE 8, The control of the java enterprise edition will be given to Eclipse Foundation, included the full source code. Meaning that, Oracle is giving the enterprise technology to the Java community. Of course, that does not mean Oracle is dropping out the enterprise Java. Instead, Oracle's commercial offering is going ahead with Oracle WebLogic with the complience to Java EE. And Oracle will continue to support the evolution of the enterprise standards along with other largest contributers such as IBM and Red Hat.

HTTP/2

Http is an application layer protocol designed for client-server communication and can be made analogy as a kind of mail service simply with the following features: Request line; identifies the resource called. Http header ; contains operating information about the message such as destination, content type and etc. in the form of key-value pairs. Payload or body; is the part that the actual message is contained. HTTP protocol is comprised of commands/verbs such as GET, POST, PUT.. GET https://www.google.com/ HTTP/1.1 Host: www.google.com Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) Chrome/71.0.3578.98 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: SID=awcwAWJ-Py1UHfnKSWSzREE01k4qY45amv6.. History of HTTP by Versions The initial versio...

Transient

In the context of Java,  the transient keyword is used as field modifier. If we declare a field as transient; that field  would not be serialized even if the class implements Serializable. private transient int count; In Java, transient is used only for fields, so methods, classes and interfaces can not be declared as transient.