Optymalizacja wydajności JVM, część 1
Pierwsza część artykułu autorstwa Evy Andreasson pt. „JVM performance optimization, Part 1: A JVM technology primer. Java performance for absolute beginners” opublikowanego na JavaWorld.com.
JUnitParams
JUnitParams – narzędzie od Pragmatists wspierające pisanie czytelniejszych testów parametryzowanych w JUnit >= 4.6.
Prawo Demeter
Prawo Demeter (ang. Law of Demeter [LoD]) znane także jako Zasada minimalnej wiedzy (ang. Principle of Least Knowledge) zostało sformułowane przez Iana Hollanda w 1987 roku na Northeastern University. Zastosowane do programowania obiektowego brzmi następująco:
Read the rest of this entry »
Sleep Sort
Zabawny algorytm sortujący:
public class SleepSort {
public static void main(String[] args) {
for (final String arg : args) {
new Thread() {
public void run() {
try {
Thread.sleep(Integer.parseInt(arg));
} catch (Exception e) {
}
System.out.print(arg + " ");
}
}.start();
}
}
}
<barista@javaczyherbata.pl> java SleepSort 23 2 45 9 15 10 87 21 100 34 45 18 2 9 10 15 18 21 23 34 45 45 87 100
The Hollywood Principle
Wymowne stwierdzenie na temat IoC znane jako The Hollywood Principle:
Don’t call us, we’ll call you.
Bytecodem po Cassandrze, część 1
Jacek Gerbszt, samodzielny programista Java w Wirtualnej Polsce, analizuje problemy z wydłużającymi się i odrzucanymi transakcjami (tzw. mutations): Bytecodem po Cassandrze, część 1.
OOP vs ADT
An object can only access other objects through public interface.
It is possible to do Object-Oriented programming in Java.
Object-Oriented subset od Java: class name is only after „new”.
William Cook,
On Understanding Data Abstraction, Revisited
Dziedziczenie a podtypy
A distinction between inheritance and subtyping is not often made: classes are often equated directly with types.
From a behavioural point of view a type defines characteristics and a class defines an implementation of these characteristics.
Kevlin Henney
Distributed Object-Oriented Computing:
The Development and Implementation of an Abstract Machine
Polimorfizm, przesłanianie, przeciążanie – MUST KNOW!
- Polimorfizm dotyczy przesłaniania, nie przeciążania.
- Typ referencji (zmiennej) określa jakie metody mogą być wywoływane.
- Typ obiektu określa, która przesłonięta metoda zostanie użyta w czasie wywołania.
- Typ referencji określa, która przeciążona metoda zostanie użyta w czasie kompilacji.
Let’s Play: Test-Driven Development
Rewelacyjna seria screencastów Jamesa Shore’a traktująca o Javie i TDD. Każdy epizod trwa około 15 minut.