30 July, 2014

OOP Principles For The Java Designer

Here are some useful information which should be familiar with all the java programmers/designers :

1. DRY


DRY stands for Don’t Repeat Yourself, which is pretty self explanatory. This means that you shouldn’t be duplicating your code in a program. If a code fragment is appearing in two places, then you would do well to turn it into a method instead of writing the entire fragment again. Lack of duplication helps in easy maintenance of the code.


2. Encapsulation


Whether your project gets bought over or whether you work on it yourself, your code will always change. So, it is good to encapsulate the part of the code that you think will be changed. This makes you code easy to maintain and test.



25 July, 2014

Portlet Configuration Menu Customization

If you want to modify menus which comes under portlet configuration wrench icon http://localhost:8080/html/themes/classic/images/portlet/options.png then you may see below details.
Actually for each icons, its using cutome tags which is given below so you can add/modify this items here as per your requirement.

<liferay-ui:icon-menu
align="auto"
cssClass="portlet-options"
direction="down"
extended="<%= false %>"
icon=""
message="options"
showArrow="<%= false %>"
showWhenSingleIcon="<%= true %>"
>

24 July, 2014

JVM Structure & YourKit Tool

As a java programmer, we should have at least basic knowledge of JVM and how it stores values.

The JVM memory consists of the following segments,
  • Heap Memory :  Storage for Java objects
  • Non-Heap Memory : Used by Java to store loaded classes and other meta-data
  • Other :  JVM internal structures, loaded profiler agent code and data, etc.