Archive

Archive for May, 2006

Spring Framework tutorials

May 19th, 2006 Comments off

Here are a few tutorials that I found on “Spring”:http://www.springframework.org/ that will hopefully prove sufficient to get me started.

* “The Complete Spring Tutorial”:http://www.roseindia.net/spring/index.shtml
* “Developing a Spring Framework MVC application step-by-step”:http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html
* “Java Boutique Tutorial on the Spring Framework”:http://javaboutique.internet.com/tutorials/spring_frame/
* “IBM Developer Works Introduction to the Spring framework”:http://www-128.ibm.com/developerworks/library/wa-spring1/
* “A Spring Jump Start”:http://www.developer.com/java/ent/article.php/3496416

As I work my way through the tutorials I will comment on which ones are worth working your way through.

Categories: J2EE, Java Tags:

Two most important Java technologies to know

May 19th, 2006 Comments off

The world of Java is huge with far too many libraries and frameworks to learn. To a new programmer, it is simply overwhelming. So where does one begin? That is simple, there are two technologies that every Java programmer should know–Ant and JUnit.

h3. “Ant”:http://ant.apache.org/

“Ant”:http://ant.apache.org/ is the defacto built tool for Java. As the website states

bq. Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make’s wrinkles.

The idea is that you create a simple XML build file that tells Ant what files to compile, where to find them, and where to put them once they are compiled. The really cool part is that you can use Ant to automate things like running JUnit tests, loading data into a database, running stylistic checks on your code, and others. Below is a sample Ant build.xml file:




    
        
        
        
            
                
                
            
        
    

h3. “JUnit”:http://www.junit.org/index.htm

“JUnit”:http://www.junit.org/index.htm is the defacto method of running unit tests on your Java code. Instead of having to create main classes that exercise your class and objects, all you need to do is to create a bunch of JUnit tests. All the major IDEs also support JUnit, so creating and running tests is simple. The general idea is that you create a test class that contains test methods.

A test method instantiates the object to be tested, creates the data necessary to feed to the method and also creates an object that represents the expected output from the method. Then it compares the actual output with the expected output and if they match your done and your method works. Below is a sample JUnit test method:

public void testFindUserSuccess() {
    // instantiate object to be tested
    PersistenceDAO instance = new PersistenceDAO();

    // created the expected output
    User expected = new User();
    expected.setUsername("mickey");
    expected.setPassword("mouse");

    // feed the method the required data
    User result = (User)instance.findUser("mickey", "mouse");

    // check that actual output matches expected output
    assertEquals(expected, result);
}
Categories: Java Tags:

How to become a Java Guru?

May 17th, 2006 1 comment

Actually I have no idea, none at all, I am not a guru. But, I do plan on finding out.

I have had a few discussions on websites such as Javalobby and Java Ranch about the best way for a student or recent grad to become a guru and I have always received the same response–practice the basics and then worry about the bigger things. In addition, I read a blog entry by Kathy Sierra that stated the way to become a guru was to always practice the basics. It also said that anyone can become an expert in any field. All it takes is time and discipline. In fact, it is the discipline part that separates the greatness from mediocrity. It is the discipline to practice the piano everyday, to practice doing musical scales everyday, to practice doing math everyday or to practice programming everyday. Although, I am a little uncertain about which part of programming would directly relate to practicing scales on a piano.

I am not sure if the above paragraph answers the above question at all, but I plan on pursuing the answer further and whatever I find out I will post here for all to see. In addition, I plan on changing the focus of this blog a little. I want to learn several different Java technologies and I am going to blog about that journey here. The technologies include Wicket, Spring, and Hibernate along with Java itself. The goal is that this experiment and journey will result in a path that other developers can follow in learning these and other Java technologies and frameworks. Wish me luck :-)

Categories: Java Tags:

Rant about Linux fragmentation

May 16th, 2006 Comments off

Why is it still so difficult to install some software on Linux? I think the biggest problem today with Linux is the problem with installing software. The other day I was trying to install GKrellm onto my CentOS 4.2 box. This should not be a difficult thing to do. Instead, I had to download several different rpm’s from rpmfind.net before I found one that would install. All of the previous attempts resulted in dependency problems. In 2006, this should not be a problem still.

I realize that people are going to argue for Mandriva’s urpmi, or Debians apt-get, or yum, or emerge, or whatever package management system you particular favorite distro uses, but this argument simply lends even more support to the sorry state of software installation on Linux. Why should every major distro have its own package manager?

This leads to a bigger issue though and that is the fragmentation that exists in the Linux world. I personally think that the biggest hindrance to wide spread Linux adoption is its biggest strength, in many people’s opinion, and that is all the different distros. And I thought Windows Vista had a lot of different versions, but 7 is nothing compared to the dozens of different versions of Linux. If people can not figure out which Vista they should be buying, how are they ever to figure out which Linux they should use?

