Archive for the 'Java' Category

Reflection

The most simplest way to invoke a method in java dynamically using reflection.

new java.beans.Expression(target,”methodName”,args).getValue()
where target is the target object. args is an object array containing arguments.

javadoc states that “when the target’s class defines many methods with the given name the implementation should choose the most specific method using the algorithm specified in the Java Language Specification (15.11)”. This is a huge advantage.

FindBugs

How to find bugs in your java code. Check out FindBugs

Speech Synthesizer

Check out the FreeTTS (free java text to speech synthesizer).

Xstream

I have been fascinated by xstream Xstream library. It is able to serialize and deserialize most of java objects(even if the objects doesnt follow java bean specs). It works without any mapping at all. (even though one could provide one for complex scenarios). I have used it to serialize and deserialize test datas(master data in database). What we did is serialize one the java objects. We could later deserialize this for testing purpose. This way we were able to test without database dependence. May be the same approach can be used for other scenarios say for example instance data. The idea behing this is to get the objects as in real life situation. The same that is being proposed in Object Mother pattern. But object mother would require some amount of coding for getting those real objects ready.Still we use the object mother for most of other objects. This posting is not complete . i will have to add more to this a bit later when i find time.


belliraj@del.icio.us


Follow

Get every new post delivered to your Inbox.