Using Visitor Patterns on non Visitable Structures
The visitor pattern can be used on structures of objects which implements a specific interface defining a method called accept. In practice, in many cases, the structures are already created and we have to visit structures of already created objects. Changing hierarchies of classes for adding a new method is not a viable solution. We […]
Installing Eclipse Bazaar plug-in and avoiding ‘bzr-xmloutput plugin not found’
I’ve installed the eclipse plugin for bazaar. For me Bazaar is installed in C:\Java(don’t ask why I put it there, because I don’t know).
Google Guice Tutorial
What is Google Guice Google Guice is a light java dependency inversion framework using annotations. It is developed by Google(Bob Lee and Kevin Bourrillion) and it is used internally by Google for their applications. Google Guice is sometimes considered an Inversion of Control Container but as their authors state it’s not a container, it’s just […]
A Programmer’s Nasty Habbit
[digg-reddit-me] I just noticed something strange happened to me and it happened not only once. I tried to edit some xml file and just wanted to write a simple tag: <strong>. I tried it once and guess what happened: by some miracle the tag written there was <string>. I corrected and then tried to close […]
Multimap in Google Collections Library
I just took the Google Collections Library and start playing with it. I discovered a class I needed in many and many situations in the past. I’m talking about Multimap. Actually Multimap is an interface having a few classes implementing it. Along with some other interfaces it comes to fulfill a gap in the Java […]
Google Guice Starts a New Google Age?
[digg-reddit-me] Google Guice is a an open source Java framework released by Google under Apache License 2.0. Guice is a light weight Inversion of Control Container. It does what Spring does regarding dependency inversion aspect, without using xml files. Guide uses annotations and requires Java 1.5 or above and follows the Google philosophy of being […]
How To Use Ant
Ant is a build tool written in Java, intended to be used for Java build processes. Ant is used for building small and large projects as well. You can use ant not only for automation of building Java projects, but for automating any complicated and repetitive tasks. Ant is using xml files to define tasks […]
How to write an Ant xml build file to Generate JAXB Code and Compile and Build it to a Jar
There is a pretty common situation to use a java classes generator and to create classes based on a defined pattern. Hibernate, Castor, Jaxb are a few examples. I prefer to have those classes packed in a separate jar file. Since they are generated files it’s not a good practice to modify them, so there […]
How to Simulate Multiple Inheritance in Java
Java or .NET languages does not allow multiple inheritance and usually we don’t need multiple inheritance in our projects. However there are cases when inheriting from multiple classes is a necessity. There are a few tricks we can apply in order to be able to get what multiple inheritance gives us in the languages where […]
Drawbacks of Marker Interface Design Pattern.
A marker interface is a design pattern consisting in an interface with no methods declared. All the classes implementing this interface don’t have to implement a method for the interface(since it doesn’t have an interface), but we can say that the classes implementing the interfaces are marked. For example in Java we have the Serializable […]