Just like people are saying that Microsoft should release one or two versions of Vista and that is it, I think there should be one or two distros of Linux and that is it. Fragmentation does not create better software, it just creates more of it. And this goes deeper then just the OS, do we really need twelve different mp3 players or 4 different video players? I have come to realize that Linux is not about innovation, it is simply about recreating the wheel, over and over and over again.

Linux is great for servers, but if it is going to make onto the desktop of real human beings, then it is going to have to unify and establish some standards that result in a single desktop, a single package management and software installation system, and a single OS in the minds of the general public.

Categories: Linux Tags:

Review: Alfresco 1.2.1 – Open Source Enterprise Content Management

May 16th, 2006 Comments off

For the last few days I have been playing with a Java based open source Enterprise Content Management system called Alfresco. Alfresco has always had a free community edition, but it was missing features that were available in the enterprise version. With the release of 1.2.1, all the enterprise features are now available in the free, open source version.

Alfresco is basically a document management system. It allows users to add content and documents to folders and then share that content with other users. Each user has an individual home space along with various shared project spaces. Content can be added to any space (the name that Alfresco gives to different folders or areas that content can be added) available to the user and can be moved between spaces and folders easily. In addition, content, such as web pages and simple text documents, can be edited online in the web browser without the need to download it to a users computer.

In my very short review period I found three features that really stood out: 1) the fact that everything you need to run Alfresco is included in the installer and is installed and run with a single click; 2) the workflow templates and rules that can be setup and 3) the ability to transform documents from one format to another.

Installing and Running Alfresco

In order to run Alfresco on a Windows XP machine, all one needs to do is to download a single installer. This installer includes Tomcat, MySQL, and OpenOffice along with all the source binaries. Once installed, assuming you don’t install everything as a service, to run the program, all you need to do is to click on Start Alfresco under the Run Alfresco start menu option. For such a complex application that uses normally stand alone software products like Tomcat and MySQL, this makes running the software incredibly simple.

The result of this simplicity is that anyone can now download, install, and run an enterprise class document management system. No more do businesses need to purchase a product like Microsoft Sharepoint costing thousands of dollars.

In addition to the basically one click installer for Windows, there is a similar installer for Linux. If you already have MySQL and/or Tomcat installed on your computer, you can also download the appropriate packages.

I downloaded the package for Linux that did not include MySQL. This was just as simple to install as the full featured Windows version.

Workflow Templates

The second cool feature is the workflow templates. This allows you to quickly setup a series of folders tailored for, say, software development. This creates folders for UI Design, Documentation, Presentations, Quality Assurance and Discussions. Within the Documentation folder, there are folders for Samples, Drafts, Pending Approval, and Published. And of course, all documents can be fully versioned if need be.

The really cool thing is that within these folder a set of rules can be setup that moves documents between folders. For example, rules can be setup that documents can be moved from Drafts to Pending Approval, then, upon approval, they are moved to Published. However, if the document still needs work, it can rejected and moved back from Pending Approval to Drafts. And of course, email alerts can be sent out with each action.

Each of the rules are set by the administrator, so Alfresco only does what you want it to do. This means that you can set versioning up on the Drafts folder, but not on the Published and Pending Approval folders.

Document Translation

The final cool feature is the document translation. This allows one user to add a PDF file that can then be translated into a text document for inclusion in a web page. I have not played with this feature yet so I really can’t comment on how well it works,but I still think it is cool.

As for the backend of Alfresco, everything is written in Java/J2EE using standard libraries and frameworks such as Hibernate, Spring, Lucene for search, My Faces, MySQL, Tomcat and JBoss.

Conclusion

In conclusion, this is a product that every company investigating document management applications should add to their short list. If a company requires support and hand holding, this is also available from the website.

Categories: General Tags:

Article on How to run your own FreeBSD Web Server

May 15th, 2006 Comments off

I found this three part article on how to Run Your Own Unix Web Server. In this case, the flavour of Unix is FreeBSD. Also, the link is for the first part in the series. Links to parts two and three are at the end of the article.

Although the article assumes a certain level of knowledge with *nix, anyone who is familiar with the command line in Linux should have no problems with this tutorial. Plus, if you really want to run a web server, you are going to have to become friends with bash, csh, or some other command shell. So why not start with this article.

Categories: Web Development Tags:

Yahoo! UI Library: Grids CSS

May 10th, 2006 Comments off

Yahoo! UI Library: Grids CSS is a set of templates and instructions for creating tableless CSS based page layouts. The idea is that you use a grid system that allows you to combine different layouts—2 column, 3 column, etc—to create more than 100 custom layouts. Grids CSS is part of the YUI, the Yahoo! UI Library which is also worth downloading as it offers a set of layouts and javascript for things like calendars, sliders, drag and drop, and others.

Categories: Web Development Tags: