There is a great article over at Ajaxian on programming for the Nintendo Wii. I bought a Wii myself a few weeks back and have been having great fun with Tiger Woods golf. (It is actually my first game console) Up until down the idea of playing a game console [...]
Read the rest...
Stephen Downey on September 11th, 2006
I became interested in code reviews while working with Accenture Ireland. As part of my role I was responsible for introducing code reviews into the project and insuring that they took place. It was amazing to see the difference a 15 minute discussion of a piece of code or a design document could improve the overall quality of the project. As more people are aware of the design for an early stage. It also serves to educate more junior developers on the team. Srivaths Sankaran presents a good overview of code reviews in this article. It will give you a good background in to why we perform Code reviews and the many aspect of a code review. He concludes his article by saying:
…..You can conduct thorough code reviews without succumbing to time pressures. Did you know that more than 60 percent of the defects can be captured by effective use of peer reviews (c.f., Boehm and Basili's Software Defect Reduction Top 10 List )? With a judicious combination of automation, interactive tools, and risk-based evaluation, you can reap the benefits of early problem detection…..
One piece of advice I would say is to remember that the primary goal of Code reviews is to improve quality and educate developers. It is not a witch hunt!
Stephen Downey on July 20th, 2006
I came across this article from back in January by Elliotte Harold regarding Subversion. Subversion is being adopted by more and more developers in recent times as their SCM tool of choice. I am using Subversion with my current Client and have found it great to work with. I have used a few of the SVN plugins to get my ENV working on my windows box but found the Subclipse plugin for Eclipse to be one of the better ones. This is also the one that Harold discusses in his article. He concludes his article as follows:
For internal repositories, Subversion is a vast improvement over CVS. Once some kind of obliteration functionality is added, it should be suitable for external repositories as well. While third-party Subversion support in tools like Eclipse is not quite as widespread as support for CVS, this is changing rapidly. Subversion should be the default source code repository for new projects…
…….The future lies with Subversion.
In the past I have used CVS and VSS but I have found Subversion has picked up where CVS has left off. I agree with Harold that Subversion is a must for any new projects.
Stephen Downey on July 10th, 2006
I came across this interesting article by Matjaz B. Juric on how to integrate BPEL(Business Process Execution Language) into an SOA environment.
Juric discusses the core concepts involved with BPEL and why BPEL is so important. He uses a business travel system as an example.
Juric concludes by stating:
We have seen that BPEL is one of the most important cornerstones of SOA. It differs from common programming languages, such as Java, and is relatively easy to learn and use. Because BPEL has been designed specifically for definition of business processes, it provides good support for various specifics of business processes, such as support for long running transactions, compensation, event management, correlation, etc. BPEL is well suited for use with the Java EE platform, and many BPEL servers build on top of it. Java developers, particularly those who are involved in the development of enterprise applications and SOA, should therefore take a closer look at BPEL and start using the benefits it provides.
I have not used BPEL in any of the projects that I have been involved with but it certainly looks like something that should be seriously considered.
Does anybody have any Caveats from their experiences of using BPEL? If so please leave a comment as I would be interested to hear any real world experiences.
Stephen Downey on July 6th, 2006
Here is an interesting artice from Jeff Friesen discussing how to interact with a USB device using java:
Java and USB by Jeff Friesen — Want to use a USB device in Java? Some with native abstractions, like mass-storage drives, work as you'd expect, but many devices like webcams and game controllers are simply invisible to the Java programmer. Jeff Friesen looks at two APIs that expose USB devices to Java, then shows how to build a Java USB implementation of your own.
Currently, Java does not officially support USB but Jeff discusses how you can use thirdparty APIs as well as his own API. Readers may also be interested in the Bluetooth JSR.
Stephen Downey on June 15th, 2006
I came across this handy web tool for converting image files into icons. There are also tips for adding the icon to your website. I gave it a go with my Passion Development logo and it worked great.
Stephen Downey on May 30th, 2006
Well, I have been pretty busy lately hence the lack of blogs. Passion Development is up and running, well the company anyway. I still have a bit of work to do on the web site.
So why did I decide to start Passion Development?
In the last few years I have seen a lot of changes in the Software Development industry in Ireland. Companies are constantly down sizing their product development departments, in favor of short term projects developed by contractors. Gone, are the years of large product development departments that suffer from the quiet periods between projects. In today’s software industry, if you are not adding value you are simply a cost.
It is my aim to use the skills that I have developed to add value to my clients.
I asked a friend of mine, Wendy Kavanagh of dynamo to design a logo for me that emphasized my passion and love for the work that I do. I could not be happier with the finished product. It is made of an very abstract p and d. Thank you Wendy for all the hard work. Now, If I only got to work on the content for the Passion Development Website, she could work magic charm on that too.
Stephen Downey on April 20th, 2006
I have been looking at yet another great tool from Google. In true Web 2.0 style Google calendar allows people to share calendar events with on the web. They provide an API so I am going to try to integrate my public events with my web site.
On a different note, I was at another DJMG meeting last week where we discussed dynamic languages such as Ruby on Rails and Groovy. It looks like there are a lot of advantages to using these languages over the conventional Java program. Jake was able to show us how Ruby on Rails can provide you with web interface to database tables in just a few clicks. As we discussed this software works great for what 95% of web applications use J2EE for and at the end of the day this is what we usually are developing.
Stephen Downey on April 7th, 2006
I just received a link in my del.icio.us inbox to this "interesting" presentation. The subject matter is very interesting in itself but the presentation style is not your run of the mill powerpoint.
The presentation discusses a very interesting point. All web2.0 developers are looking for the following:
Fast Revenues
Rich UI
Hackable API's
Communities
On the other end of the spectrum, the guys and girls developing client side "old school" applications are looking for:
Fast Revenues
Rich UI
Hackable API's
On Demand
Communities
As you can see the goals of these two communities are pretty similar, it would be very beneficial for everyone to join forces to achieve the common goal.
"At the end of the day we are just talking about passing data between people".
Stephen Downey on April 4th, 2006
There are often times when you need to call a method but you do not know the name of the method until runtime. I came across this issue during my Thesis. Our problem was as follows:
How do we dynamically map between an object type and a method in the sub class of PublishableServer that processes that type?
Here is some background to the problem:
PublishableServer is an abstract class that can connects to our distributed system and receives requests for lists of PublishedData objects. A subclasses of PublishableServer must implement methods to process various PublishedData objects it receives.
If we look at the JDBCServer illustrated above. This class must implement methods to search for PublishedData objects in the database that it is connected to. Each method must map between attributes of the PublishedData object and the columns in the database. As the getPublishedList(PublishedData publishedData) method of PublishableServer is called we must map this publishedData object to the correct method in the sub class.
One option could be to declare the methods as abstract in the PublishableServer class and then use the instanceof operator to select the correct method.
public ArrayList getPublishedList(PublishedData publishedData)
{
if (publishedData instanceof Student)
{
return getPublishedList((Student) publishedData);
} else if (publishedData instanceof Course)
{
return getPublishedList((Course) publishedData);
}
return new ArrayList(0);
}
public abstract ArrayList getPublishedList(Course publishedCourse);
public abstract ArrayList getPublishedList(Student publishedStudent);
The issue with using this approach is that we need to update the PublishableServer class every time a new type of PublishedData is added to the framework. All PublishableServer implementations would also have to implement all the search methods, even if they did not want to.
The solution to this issue is to use Reflection to dynamically call the methods in the sub class. To allow this, the methods in the subclass must have a known name. We prepend "getPublished" to the name of the PublishedData class that was passed to the getPublishedList() method. So all we need to do is get the name of the class that has been passed, append that to "getPublished" and we have the name of the method that implements that search. The publishedData object implements a mehtod called getClassName() that will return the name of a class without the package name. To create a method to search for Student objects we simple implement the following method in the JDBCServer class that extends PublishableServer.
public ArrayList getPublishedStudent(PublishedData publishedData)
The body of this method should implement a search for Student objects in the servers persistent store using the properties of the Student object passed to narrow the search results.
So how do we call this method once we have its name?
The getClass() method that all java objects inherit will return the runtime class of the current object. In our case when we call this method inside the PublishableServer class we will get the runtime class that extended our PublishableServer class.
The Class object contains a method called getMethod() which takes the name of the method and an array of Class objects which represents the list of parameters for the method. If the method does not exist a NoSuchMethodException is thrown. If this is thrown in our server we simple return an empty ArrayList as this server does implement that search.
If the method does exist then we call invoke() passing the current object and PublishedData parameter. This will dynamically call our method and return an Object class. We must cast this to an ArrayList and return it. The implementation of this can be seen below.
public ArrayList getPublishedList(PublishedData publishedData)
{
ArrayList result = new ArrayList(0);
String className = publishedData.getClassName();
String methodName = "getPublished" + className;
Class[] argTypes = new Class[]
{ PublishedData.class };
Object[] args = new Object[]
{ publishedData };
try
{
Method m = this.getClass().getMethod(methodName, argTypes);
result = (ArrayList) m.invoke(this, args);
} catch (NoSuchMethodException noSuchMethod)
{
logger.error("ERROR: " + serverName
+ " does not support searches of type: "
+ publishedData.getClass().getName());
logger.error("ERROR:"
+ this.getClass().getName()
+ " needs to implement the follwing method to preform search:");
logger.error("public ArrayList " + methodName
+ "(PublishedData publishedData){");
logger.error(" ArrayList result = new ArrayList();");
logger.error(" //Preform Search");
logger.error(" return result;");
logger.error("}");
} catch (IllegalAccessException illegalAccess)
{
logger.error(serverName + " Does not support searches of type"
+ publishedData.getClass().getName(), illegalAccess);
} catch (InvocationTargetException invocTarget)
{
logger.error(serverName + " Does not support searches of type"
+ publishedData.getClass().getName(), invocTarget);
} catch (Exception general)
{
logger.error(serverName + " Does not support searches of type"
+ publishedData.getClass().getName(), general);
}
return result;
}
Stephen Downey on April 4th, 2006
I came across this interesting comparison of web 1.0 to 2.0 by Matthew Thomas. I think it is a very simple but true example. Web2.0 is about getting the product to Market as soon as possible and constantly improving. As Walter Higgins said, just do it anyway.