Thursday, December 22, 2011

Design Patterns in java - part 2

Session Facade vs Business Delegate - both do the same function of hiding the implementation details from the caller object. But the main difference is Session Facade must be an EJB object and it will reside on the server side( you can put the transaction limitations on the session facade). On the other hand the Business Delegate can be anything that doesn't involve EJBs and transaction boundaries; eg, a business delegate that accepts input from the web layer(JSF/JSP beans ) and forwards it to Service.

Tuesday, December 6, 2011

Using Data source Explorer in Eclipse

All java developers would mostly be using some IDE based on Eclipse for their day to day coding activities. Nearly 50% of these developer would have to work with backend databases like Oracle or DB2 using tools like Oracle SQL Developer, TOAD(Tool for Oracle App Development), DB Visualizer or Squirrel. If you are into JEE development, you may have to get software installation requests or special admin rights from your company's network administration to install the additional softwares like SQl Developer or DB Visualizer. If you are looking for a shortcut or workaround for this scenario, this posting is for you. Another USP is the comfort to access the database tables directly from your Java IDE(Eclipse/RAD/WASD/JBoss App Dev Studio or any major IDE based on Eclipse).

All the latest releases of IDEs(mentioned previously) come with an option called Data Source Explorer which can be navigated via Window-> Show View -> Data Management -> Data source Explorer. If you are in Jave EE perspective you should be able to see it as a tab next to console or problems tab at the bottom of the Eclipse. You can connect to the database tables by creating a DB connection. You would have to select the appropriate DB and JDBC driver details from the dialog box and then enter the connection string details (authentication and sever IP/port details and service name)

P.S: If you are using Oracle RAC as the backend DB, then instead of selecting Oracle Thin Driver, just select "Other Driver" option and enter the connection string detail

Saturday, October 1, 2011

Connecting Vonage to your home network

Draft post:

The usual logic of connecting the new device to the router or to the modem ports doesnt work for vonage phone lines.
  1. You have to connect just the Vonage modem to the cable modem. 
  2. Connect the wireless router to the vonage modem. 
  3. Connect the phone to the Vonage modem.

Your set up of vonage phone for your home wireless network is done. Throw away those huge manuals from vonage ;)




Tuesday, August 30, 2011

Saturday, August 13, 2011

ஏமாற்றம்

காதல் என்னும் போதை தான்
தெளிந்துவிட்டால் வெறுமை தான் !
கண்பட்ட அழகும் என் ரசனை தான் !!!
பின் சுக்குநூறாய் உடைத்தெறிந்தாய் ...
மனதில் மிஞ்சியது வேதனை தான் !!!

விரல் பற்றி நடக்கும் பிள்ளை போல ,
உன்விழி பற்றியே நடந்தேனே !
மரம் பற்றிய கொடிபோல ,
உன் அன்பைபற்றியே படர்ந்தேனே !
இன்று இருள்காட்டிலே தொலைந்தேனே !!!

கவிதைகள் உண்டு பல்லாயிரம் ,
இன்னும் கற்பனை வளர்ப்பார் ஆயிரம் !
மண்ணில் மற்றவர் இனிதே வாழ்ந்திருக்க ,
நான் மட்டும் தனிமையில் தவிப்பதேனோ ???

மதியிழந்திருந்தேனோ
அந்த மயக்கும் பொழுதுகளில் ???
உன் நினைவிழந்திருப்பேனோ ....
இனி வரும் மாலைகளில் ???
நாவினால் சுட்ட வடுவும்
ஆறிவிடும் என்கண்ணே ,
உன் காதலினால் சுட்ட வடு ஆறாதே !!

Wednesday, April 13, 2011

Java Design Patterns - Singleton

There are many examples out on the internet to explain Singleton and this is one more redundant one from my side :)

What's a Design pattern?
A design pattern is just a way of writing your code or designing your application. How a con-man goes about executing his tricks, defines his "modus-operandi" or just "pattern" in ordinary english. Similarly there are some standard "patterns" defined by experts for software development, which we can use for handling a particular scenario or requirement. Though we have heard about only a handful of design patterns, there are more than 250 design patterns identified, including a "noodle" pattern, which defines coding in the most unstructured or unmaintainable format.

Singleton
A singleton pattern is one of the design patterns which along with "Factory" falls under a broad category of design pattern called Creational design patterns. The class is coded in such a way that there can be only one instance of this object in the JVM( or app/web server memory). Common areas of usage for singleton design would be loggers, DB connection managers, service locators(another design pattern) etc.

Steps to create a singleton
  1. Create a no-args constructor for the class and make it private. This would prevent the class being instantiated in other classes.
  2. Create a method(say getSingleton ) which would be the only point of access for other classes. This method would return an object of the classMake this static, so that it can be called from other classes without any object instantiation. Also make it public method.
  3. Define a single variable of the same class and make it static(to make it accessible from the static method,getSingleton)
  4. Within the "singleton creator" or "provider" method, invoke the class's constructor only if an object has not been created already.

