Monday, December 31, 2012

Difference between @Autowire and @Resource

1. @Resource is part of JSR-250. @Autowire is part of Spring framework.
2. @Resource can inject by name only(to inject into a field named "xyz" look for a bean named "xyz"). @Autowire can inject by name, type(to inject into a field/parameter of type "Abc", look for a unique bean of type "Abc") and many more.
3. @Resource can inject into a field only. @Autowire can inject into field, constructor and method parameters.
3. @Resource can inject List, Map and other Collection types. @Autowire cannot.

Sources: [1] [2]

Monday, December 24, 2012

Wave and water

" To represent the two dimensions of reality, we use the images of the wave and water. Looking at the dimension of the wave, the historical dimension, we see that the wave seems to have a beginning and an end. The wave can be high or low compared with other waves. The wave might be more or less beautiful than other waves. The wave might be there or not there; it might be there now but later not there. All these notions are there when we first touch the historical dimension: birth and death, being and nonbeing, high and low, coming and going, and so on. But we know that when we touch the wave more deeply, we touch water. The water is the other dimension of the wave. It represents the ultimate dimension.
...

If the wave is capable of touching the water within herself, if the wave can live the life of water at the same time, then she will not be afraid of all these notions: beginning and ending, birth and death, being or non-being; non-fear will bring her solidity and joy. Her true nature is the nature of no-birth and no-death, no beginning and no end. That is the nature of water."

- Thich Nhat Hanh

I have arrived, I am home

"I have arrived, I am home
In the here, in the now
I am solid, I am free
In the ultimate I dwell.

...
You can recite the poem above as you breathe in and out. You can practice this poem when you drive to your office. You may not have arrived at your office, but even while driving you have already arrived at your true home, the present moment. When you arrive at your office, this is also your true home. In your office, you are also in the here and now. Just practicing the first line of the poem, “I have arrived, I am home,” can make you very happy."

- Thich Nhat Hanh

We cannot enjoy life if we worry

"We cannot enjoy life if we spend our time and energy worrying about what happened yesterday and what will happen tomorrow. If we’re afraid all the time, we miss out on the wonderful fact that we’re alive and can be happy right now. "

- Thich Nhat Hanh

Thursday, December 20, 2012

Our real home is peace.

"This house you’re living in: You and your husband built it. Other people can build houses, too, making them large and lovely. Those are outer homes, which anyone can build. The Buddha called them outer homes, not your real home. They’re homes only in name.

Homes in the world have to fall in line with the way of the world. Some of us forget. We get a big home and enjoy living in it, but we forget our real home. Where is our real home? It’s in the sense of peace. Our real home is peace."

- Ajahn Chah Subhaddo