What are the Java 7 design patterns you need to know?
What are two ways to make the Sinlgeton pattern thread-safe?
MySingleton getInstance() {
if(instance == null) {
synchronized(MySingleton.class) {
if(instance == null) { instance = new MySingleton(); }
}
}
return instance;
}How can be tested if TypeB needs inheritance?
Does TypeB want to expose the complete interface of TypeA so that TypeB van be used where TypeA is expected?
How can be tested if TypeB needs composition?
Does TypeB only want some part of the behaviour of TypeA exposed?
What is a DAO?
Data Access Object. An object that provides a abstract interface to some type of database or persistence layer.