You can refer the sample code below for your reference.


Please let me know if this small article of mine was of help to you. Feel free to post any java related questions that you have and I shall try to answer them to the best of my knowledge.

Wednesday, March 30, 2011

Vijayakanth beats MLA candidate

Actor turned politician and founder of DMDK party in TamilNadu, Vijayakanth beat his own party's MLA candidate Baskaran when he tried to correct him. Vijayakanth(aka Captain) was canvasing for his party in Dharmapuri constituency when he allegedly gathered votes for someone Pandian, whereas the name of his party's candidate was Baskar. When Baskar tried to correct it, he was thrashed by Captain right away within the van in front of hundreds of people.

Captain!!! is this the right way to behave in front of people? Or is it right to beat somebody else for our mistake? What is the change that you are trying to bring in TamilNadu and its politics? See the video below which shows Captain's action drama and comedian Vadivelu taking a dig at him!

World Cup Cricket Live - Cheer for India

Saturday, March 5, 2011

மன்னிபேனா?

கட்டுக்கடங்காமல் உன்மேல் பாயும்
கண்களின் குறும்புகளை மன்னித்தேன்;
நா சொல்ல முயன்று தோற்பதை
உன்னிடமே எளிதில் சொல்வதனால் !

என் பேச்சுக்கு பணியாத என்
இதயத்தின் திமிரினை மன்னித்தேன் ;
நொடிப்பொழுதில் பல கனவுகள்
உன்னோடு இது புனைவதனால் !

என்னை தவிர்த்து மண்ணைப் பார்க்கும்
உன் விழிகளின் நாணத்தை மன்னிபேன் ;
நேர் பார்வையிலே சொல்ல தவறியதை
ஓரவிழி பார்வையிலே சொல்லுமானால் !

Tuesday, February 15, 2011

Kaadhal Vaadham

சேலை கட்டிய மஞ்சள் நிலவே
கொஞ்சம் மெதுவாய் தான் என்னை கடந்து செல்லடி !
பேரழகி உன்போல் இவ்வூரில் யாரடி ?
ஆனாலும் பெண்களில் கொடியவள் நீ ஒருத்திதானடி !

உன்னை திட்ட பேனா எடுத்தேன்,
அழகிய கவிதையொன்று எழுதி முடித்தேன்!


சிற்பமும் தோற்கும் உன்கொடியிடை நளினம் ,
மூழ்கடித்து கொல்லுதடி  நீ ஏற்றிவிட்ட சலனம் !
என் மனம் என்னை விட்டு பிரிந்துபோக ,
நித்தமும் செய்கிறாய் ஒரு தீவிரவாதம் !
என் வாழ்வையே பொம்மலாட்டமாய் விளையாடி பார்க்குதடி,
உன் கண்கள் செய்யும் காதல்வாதம் !

Monday, January 17, 2011

A Kite’s plight

விழுகின்றேன் இதோ விழுகின்றேன் !
இறுதி நெருங்கியதை உணர்ந்து அழுகின்றேன் !


கரையும் நொடிகள் என் சிறு கையில்
கடைசி ஆசைகளின் தேர்வு சிந்தையில் !


உருவத்தில் நான் மனிதனை பிரதிபலித்ததில்லை
இருந்தும் நித்ய அன்பை மருதளித்ததில்லை !

கடற்கரைக்  காற்று எனது ஓடம் ,
அந்தரத்தில் படித்தேன் நித்தம் ஒரு பாடம் !
குழந்தைகளுக்கு நான் குதூகலமே ,
மற்றவருக்கு வெறும் காகிதமே !


இங்கு தான் என் தேவதையைக் கண்டேன் !
அவளன்பை வேண்டிக் காதல் கொண்டேன் !


பறவை போல பறக்க வைத்தாள்,
பித்தன் போல சிரிக்க வைத்தாள் !
காதல் அலையில் மூழ்கவைத்தாள்,
என் அன்பே நீயென உரைத்தாள்,
சர்வமும் சக்தியுமாய் தோன்றி நின்றாள் !


வாழ்கையும் ஒரு வட்டம் ;
உணர்த்துவது “அவன்” திட்டம் !
பறவை போல பறந்தாலும் ,
இப்போதும் நான் ஒரு பட்டம் !


காற்று எங்களை பிரித்தது,
எம் கண்களில் கண்ணீர் துளிர்த்தது !
வெண் மேகமும் என்
சோகத்தில் பங்குகொண்டான் !
கருமை பூசி கண்ணீர் விட்டான்!


பிரிவுத் துயரில் துடிக்கின்றேன் !
நான் வெற்றுக் காகிதமாய் சிதைகின்றேன் !
விழுகின்றேன் இதோ விழுகின்றேன் !
இறுதி நெருங்கியதை உணர்ந்து அழுகின்றேன் !


Note: This poem is an attempt to do a poetic translation of one of my friend's short story.
While I would like to say that this is definitely inspired by that post, this is not a line by line translation. I have tried my best here. Please post your thoughts on reading this.

கதாநாயகி