Friday, June 15, 2007

JavaServer Faces!

I have been interested in an open source platform to launch a web site. I had heard the about jsf as a J2EE framework.

One is the lifecycle model better designed to protect the "model" of the MVC architecture.



The current available version is 1.2 which is available from Sun's Glassfish project. I was hoping the the Apache myfaces project would have a version 1.2 out but it seems they are still testing it.

Sun's version does not run on Tomcat, so I hope the MyFaces team can get 1.2 out soon. I have seen some indications that this can be checked out from cvs but not currently available as a release product.

My current set up is Tomcat,Eclipse,MyFaces,MySql along with the Sysdeo debugger.
Security for the app is set up using a Filter.
Basic templating done via Tiles.

I have some basic functionality up and running but I wanted to learn more about the JSF details before so I got a copy of "Core JavaServer Faces" by Geary,Horstmann. It was very good at filling in some gaps and revealing some other ideas I would like to incorporate in my J2EE apps.

It was good in describing the validation process, the JSF lifecycle(as diagrammed above), event handling, some of the Ajax code(Ajax4jsf).

When I get some more time I will revisit my application and incorporate some of this.

JSF is pretty neat!


Some good links:
http://myfaces.apache.org/
http://java.sun.com/javaee/javaserverfaces/
http://en.wikipedia.org/wiki/JavaServer_Faces
http://www.coreservlets.com/JSF-Tutorial/

Saturday, May 19, 2007

Reading RSS feeds with Java

If you were interested in incorporating RSS feeds into your java code you might want to have a look at Project Rome which is an open source java library for handling RSS feeds. Rome is currently in version 0.9 can be found at https://rome.dev.java.net/

I wrote a simple sample program which reads a given RSS feed and display some of the feed entries along with some attributes. It will also display the RSS version, as there are different versions of RSS. http://en.wikipedia.org/wiki/RSS_(file_format)

This simple program is the following:


import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndImageImpl;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import com.sun.syndication.feed.synd.SyndContentImpl;


/*
* 2 Required Jar files
* rome-0.9.jar retrieved from http://rome.dev.java.net/
* jdom.jar retrieved from http://www.jdom.org/
*/

public class RSSReader
{

public static void iterateRSSFeed(String rssFeedUrl)
{
try
{
//open up a connection to the rss feed

URLConnection feedUrl = new URL(rssFeedUrl).openConnection();

//Create Feed Object
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedUrl));

System.out.println("Examining rss feed:"+rssFeedUrl+"\n");

System.out.println("Feed type="+feed.getFeedType());

//Iterate through object to get details
List list = feed.getEntries();

System.out.println("Feed image="+feed.getImage());
if (feed.getImage()!=null)
{
SyndImageImpl image = (SyndImageImpl)feed.getImage();
String imageInfo = "Image url:"+image.getUrl()+"\n";
System.out.println(imageInfo);
}
for (int i=0 ; i < list.size(); i++){

//display entry attributes
SyndEntry entry = (SyndEntry)list.get(i);
String display = "Entry:"+i;
display += "\ntitle:"+entry.getTitle();
display += "\nlink:"+entry.getLink();
display += "\nauthor:"+entry.getAuthor();
display += "\npublished:"+entry.getPublishedDate();
display += "\nupdated:"+entry.getUpdatedDate();
display += "\ndescription:"+entry.getDescription();

display += "\ncontent size:"+entry.getContents().size();
if (entry.getContents().size()==1)
{
SyndContentImpl imp = (SyndContentImpl)entry.getContents().get(0);
display += "\ncontent value:"+imp.getValue();
}
display += "\n";
System.out.println(display);

}

}
catch(Exception e)
{
e.printStackTrace();
}

}


public static void main(String[] args) {

//James Gosling's blog
String rssFeedUrl = "http://blogs.sun.com/jag/feed/entries/rss";

//Mark Cuban's blog
//rssFeedUrl = "http://www.blogmaverick.com/rss.xml";

//rssFeedUrl = "http://techinitiatives.blogspot.com/feeds/posts/default";

//RSS 2.0
//rssFeedUrl = "http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c";

iterateRSSFeed(rssFeedUrl);


}
}

