Archive for the ‘Uncategorized’ Category

Annotations vs. XML

Sunday, November 19th, 2006

Since Java adopted annotations, I’ve heard a lot of discussion around whether to prefer annotations over external configuration files (often XML) and vice versa.

I think the decision boils down to two criteria:

1) Can annotations simplify the metadata?
2) Can changes to the metadata break behavior in your application?

If annotations do not reduce the amount of metadata that you have to provide (in most cases they do), then you shouldn’t use annotation.

I think the more important thing to considered is whether a configuration change could break behavior or not. If not, then you can feel comfortable applying the change while the system is running in production. External config files are the best place for the metadata in this case because you don’t want to have to recompile your code to make the change.

However, if a metadata change could break behavior then you’ll want to test the change by going through a full release cycle (change code, build, test, deploy). If you’re going to go through a full release cycle there is practically no benefit to not recompiling besides the 5-10 seconds you save in compile time. The more important thing to consider is which method of metadata definition is simpler.

For example, Hibernate mappings are often in XML, but annotations often provide the ability to specify the same mappings with significantly less metadata. Any changes you make to your mappings (whether in XML or annotations) could potentially be behavior breaking. You’re not going to change your mappings dynamically at runtime, are you? So, annotations seem like a much better choice.

[Note: I might consider using XML metadata for Hibernate when mapping to a legacy database because the annotations can often become bulky. Also, you are forced to use XML if you want to map the classes against two different databases with different schemas. I haven’t heard of a way to specify two mutually exclusive sets of Hibernate annotations on my classes. Even if this did exist it would be complex, which violates my first criterion for selecting annotations over XML.]

A brief post-mortem of my first XP project

Thursday, August 10th, 2006

My first (real) XP project was on a team of 9 developers back in 2001. There was a technical architect/lead, 4 senior developers (one of which was me), and 4 junior developers. We also had two “customers”, one of whom was also the project manager. The project was a commission calculation system for a large insurance company. The senior developers and the technical architect on the project were all consultants and the junior developers and customers were all full-time employees of the company.

The idea was that we were coaching the junior developers as we developed the system so that we could hand the project off to them after the first major release. A few months after I joined the project, despite maintaining a fairly consistent and predictable velocity, our project stakeholder declared that we were “behind schedule”. The project stakeholders did not care much for “sustainable pace” or “negotiable scope”. They just wanted to know what it would take to get the project done faster. Basically, they wanted us to sprint.

We gave them the best solution. We asked them to let the 4 senior developers work in a room by themselves and let the architect coach the junior developers through smaller deliverables (these were essentially tasks that the senior developers put on a punchlist). We also shifted away from our formal bi-weekly “iteration planning” meetings toward a more continuous “story planning” strategy that largely took place in an ad-hoc, just-in-time fashion on whiteboards in our project room.

Our velocity increased by about 30%-40% (if I remember correctly), and we made it close enough to the deadline to where we didn’t all get fired. :)

I took a few interesting things away from this project. First, it showed me that a company can be more productive with a team that is half the size, so long as the team is comprised of experienced developers. This reinforced my belief that most software projects can be successful with smaller, more experienced teams. In other words, most companies spend hundreds of thousands of dollars a year adding more people to software projects in hopes to complete them faster, while they should be reducing the team sizes and replacing junior developers with senior developers. Software projects could get done faster and cheaper. But, this seems like such an unintuitive thing, that most companies don’t think about it, much less try it.

The second thing I took away was that just-in-time (JIT) story planning is a viable replacement for iteration planning, at least with a small team. An “iteration” is really just a conceptual time period used to give a start and stop date for generated reports and a time frame by which to demo your code to your customer. Doing JIT story planning does not prevent me from doing two-week “iteration” velocity graphs (or moving-average velocity for that matter). I’ve done this type of JIT story planning on a few other projects as well. I’d like to see what other people’s experiences are with this (pros and cons) and see how it might scale to a larger team.

Opening JARs as a Windows compressed folder

Thursday, March 23rd, 2006

I’ve been trying to figure out how to get different file types (such as JARs) to open up as compressed folders in Windows. I’ve finally found out how:

1. Open a Windows Explorer window
2. Click on Tools -> Folder Options -> File Types
3. If you already have an associate with the file type that you want to open as a compressed folder, you’ll have to delete the association (or rename it just to be on the safe side)
4. Click New
5. Type in your file extension (JAR)
6. Click on Advanced
7. Select Compressed (zipped) Folder from the drop down (you can click in the drop down and just start typing C-O-M-P-R-E.. and it will find it for you)
8. Click OK and Close
9. Enjoy

