Wednesday, September 5, 2012

Design Patterns

Strategy Pattern




















Decorator Pattern



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Factory Pattern





Monday, September 3, 2012

Eclipse Configurations

Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse.ini. If $ECLIPSE_HOME is not defined, the default eclipse.ini in your Eclipse installation directory is used.

eclipse.ini is a text file containing command-line options that are added to the command line used when Eclipse is started up

All lines after -vmargs are passed as arguments to the JVM, so all arguments and options for eclipse must be specified before -vmargs (just like when you use arguments on the command-line)

 
-vm (Executable, Main) locate the Java VM to use to run Eclipse. It should be the full file system path to an appropriate: Java jre/bin directory, Java Executable, Java shared library (jvm.dll or libjvm.so), or a Java VM Execution Environment description file.
-startup (Executable) The location of jar used to startup eclipse. The jar referred to should have the Main-Class attribute set to org.eclipse.equinox.launcher.Main.
--launcher.library (Executable) the location of the eclipse executable's companion shared library.
-showSplash (Executable, Main) specifies the bitmap to use in the splash screen.
--launcher.XXMaxPermSize (Executable) If specified, and the executable detects that the VM being used is a Sun VM, then the launcher will automatically add the -XX:MaxPermSize= vm argument. The executable is not capable of detecting Sun VMs on all platforms.
--launcher.defaultAction specifies the default action to take when the launcher is started without any "-" arguments on the command line.
-vmargs [vmargs*] (Executable, Main) Used to customize the operation of the Java VM to use to run Eclipse.



For more infor: http://wiki.eclipse.org/Eclipse.ini

More Options: http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

Optimal Settings: http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse


My current settings (Eclipse Helios running in CentOS)

-vm
/opt/jdk1.5.0_15/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms1024m
-Xmx2096m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.UseWebKitGTK=true

Eclipse Plugins : ObjectAid UML Explorer


If you are a Eclipse user and you want to construct a class diagram from an existing codebase, you can use the following.

Simply go Help ==> Install New Software
Add http://www.objectaid.com/update as a site and it will find the tool.



You need a license to use the Sequence Diagram Editor, but the class diagrams are free. It's extremely easy to use and a must-have in your eclipse toolbox.



Visit http://www.objectaid.com/  for more infor.

Eclipse Crashing Issue

My eclipse kept on crashing in my CentOS PC. Issue seemed to be related to having firefox as the default browser. But changing the default browser was not possible since it was crashing every time I tried to change it.   Tried out several versions of eclipse with no luck.

Following solution was found from a blog and it worked!

Add the following to eclipse.ini.

-Dorg.eclipse.swt.browser.UseWebKitGTK=true