Posts

Maven in 5 Minutes

Built by Maven Maven in 5 Minutes Installation Maven is a Java tool, so you must have Java installed in order to proceed. First, download Maven and follow the installation instructions. After that, type the following in a terminal or in a command prompt: mvn --version It should print out your installed version of Maven, for example: Maven version: 2.0.8 Java version: 1.5.0_12 OS name: "windows 2003" version: "5.2" arch: "x86" Family: "windows" Depending upon your network setup, you may require extra configuration. Check out the Guide to Configuring Maven if necessary. Creating a Project On your command line, execute the following Maven goal: mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app If you have just installed Maven, it may take a while on the first run. This is because Maven is downloading the most recent artifacts (plugin jars and other files) into your local repository. You may also need to exe

Creating our First Grails Application (e.g. racetrack)

Image
command prompt> grails create-app racetrack command prompt> cd racetrack command prompt\racetrack> grails run-app Open your browser to http://localhost:8080/racetrack/   Directory Structure   From this information, we can see that we’re basically working with two types of data –races and registrations – and that there’s a one-to-many relationship between those entities. That information will form the basis of our domain model, and the various data elements on the form will become the attributes of our domain classes.  Create-Domain-Class racetrack> grails create-domain-class Race class Race { String name Date startDateTime String city String state Float distance Float cost Integer maxRunners = 100000 static hasMany = [registrations:Registration] } racetrack> grails create-domain-class Registration class Registration { Race race String name Date dateOfBirth String gender = 'F' String emailAddress String postalAddress Date crea

Grails Basic

Image
Web Framework inspired by RoR(Ruby On Rails) Latest version is 1.1.1. Based on open source technologies like Spring, Hibernate and SiteMesh Grails = Spring MVC 2.5.1 + Hibernate 3 + SiteMesh2.3 Newbie's are unaware that Grails is full and full Spring! Provides several commands to auto generate common requirements in a web app. Comes bundled with HSQLDB and Jetty web Server Focus is on rapid development and simplicity Coding by convention paradigm Reduce the need for configuration files and other boilerplate code File names are important Features Rapid web application development Follow spring MVC framework -Clearly separates business, navigation and presentation logic Proven mechanism for building a thin, clean web-tier Both gsp and jsp are supported.  AJAX Support Supports prototype, YUI, DOJO Use render method in your groovy code to render text, HTML, JSON Has lots of plug-in already available like quartz, acegi , RichUi etc… grails create-plugin !

Ant Basic

Ant Basic Ant (originally an acronym for Another Neat Tool), is a build tool with special support for the Java programming language but can be used for just about everything. Ant is platform-independent; it is written purely in Java. Ant is particularly good at automating complicated repetitive tasks and thus is well suited for automating Ant Installation Configuration for Windows Environment 1. Download latest binary zip from http://jakarta.apache.org/ant/. 2. Unzip Binary in any folder, in my end it unzip on c:\ E.g. C:\apache-ant-1.7.0 3. Setting Environment variable: Right Click on My Computer ->Properties->Advanced tab->Environment variable->Create User variable Variable Value ANT_HOME C:\apache-ant-1.7.0 Path %JAVA_HOME%\bin; %ANT_HOME%\bin; %ANT_HOME%\lib; 4. on command-line type c:\ant to verify proper configuration Working with Ant For typical Java Project building By Ant script 1. To create test project here is common folder and file

Groovy On Grails setup on windows

Groo vy On Grails Configuration for Windows Environment => Download Java SE Development Kit (JDK 1.4.x or more ) installer for windows ( http://java.sun.com/javase/downloads/index.jsp ) => Download Latest Version Groovy 1.5.x( http://groovy.codehaus.org ) Binary Zip. => Download Latest Version Grails 1.1.x( http://www.grails.org ) Binary Zip. => Install JDK => Unzip Binary in any folder, in my end it unzip on c:\installation. Eg. c:\installation\groovy1.5.x c:\installation\grails1.1.x c:\ Program Files\Java \ jdk1.5.9 =>Set Environment variable for Groovy on Grails and Java Right Click on My Computer ->Properties->Advanced tab->Environment variable Create User variable Variable Value JAVA_HOME

Groovy

Image
* Scripting / Agile Dynamic Language for JVM * Features inspired from Python, Ruby. * Syntax very close to Java and Same OO model as Java * Seamless integration with all existing Java classes and libraries. * Groovy code Compiles to Java bytecode. * Can run on .Net 2.0 using IKVM * Latest version 1.6 * http://groovy.codehaus.org Groovy Basic 1. Closures 2. Dynamic Methods 3. List & Maps 4. Better XML/Swing Capabilities 5. Permits operator Overloading 6. GString: interpolated String 1. Closure : => Closures are reusable blocks of code => One or more program statements enclosed in curly brackets “{}” => Closures do not require a class or a method name => Can be passed around like variables => The statements within a closure are not executed until the call() is made => Return is using an explicit return statement or the value of the last executed statement. => E.g. square = { it * it } //“it” implicit parameter representing the passed value. square (4) // Output =