Thursday, October 27, 2011

Blog Purpose

My blogging has been erratic and without purpose. There has been no reason behind any of the blog posts I've written. I want there to be a purpose and a future goal for my blogging. I've decided to work on my online presence. My goal is to create a professional persona to help me asses my strength and weaknesses of my programming capabilities.

The purpose of my blog is to showcase my learning. I will start detailing everything I'm working on.
  • Demonstrate my willingness and curiosity to continue increasing my programming knowledge.
  • Demonstrate I understand content related to programming.
  • Demonstrate my researching ability.
  • Demonstrate my writing ability.
  • Demonstrate my critical thinking ability.
  • Demonstrate my creativity.
  • Through my writing, develop and demonstrate my unique professional personality and character.
  • Develop and demonstrate my social media skills.
  • Begin developing my professional brand, not as a job-seeker in my field, but as a thought leader in my field.

My writing to this point has not clearly demonstrated any of these standards. One of my goals is to be able to clearly articulate in my writing what I'm working on so that everyone can understand. When I write what I'm working on, I want the newbie to the professional to understand what I'm explaining. I always hacking on something, whether it's Java or Rails or CSS and XHTML, I will have something to write about. It will take a lot of deliberate practice to get my writing to this point.

Wednesday, October 26, 2011

Apache Ivy

In researching Apache Ant and how to create a build.xml file, I discovered Apache Ivy. Apache Ivy is a dependency manager that can easily be integrated with Apache Ant.

The main and most frequent way to use ivy is from an ant build file. However, ivy can also be called as a standalone application. If you use ant version 1.6.0 or superior, you just have to add ivy namespace to your project (xmlns:ivy="antlib:org.apache.ivy.ant") attribute of your project tag, and you can call ivy tasks.
 <project name="sample" default="compile" xmlns:ivy="antlib:org.apache.ivy.ant"> 
The build will use Apache Ivy to download, install, and manage third party libraries of the different tools needed for the project. The retrieve task copies resolved dependencies anywhere you want in your file system. Below is an example of adding checkstyle to the project.
1:  <target name="install-checkstyle" description="Install checkstyle."> 
2: <ivy:retrieve module="checkstyle" organisation="com.puppycrawl" revision="5.4" pattern="${basedir}/lib/checkstyle/[artifact].[ext]" sync="true" conf="bundled" type="jar,report"/>
3: </target>

Tuesday, October 18, 2011

Build System

The build system is extremely important. It provides a standardized way for anyone to build the system. Users can build and test the system without an IDE. Developers can build and test the system using their IDE of choice. This automated build is helpful in preventing errors, testing, and deployment. Developing a robust build system can ease the process when maintaining a large and/or complex software system.

My build system will need to become a template. As a template, I can adapt it to any project I create. The build system will be modular and extensible to become as big or as small as needed. It will integrate any third party build tools. It will handle junit, checkstyle, and any other third party build tools that the build system requires. It will be able to download, install, and manage all third party libraries needed. It will support web application development.

Below is the beginnings of a build file. It contains two targets, clean and compile. It's very simple in what its doing. I am studying the Ant manual to learn how to integrate the third party build tools and libraries into the build system.

1:  <project default="default">
2: <description>
3: The build file.
4: $Id$
5: </description>
6:
7:
8: <property name="src.dir" location="${basedir}/src"/>
9: <property name="build.dir" location="${basedir}/build"/>
10:
11:
12: <target name="clean"
13: description="Delete build/ directory.">
14: <delete dir="${build.dir}"/>
15: </target>
16:
17: <target name="compile"
18: description="Compiles the code.">
19: <!-- Ensure that the build output dir exists. -->
20: <mkdir dir="${build.dir}/classes"/>
21: <!-- Now compile the system. -->
22: <javac srcdir="${src.dir}"
23: destdir="${build.dir}/classes">
24: </javac>
25: </target>
26: </project>

Thursday, October 13, 2011

Configuring My Java Build Environment

In my efforts to improve my programming skills, I have decided to get back into Java programming and building large projects. My previous involvement with a large Java project was seven years ago as a university of Hawaii student with the CLEW system. The Collaborative Educational Website (CLEW) was a web application development framework for collegiate department websites.

Environment Configuration

The current laptop I will be working on is a Toshiba Satellite A505 running on Windows 7 64-bit. It has a 1.60 GHz processor, 4 GB RAM, and over 100 GB of free space. My first step is to create a high quality Java software development environment. I downloaded and installed the Java 7 JDK and JavaDoc documentation. I added %java%/bin to my computers PATH variable. I downloaded and installed the Eclipse 3.6.2 IDE. I chose "Eclipse IDE for Java EE Developers" to work on the Java projects. To improve the performance of Eclipse, I modified some runtime options. Increase the heap space for Eclipse. I have at least 2GB RAM. In the eclipse.ini file, I changed -Xms=40m to -Xms=512m and -Xmx=512m to -Xmx=1024m.

To verify my configuration was working, I wrote a couple of basic programs in my eclipse IDE. I wrote the generic HelloWorld program that worked fine. I wanted to try something else so I searched online and found a simple program to implement called FizzBuzz. FizzBuzz is a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". I was able to implement a working FizzBuzz program. My initial configuration was working.

Build System

This is the point in my configuration where I am stuck. The build system I used for CLEW included apache ant, jakarta tomcat, junit, checkstyle, and other tools. Are these tools still relevant?

In my research for build tools, the top two I came across were Ant and Maven. Ant is open source, Java-based, extensible, and uses XML configuration files. Maven is project management technology that uses convention over configuration. Ant is still very popular and I am familiar with the Ant concepts. Every project requires an Ant build file, build.xml. Each build file is composed of targets. Each target is composed of tasks. And targets can have dependencies.

I downloaded and installed Apache Ant 1.8.1. I added %ant%/bin to my computers PATH variable.

Now What?

Next in configuring my Java build environment will be to include the different tools to help build a working project. I will look into junit, checkstyle, and other tools currently being adopted. When I get a build environment up and running, I will begin my Java programming.