Dallas/Fort Worth JBoss Users Group

Tuesday, March 14th, 2006

I’m coordinating the first meeting first DFW JBoss Users Group meeting. The meeting is being sponsored by my company (Valtech) at our office in Addison, TX. Marshall Culpepper (from JBoss) will give a presentation and do live demos on the JBoss IDE.

For more info visit: http://www.dfwjbug.org
To join the mailing list, e-mail: info at dfwjbug dot org

Depth of scope

Friday, February 3rd, 2006

When having a discussion about the negotiable-scope nature of some Agile processes (XP for example) an inevitable discussion about the “variables” of a software project arises. I usually abbreviate the “variables” as Q R S and T: quality, resources (a.k.a. cost), scope, and time. Many projects try to fix all of these variables and are subsequently shocked that they failed to meet their estimates on one of them. Something has to give, many Agile proponents argue that it should be scope.

Many business stakeholders are uncomfortable with negotiable scope projects because they feel like they won’t get all the business functionality that they need if they have to negotiate the scope. This is typically a concern of reducing the bredth of the scope — people don’t like to get rid of user stories, so to speak. But, another way to reduce scope is to negotiate the depth of your scope. The depth of scope is how complicated or time-consuming the requested or proposed implementation of a business requirement is.

Here is an example of reducing the depth of your scope: your business requirement may call for a screen to add users to roles. The person defining the requirement may ask for a way to dynamically drag-and-drop stick figure images that represent people onto images of buckets that have the role names on them. When you get to this user story (or at the iteration planning meeting), the development team estimates this as 8 story points. The business person comes back and says, “WOW, that much for such a small portion of the overall functionality needed for the next release?”. This is where you can negotiate the depth. You come back with, “This could be accomplished using regular HTML elements such as checkboxes, radio buttons, or drop down lists and only cost 2 story points”.

But technical people are also guilty of increasing the depth of scope. Technical people often overdesign or overarchitect solutions. Sometimes, they like to use technologies that are less efficient, because of preference or ego. Sometimes they only provide overly complicated implementation options in planning meetings because they don’t like the thought of “hacks” going into their precious system. A good way to try and avoid “technical-person scope creep” is to use Story-Test Driven Development (STDD).

Here are some references:
A discussion about story points
An intro to Story-Test Driven Development
A flow diagram showing how STDD works

Waterfall 2006

Sunday, January 29th, 2006

