Do you share your Google Reader items? I have been doing so for quite some time, but, alas, none of my friends have been doing so. Do you share your Google Reader items. My Google Reader page is available here and feed here.
Blog on things around me - Quality Management, Free & Open Source Software, Gadgets, Utilities...
Saturday, November 15, 2008
Tuesday, November 4, 2008
Introduction to AOP
JavaPulse.net has started a new series aiming to introduce AOP - Aspects Oriented Programming. Check out the first article in the series.
Core AOP (Part I): Introduction to AOP
Aspect Oriented Programming (AOP) is a programming paradigm that aims to promote desirable software characteristics that have been difficult to implement in the current OOP (Object Oriented Programming) technologies. Desirable software characteristics include the DRY principle (Don’t Repeat Yourself), 1:1 modularity, information hiding, and separation of cross-cutting concerns. Examples of cross-cutting concerns are logging, security, transactions, remoting, caching, lazy instantiation, and even business logic.
Core AOP (Part I): Introduction to AOP
Tuesday, October 21, 2008
What is Maven?
Maven is a popular open source build tool for Java projects, designed to make build process easy. It uses a declarative approach, where the project structure and contents are described. This approach differs from Ant's task-based approach and make files.
Maven follows some basic concepts -
- Same directory structure for all project contents so that once you are familiar with these standard/default locations, you will be able to navigate within any Maven project you build in the future with much ease,
- Your enterprise project can consists of multiple sub-project, each doing its own bit of activities, e.g. a web project, a number of java project, an ejb project - all of these may be the part of an enterprise project. So, you can create appropriate artifacts for each of the project - war file for web projects, jar for java and ejb projects. Then these artifacts can be clubbed using a standard Maven build to create an Ear for deployment.
- Standard naming conventions
- Another important concept to keep in mind is that everything accomplished in Maven is the result of a plugin executing. There is a plugin for every activity in Maven, be it compiling source code, creating JARs, creating Javadocs, running tests etc.
and these results in a build life-cycle process that allows you to take your software development to the next level. It allows to set up a repository, thus allowing you to enforce company-wide development standards and reduces the time needed to write and maintain build scripts.
A Maven project depends on a pom file. A pom, or Project Object Model, file is an xml file and it resides in the project root directory as pom.xml. It contains the description of project, information about versioning and configuration management, dependencies, application and testing resources among others.
here is a part of such a pom file
This is an example of pom file used in an enterprise java project to create an ear file.
Maven Lifecycle
Just like software development lifecycle, Maven's build lifecycle consists of a series of phases where each phase can perform one or more actions. For example, the compile phase invokes a certain set of goals to compile a set of classes. Instead of invoking plug-ins, the Maven 2 developer invokes a lifecycle phase:
mvn compile.
Some of the more useful Maven 2 lifecycle phases are the following:
The lifecycle phase invokes the plug-ins it needs to do the job. Invoking a lifecycle phase automatically invokes any previous lifecycle phases as well.
Dependecies in Maven
In an enterprise application, you may not need to include all the dependencies in the deployed application. Some JARs are needed only for unit testing, while others will be provided at runtime by the application server. Thus using dependency scoping, Maven lets you use certain JARs only when you really need them and excludes them from the classpath when you don't.
When a dependency is declared within the context of your project, Maven tries to satisfy that dependency by looking in all of the remote repositories to which it has access, in order to find the artifacts that most closely match the dependency request. If a matching artifact is located, Maven transports it from that remote repository to your local repository for project use.
Maven has two types of repositories: local and remote.
Maven usually interacts with your local repository, but when a declared dependency is not present in your local repository Maven searches all the remote repositories to which it has access to find what’s missing.
Local Maven repository
When you install and run Maven for the first time, it will create your local repository and populate it with artifacts as a result of dependency requests. By default, Maven creates your local repository in ~/.m2/repository. You must have a local repository in order for Maven to work. Windows users can check in C:\Documents and Settings\userid\.m2\repository to verify local repository.
Maven follows some basic concepts -
- Same directory structure for all project contents so that once you are familiar with these standard/default locations, you will be able to navigate within any Maven project you build in the future with much ease,
- Your enterprise project can consists of multiple sub-project, each doing its own bit of activities, e.g. a web project, a number of java project, an ejb project - all of these may be the part of an enterprise project. So, you can create appropriate artifacts for each of the project - war file for web projects, jar for java and ejb projects. Then these artifacts can be clubbed using a standard Maven build to create an Ear for deployment.
- Standard naming conventions
- Another important concept to keep in mind is that everything accomplished in Maven is the result of a plugin executing. There is a plugin for every activity in Maven, be it compiling source code, creating JARs, creating Javadocs, running tests etc.
and these results in a build life-cycle process that allows you to take your software development to the next level. It allows to set up a repository, thus allowing you to enforce company-wide development standards and reduces the time needed to write and maintain build scripts.
A Maven project depends on a pom file. A pom, or Project Object Model, file is an xml file and it resides in the project root directory as pom.xml. It contains the description of project, information about versioning and configuration management, dependencies, application and testing resources among others.
here is a part of such a pom file
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.xyz.deptId</groupId>
<artifactId>My-proj-artifact-id</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>MyProj-ear</artifactId>
<name>My Project :: Enterprise Application</name>
<packaging>ear</packaging>
<description>My Project EAR</description>
<dependencies>
<dependency>
<groupId>com.xyz.deptId</groupId>
<artifactId>CommonProj</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.xyz.deptId</groupId>
<artifactId>WebProj</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.xyz.deptId</groupId>
<artifactId>EjbProj</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
This is an example of pom file used in an enterprise java project to create an ear file.
- project - This is the top-level element in all Maven pom.xml files.
- modelVersion - This required element indicates the version of the object model that the POM is using. The version of the model itself changes very infrequently, but it is mandatory in order to ensure stability when Maven introduces new features or other model changes.
- groupId - This element indicates the unique identifier of the organization or group that created the project. The groupId is one of the key identifiers of a project and is typically based on the fully qualified domain name of your organization. For example org.apache.maven.plugins is the designated groupId for all Maven plugins.
- artifactId - This element indicates the unique base name of the primary artifact being generated by this project. A typical artifact produced by Maven would have the form
- . (for example, myapp-1.0.jar). Additional artifacts such as source bundles also use the artifactId as part of their file name. packaging - This element indicates the package type to be used by this artifact (JAR, WAR, EAR, etc.). This not only means that the artifact produced is a JAR, WAR, or EAR, but also indicates a specific life cycle to use as part of the build process. The default value for the packaging element is jar. version - This element indicates the version of the artifact generated by the project. name - This element indicates the display name used for the project. This is often used in Maven's generated documentation, and during the build process for your project, or other projects that use it as a dependency. description - This element provides a basic description of your project.
Just like software development lifecycle, Maven's build lifecycle consists of a series of phases where each phase can perform one or more actions. For example, the compile phase invokes a certain set of goals to compile a set of classes. Instead of invoking plug-ins, the Maven 2 developer invokes a lifecycle phase:
mvn compile.
Some of the more useful Maven 2 lifecycle phases are the following:
generate-sources: Generates any extra source code needed for the application, which is generally accomplished using the appropriate plug-ins compile: Compiles the project source code test-compile: Compiles the project unit tests test: Runs the unit tests (typically using JUnit) in the src/test directory package: Packages the compiled code in its distributable format (JAR, WAR, etc.) integration-test: Processes and deploys the package if necessary into an environment where integration tests can be run install: Installs the package into the local repository for use as a dependency in other projects on your local machine deploy: Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects
Dependecies in Maven
In an enterprise application, you may not need to include all the dependencies in the deployed application. Some JARs are needed only for unit testing, while others will be provided at runtime by the application server. Thus using dependency scoping, Maven lets you use certain JARs only when you really need them and excludes them from the classpath when you don't.
When a dependency is declared within the context of your project, Maven tries to satisfy that dependency by looking in all of the remote repositories to which it has access, in order to find the artifacts that most closely match the dependency request. If a matching artifact is located, Maven transports it from that remote repository to your local repository for project use.
Maven has two types of repositories: local and remote.
Maven usually interacts with your local repository, but when a declared dependency is not present in your local repository Maven searches all the remote repositories to which it has access to find what’s missing.
Local Maven repository
When you install and run Maven for the first time, it will create your local repository and populate it with artifacts as a result of dependency requests. By default, Maven creates your local repository in ~/.m2/repository. You must have a local repository in order for Maven to work. Windows users can check in C:\Documents and Settings\userid\.m2\repository to verify local repository.
Sunday, October 19, 2008
google.com or www.google.com?
Thursday, October 16, 2008
Sunday, October 12, 2008
Saturday, October 11, 2008
Monday, September 29, 2008
Saturday, September 20, 2008
You're fired: What it costs to sack a worker
Source - economistAfter years of fat profits and bonuses, cost-cutting is once again at the top of the corporate agenda. For companies wanting to chop out middle-management dead wood or sack factory workers, costs can vary enormously across the world. America, New Zealand and Tonga are among the most company-friendly countries, requiring no penalties or compensation to fire a full-time employee of 20 years. By contrast, a business in Zimbabwe must shell out well over eight years' worth of pay to sack a worker. But companies in Venezuela and Bolivia are even more tied—workers there cannot be fired at all.
Monday, September 15, 2008
NASA Remembers 9/11
"The world changed today. What I say or do is very minor compared to the significance of what happened to our country today when it was attacked." So said Expedition 3 Commander Frank L. Culbertson, upon learning of the Sept. 11, 2001, attack on the World Trade Center.Source: NASA
This image is one of a series taken that day of metropolitan New York City by the International Space Station's Expedition 3 crew that shows a plume of smoke rising from the Manhattan skyline.
Upon further reflection, Commander Culbertson said, "It's horrible to see smoke pouring from wounds in your own country from such a fantastic vantage point. The dichotomy of being on a spacecraft dedicated to improving life on the earth and watching life being destroyed by such willful, terrible acts is jolting to the psyche, no matter who you are."
Monday, September 8, 2008
How to Block Ads in Google Chrome
There has been a tremendous response to Google Chrome (at least from the Techie community), however, people are still holding from using Chrome for the simple reason - it cannot stop those ads being served to you. Now, there is a 'fix' to avoid that. At Geekzone forums, Master Geek wmoore explains how to block 'em without an extension.
Geekzone - Adblock for Chrome
- Download and install Privoxy.
- Click on the Wrench icon in Chrome in the upper right corner.
- Choose options>Under The Hood>Change proxy settings.
- In the Internet Properties dialog's Connections tab, click on the LAN settings button.
- Check off "Proxy settings" and in the address setting add 127.0.0.1 and in the port 8118.
- If you have the option, you can also check off "Bypass proxy for local settings".
- Click "Ok", close Chrome and restart it.
Geekzone - Adblock for Chrome
Subscribe to:
Posts (Atom)
Total Pageviews
Popular Posts
-
Here is the list of Online Hindi Radio Stations. Copy the URL in your media player and enjoy !! 106.2 HUMFM - UAE ==> http://www.humfm.c...
-
There are four types of JDBC database driver: The JDBC/ODBC bridge driver (Type 1) A piece of native C-code that translates a JDBC call to ...
-
Here are a few of the JDBC Performance pointers. Hopefully, there are a lot more, which you may be aware of, but not mentioned here. Care to...
-
I just decied to look for a few commonly used UNIX command. A quick Google produces a lot more, but here are a list of more useful commands...
-
Always give your 100% to work... :) [received in an email]