In Part 1 of this Java 9 tutorial series, we covered Java 9 modules. Here in Part 2 of this series, we are going to explore JShell. Any up-to-date programming language has a REPL. In today's world, where you have two-week sprints and you need to learn while coding, it's important to have a fast feedback loop. You don’t want to set up a whole project just to test something in the code, right? The REPL brings that to you. REPLs are common in Scala, Python, Ruby, Shell scripts, and now also in… Java!
One of the main strengths of Kotlin is good Java integration. As it is fairly easy to convert Java to Kotlin, it seems that making Java EE applications in Kotlin should be a no-brainer. However, there are some subtle differences between the two that make conversion tricky:
While most frameworks require non-final classes, Kotlin classes are final.
Injection will introduce a lot of unnecessary null checks.
Both of these and mandatory parameterless constructors will ruin attempts to write functional-style code.
Java EE and Kotlin are not really best friends unless you make them. Luckily, all those issues can be avoided.
It’s time to continue our previous blog on how to make our code more robust, concise, and more functionally defined at the same time. Here, we are moving more toward Scala and leaving traditional Java behind. We will see new types and their usage along with the benefits we get from them.
This blog will show you the best way, in my perspective, to handle the exceptions gracefully in Scala (the beloved coding language for everyone here at Knoldus). Our methods would only be responsible for either returning the results or the exceptions, i.e. we will not write any try-catch blocks to handle the exceptions within different methods.
Language: Enterprise, Expertise: Intermediate — For reading operations, the transaction configuration readOnly flag should be set to true and in order to execute native queries, the @Query annotation parameter, nativeQuery flag, should be set to true.
Language: Java, Expertise: Intermediate — Spring provides a nice abstraction on top of the JDBC API using JdbcTemplate and also provides great transaction management capabilities using annotation-based approach.