Anand's programming Blog

Thoughts and comments on Java software development.

Monday, February 13, 2006

Oracle Buying JBOSS????

Buying spree of Oracle might not be yet over... there are talks about Oracle buying Jboss in street.

In my opinion this is loss for open source developers and supporters.I forsee oracle trying to bundle Jboss with Oracle specific components by default and drive JBOSS future greared towards the coorporate milestone rather than developers needs.

What is your opnion?

Wednesday, February 08, 2006

Making JetBrains IDEA faster

Sorry this blog is only relevant to IDEA IDE users. But thought I will give the tips as I am sure there are many who may benefit.

1) If you have plenty of memory resource in computer give it to IDEA. I have seen that performance of IDEA is optimal at 512 MB heap size. You can do this by changing the VM options text file located at your IDEA install under bin directory. The name of the file is idea.exe.vmoptions.

2) Go to project setting and click on the IDE tab and turn off

** Synchronize files on frame activation
** Save file on frame deactivation
** File save on IDE being idle.

3) Remove unnecessary files from project by adding them in excluded. This can be done by setting the project properties and adding folder locations in excluded tab.

4) Avoid using shared views in source paths, local files are always faster.

5) I have seen that IDEA sometimes need a restart, lame but true , to be faster after being active for some days.

Thursday, February 02, 2006

IOC and Dependency Injection - Simplified

Subject pattern is being thrown out in every Party and Kitchen/Water-cooler discussions now a days. Its not cool, if you have not heard about one of these buzz word. I am trying an attempt to simplify what this design pattern means and why IOC vs DI. For more in-depth information you should refer to Martin Flower's website.

I will use terms (A) and (B)below, it represents two decoupled applications/component.

Inversion of Control ( IOC): This should be interpreted as an application( A ) handing off control of logic/action to other component/application ( B). Martin Flower explains this in a very simplistic Hollywood slang " Don't call me, I will call you". Here B is saying to A that I have control over this part you worry about other things. This pattern is no new invention, the concept of IOC is very generic and used in day today software development even if you never heard the 3 letter acronym.. Good example is Java EventHandlers. Now where does DI - dependency injection comes into picture....

Dependency Injection ( DI): In simple terms, DI is specialized IOC, where in inversion of control deals with "plugin", thus the name injection-injecting the plugin. (A) application inverts/handsoff the responsibility of determining the plugin to B thus making itself decoupled and generic enough to be used by any client.

Types of DI: Client will still need to tell (B) what to plugin should be like. This is where different types of DI like setter based DI, constructor based DI etc. For example Spring framework use the setter based DI. A framework provides client an assembler mechanism to define and associate plugins. Like Spring provides XML configuration which is used to set appropriate methods of (B) with plugin.


That is all you need to know,if my explanation is still not simplistic enough. Try to remember these two

IOC: "Don't call me , I will call you"
DI: "Don't plugin yourself, I will do that"