I tried submitting a paper for this conference (”Refactoring to Antipatterns”), but it wasn’t accepted. They claimed that it was too “Agile”. :-(

http://www.waterfall2006.com

Technology value divide

Wednesday, December 7th, 2005

When I went to bookmark www.digg.com on del.icio.us, I noticed that the majority of the recommended tags were related to the technologies that Digg is built upon, and only a few were related to what values and services the site actually provides. This is most likely because the majority of the del.icio.us userbase is Web-savvy techno-types who have particular interest in the underlying technologies.

There is a divide in the way that different people value technology. Technical people analyze and evaluate technonlogy based on how it is built. Business people analyze and evaluate technology based on how profitable it is. Users analyze and evaluate technology based on how useful and valuable it is to them.

This isn’t a new idea by any means, but as technology creators we sometimes get caught-up playing our particular roles and forget to see things from other important perspectives. It is important to note this divide and wear many hats when you are evaluating and/or building technology.

Transferring large files

Tuesday, October 18th, 2005

My parents recently went to a wedding in Canada and borrowed my camcorder to take some video. They wanted us to mail the video to them, but I had other things on the tape (and frankly I don’t trust snail-mail enough to send my only copy of something to somebody in a different country).

I got a firewire cable and downloaded the video off of my miniDV camcorder in the highest quality (the DV NTSC format, which is an AVI file). Unfortunately, the file was about 4 GB.

I didn’t want to have to split the file up to send it unless it was a last resort, and I don’t own a DVD burner, so I started exploring ways to send large files. There are a few Web services available that allow you to “e-mail” large files. You basically send the large file to a server and they send a link to the receipient, who can then go and download the file off of the server. Unfortunately, the file I had was too big to send using most of these services.

Then, the answer hit me. I’m always on the lookout for good (legal) uses for p2p filesharing, and this was one. I setup a private bittorrent tracker using Azureus and I created a bittorrent file out of the video. Then, I e-mailed them the torrent file and told them to download the bittorrent software. The nice thing about this is that they can now distribute the torrent file to all of their guests who want to see the video. If you think about it, this is a great ad-hoc social p2p network.

Where is your donation money going?

Thursday, September 1st, 2005

Many people may not know that money that goes to the Red Cross does not (by default) go directly to victims of the hurricane. As you may remember, after 9/11 there was a lot of controversy about this. There are also several financial scandals that were (and are still) being uncovered with different fundraisers and board members in the American Red Cross.

With the Red Cross, you must “designate” your donation for it to be applied directly to Katrina victims. The Red Cross will put undesignated money into the general Red Cross Disaster Relief Fund. If you go to the Red Cross Webpage to donate, there doesn’t seem to be a way to designate your donation to go directly Katrina victims. The Webpage is very misleading because they make it appear that the money would go to Katrina victims, but there is nothing on the donation page that guarantees this. From what I’ve read, I believe the only way to designate money with the Red Cross is to mail in a donation form, a check, and an attached letter that specifies the designation. I haven’t verified whether you can designate your donation over the phone.

Here is some good advice about donating (it also provides alternatives to the Red Cross).

If you’re in Houston, you may want to contact the Director of Personnel and Volunteer Initiative Program to see if you can volunteer to help evacuees in the Astrodome.

Another charitable organization that I’ve heard (only heard) good things about is Operation Blessing.

Come on DoubleClick, let’s get real

Thursday, June 23rd, 2005

Bennie Smith, privacy chief (whatever that is) of DoubleClick, seems to be a little out of touch with reality. In an interview, he warns browser makers against ad-blocking. He seems to think that browser plugins like Adblock will cause publishers to start charging for content.

His prognosis is a little off the mark if you ask me. There is still fantastic opportunity for Web-based ads. Yes, people are going to block banner ads. They are annoying and images are easy to block. No matter how convenient it is to provide banner ads, and no matter how convenient they have been in the past, people are quickly becoming less tolerant of them. Banner ads are becoming declasse. But that doesn’t mean people are totally intolerant of ads. Web users don’t like in-your-face banner ads, but they seem to be fine with less invasive forms of advertisement. Take Google and Yahoo’s advertising strategy for example. They are non-invasive, easy on the eyes, text-based, and cannot be blocked using Adblock. Take a lesson DoubleClick; the last time I checked, Google and Yahoo were still free and were making a ton of money off of advertising. There is a change in what people are willing to accept and if DoubleClick doesn’t adapt to the market demands, it will lose in the long run.

As I wrote in another blog entry (Banner-Ad-Free Syndication), companies like FeedBurner can learn something from this too. I suggested that advertisements in feeds should be in the form of individual feed entries and should remain text-based. A reader is more likely to read a text-based ad that appears as a blog entry than they are a banner ad. The typical user auto-filters banner ads in their brain.

Dick Costolo from FeedBurner commented on my blog entry, saying that they choose banner ads over text ads because they don’t want to affect search engine results. He argues that the ad text would mess up the search engine index. I think this is an admirable concern, but I’m not so sure that it is business smart. If I were FeedBurner, I would focus on pleasing my customers and their readers and not worry so much about how I may affect search engine indexing. These are decorated feeds, so they wouldn’t affect indexing of the Web-page itself. It wouldn’t even affect indexing of the original feed. It would only affect the FeedBurner modified feed. So the only search engines that you would affect are those that index your FeedBurner feed. I’m no expert, but I would assume that this would be limited to blog-specific feeds search engines.

Regardless, search engines are designed to filter through real-world content and find relevant pages based on your keywords, but the order of the search results are based on criteria other than just keywords. The fact of the matter is that advertisements are part of the real world. The more that users see FeedBurner banners in feed, the more likely that FeedBurner will write itself a one-way ticket into a users blocked URL list. Moreover, the more users that see the banners, the more likely that their URL will be included in default blacklists that are shipped with blocking software.

If we (as content providers) are really concerned about text-based ads messing with search engine indexing, we need to propose an HTML standard tag that would prevent search engines from indexing the content within the tag.

Example:

<html>
<body>

Here is some indexable content.

<noindex>
My Text based ad goes here and will not be indexed
</noindex>

</body>
</html>

I know that there are strategies for telling search robots to ignore entire pages, but it would really be nice to have a strategy for telling a search engine robot to selectively ignore content within a page. A so-called “line-item veto” for HTML indexing. Or… am I ignorant, and is there something like this available already?