Wednesday, May 2, 2007

Developing Knowledge-Based Client Relationships

I just finished Ross Dawson's "Developing Knowledge-Based Client Relationships". I found it useful in understanding more of the business side of consulting and client relationships.

The book provides a couple of interesting definitions. "Information is anything that can be digitized, while knowledge is the capacity to act effectively, an attribute unique to people."p.96

Strategy in these types of client relationships is to evolve where the vendor and client integrate/collaborate at a high level to create higher levels of value creation.

A vendor should strive to avoid black box/commodity work and strive for the higher level knowledge based/collaborative solutions.

This was a good book for illuminating how to deal with clients strategically. Similar to "The Trusted Advisor". This was a good read before I dive back into more technical reads. :-)

Sunday, April 8, 2007

Service Oriented Architecture

I finished reading Enterprise SOA - Service-Oriented Architecture Best Practices (Dirk Krafzig, Karl Banke, Dirk Slama).

It seems to be one of the higher rated SOA books on Amazon. That is why I also read Thomas Erl's SOA (Concepts, Technology, and Design) book.

This book seems to show a little more hands on knowledge and things to watch out for rather than web service specifications. Although SOA is most commonly thought of along with WS-* specifications, SOA can be implemented without web services.

The big benefits I see are reusability and interoperability. Reusability in exposing small functional pieces that can be put together for strategic reasons through an orchestration. Interoperability in exposing siloed pieces of functionality of an organization to allow all the information to work together. By exposing different platforms(Java, .NET, mainframe,...), the organization can more easily build enterprise applications to meet short and long term goals.

Definitions of SOA:

A Service-Oriented Architecture(SOA) is a software architecture that is based on the key concepts of an application frontend, service, service repository, and service bus. A service consistes of a contract, one or more interfaces, and an implementation. (Krafzig, p. 57)


SOA is a form of technology architecture that adheres to the principles of service-orientation. When realized through the Web services technology platform, SOA establishes the potential to support and promote these principles throughout the business process and automation domains of an enterprise. (Erl, p.54)


Some videos:





Thursday, April 5, 2007

Missing the coolest job ever!

I joined the French Foreign Legion in 1994 and served 5 years there.

Legionnaire number 185565!

C'est la vie!

I miss those days. The spartan lifestyle, physical activity, living a dream!

Thanks to youtube I can get all pumped up and relive it!

Incredible!

I am so glad I went and did it.

ActiveBPEL Vendor Selector Visio Diagram

They say a picture is worth a thousand words, I thought I would publish a diagram of the Vendor Selector Application that I build using the ActiveBPEL Designer 3.0.


The code can be downloaded from last month.

The cool visio symbols for the web services were taken from Mai-lan's Visio Blog. They look cool and provide a different symbol to signify web services.



Wednesday, April 4, 2007

Scrum has started

Well, I finished writing the final exam for COMP 689 - "Advanced Distributed Systems" last Friday. It was an interesting exam and I will find out in a couple of weeks how it went.

Also had some good news, I won a scholarship for last years marks in my Masters program.

I won a Queen Elizabeth II Scholarship Awards
http://www.athabascau.ca/registrar/studawrds/winners.php
It was nice but there is much still to be done, I have one more course then I am to start my Thesis Essay in the fall.

Back to work topics, we have started to follow a Scrum process. It basically is the Scrum 15 minute daily meeting along with charting progress in the Scrum Backlog.

The backlog is powerful in providing an instance picture of progress in the project. We kept the estimates of individual task items to 2 days most. I am one of the four developers in the project. We are currently above the burn down chart. This is okay as scrum is a learning process.

Today I did not get what I wanted finished but 2 other developers finished 2 days work each that day. So that means that it was a great day for the team. The feedback and tracking is pretty instantaneous and I can see how greater visibility into team progress is given using the burndown chart.