Deutsch Serialization allows us to store objects in a lossless way or to transfer them over the network. This could be done before, but it was necessary to program the serialization mechanism, which was a lot of work. Of course, they were not yet called objects in those days… Java suddenly had such a serialization …
Kategorie-Archive: Java
Meaningless Whitespace in Textfiles
We use different file formats that are more or less tolerant to certain changes. Most well known is white space in text files. In some programming languages white space (space, newline, carriage return, form feed, tabulator, vertical tab) has no meaning, as long as any whitespace is present. Examples for this are Java, Perl, Lisp …
Loops with unknown nesting depth
We often encounter nested loops, like for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { doSomething(i, j); } } This can be nested to a few more levels without too much pain, as long as we observe that the number of iterations for each level need …
Java Properties Files and UTF-8
Java uses a nice pragmatic file format for simple configuration tasks and for internationalization of applications. It is called Java properties file or simply „.properties file“. It contains simple key value pairs. For most configuration task this is useful and easy to read and edit. Nested configurations can be expressed by simple using dots („.“) …
Collection Initializiation in Java
There is this so called „double brace“ pattern for initializing collection. We will see if it should be a pattern or an anti-pattern later on… The idea is that we should consider the whole initializion of a collection one big operation. In other languages we write something like [element1 element2 element3] or [element1, element2, element3] …
Is Java becoming non-free?
We are kind of used to the fact that Java is „free“. It has been free in the sense of „free beer“ pretty much forever. And more recently also „free“ in the sense of „free speech“. In spite of the fact that we read that „Oracle is going to monetize on Java“, as can be …
JMS
Java has always not just been a language, but it brought us libraries and frameworks. Some of them proved to be bad ideas, some become hyped without having any obvious advantages, but some were really good. In the JEE-stack, messaging (JMS) was included pretty much from the beginning. In those days, when Java belonged to …
Some Thoughts about Incompleteness of Libraries
Selfwritten Util Libraries Today we have really good libraries with our programming languages and they cover a lot of things. The funny thing is, that we usually end up writing some Util-classes like StringUtil, CollectionUtil, NumberUtil etc. that cover some common tasks that are not found in the libraries that we use. Usually it is …
„Some Thoughts about Incompleteness of Libraries“ weiterlesen
Operator Overloading
When Java was created, the concept of operator overloading was already present in C++. I would say that it was generally well done in C++, but it kind of breaks the object oriented polymorphism patterns of C++ and the usual way was to have several overloaded functions to allow for all n² combinations. In the …
Primitives, Objects and Autoboxing
The type system in Java makes a difference between so called „primitives“, which are boolean, byte, char, int, long, float and double and Objects, which are anything derived from Object in object oriented philosophy, including the special case of arrays, which I will not discuss today. Primitive types have many operations that are kind of …