Search results
"category:/java/design_patterns"
| Title and summary | Date/time | |
|---|---|---|
|
1 |
Brainteaser: Overridable methods
Consider the following case of inheritance: public class Parent { public Parent() { getValue(); } public void getValue() { }}public class Child extends Parent { private final Integer integer; public Child() { integer = new Integer(888); ... |
18/04/2009 12:02:00 PM |
|
2 |
Brainteaser: Broken case of inheritance
Consider the following case of inheritance: public class ExtendingHashSetE extends HashSetE { private int counter = 0; public ExtendingHashSet() { } @Override public boolean add(E e) { counter++; return super.add(e); } ... |
05/04/2009 8:34:00 PM |
|
3 |
How to prevent iFrame breakaway
Few days ago I was searching for a solution to the problem I've encountered - I needed to prevent a third party page to break out of iframe inside a web page of my web application. For people who are not closely familiar with JavaScript, the following JS ... |
29/03/2009 5:37:00 PM |
|
4 |
Java and those frameworks
I came across an interesting article that discusses today's application developers making extensive use of different frameworks in their applications. This is the writer's opinion: ...Todays projects are over bloated from the use of frameworks that ... |
15/11/2008 8:14:00 PM |
|
5 |
Brainteaser: Broken comparator
Question: The following program returns result "1", which indicates that first Integer value is greater than the second, why? import java.util.*;public class Example { public static void main(String[] args) { ... |
19/10/2008 1:25:00 AM |
|
6 |
Hack any Java class using reflection attack
Have you ever thought how secure your application is? Well reflection attack can demonstrate how vulnerable Java classes are. In this post, I will try to apply reflection attack on a simple Java class to demonstrate vulnerabilities and what can be done to ... |
13/10/2008 1:05:20 PM |
|
7 |
How to set SecurityManager and Java security policy programmatically
In this example I want to show how to use SecurityManager to prevent unauthorized access to private members of a Java class, for example using reflection to invoke private constructor. Besides that I also want to show how Java security policy can be set ... |
12/10/2008 10:16:00 AM |
|
8 |
Hibernate - How to map two collections of the same type in the same entity
Recently during development, I encountered a situation where I had to map two collections in the same entity, having collections and the entity it self of the same type. I had persistent entity - Rule. Rule could have children rules: "action" ... |
14/09/2008 10:00:00 PM |
|
9 |
Brainteaser: Hidden iterators
... While locking can prevent iterators from throwing ConcurrentMofdificat... |
07/09/2008 6:05:00 PM |
|
10 |
Singleton pattern and problem with double checked locking
There are several ways to initialize singleton object. Some are thread safe and some are not. Until the last two days I thought that double-checked locking idiom offers the best solution for singleton initialization in multi threaded environment. Well its ... |
06/09/2008 12:56:00 PM |




