Kotlin interoperates perfectly with Java, so writing JavaFX apps with Kotlin is already a pleasure. However, TornadoFX makes use of some very interesting language features of Kotlin that enables even more concise and beautiful code without hiding any features of the JavaFX API.Quick Overview
TornadoFX is an MVC framework. A View contains the root node of the UI as well as the view logic. Controllers contain the business logic. Elegant async support ensures that long running tasks run in a background thread and that the result is applied on the UI thread.
Annotation-driven development is the Spring-way. Spring can be configured by many annotations that incapsulate tons of logic from your eyes. The first step consists of annotation creation that loads configuration with beans and properties.
There are common questions which come up repeatedly in Java. Even if you know the answer it is worth getting a more thorough understanding of what is happening in these cases.How Do I Compare Strings?
The more general questions are how do I compare the contents of an Object. What is surprising when you use Java for the first time is that if you have a variable like String str that is a reference to an object, not the object itself. This means when you use == you are only comparing references. Java has no syntactic sugar to hide this fact so == only compares references, not the contents of references.
JavaDoc source code embeds are pretty terrible!
I love JavaDoc but it didn't age well. When you work with other tools (e.g. in the Microsoft world) suddenly the embedded samples look amazing and "search" functionality is just built in!
It’s the start of 2016, which means that we’ve now finished the “20 Years of Java” celebrations. Actually, although the announcement about Java (and the HotJava browser, which did not enjoy quite the same success) was made publicly on May 23rd, 1995, the first official release of the JDK was on January 23rd, 1996. You could justifiably claim that Java is only now turning twenty. There have been numerous retrospectives on Java, but I thought what would be interesting to look at is the success of Java in its twentieth year.
It’s difficult to accurately measure the popularity of programming languages, but one of the generally accepted surveys is the TIOBE index. This tracks language references through a variety of search engines as well as Google Blogs, Wikipedia and even YouTube. (In writing this entry I learnt something new, which is that TIOBE is actually an acronym for “The Importance Of Being Ernest,” the play by Oscar Wilde. Not sure what that has to do with programming languages, but there you go).
In the previous post, I discussed the difference between pointers and references in Java and how the method parameters are passed (passed-by-value or passed-by-reference). These are strongly related to value types that do not exist in Java (yet).
There is a proposal from John Rose, Brian Goetz, and Guy Steele detailing how value types will/may work in Java and also there are some good articles about it. I have read “Value Types: Revamping Java’s Type System” that I liked a lot and I recommend to read. If the proposal is too dense for you to follow the topic you can read that article first. It summarizes very much the background, what value types are, advantages, why it is a problem that Java does not implement value types and why it is not trivial. Even though the terminology “value type” may also be used to denote something different I will use it as it is used in the proposal and in the article.
One of the most distinguished features of us programmers is that we are inherently lazy. Not in a bad way that we do not want to work, but in a better way: We do not want to do the same thing twice and we do not want to do it at all if we do not have to. In fact, not writing code is often the better alternative in the cases you can reuse something else instead.
The same thing is true for our applications. Often, we want them to be lazy so that they only do what is absolutely necessary and nothing more.
In the previous post about the new Java EE MVC Framework, we had a detailed look on Controllers. In this and the following posts, we will see how to access various types of request data in MVC Controllers.
Java EE MVC makes heavy use of JAX-RS and most of the things we will see in this and the next posts are JAX-RS features. So, if you are familiar with JAX-RS you probably will not learn much new in this post.