Recent Posts

RSS Feeds

Linux on a Mac?

Slashdot is probably a better place to ask but I figure it can't hurt here either. I am contemplating turning one of my macs into a linux box. Has anyone done this? I have two iMacs one G4 800MHz and a G3 600MHz both are basically sitting around collecting dust.

My main goal is Java (SE & EE) development with both WebSphere & Weblogic. So if you have switched a mac to linux how did it go? Were you able to do Java development? It is hard enough to do development on a Mac with the lack of 'typical' enterprise software tools available on the mac and I asking for trouble by going further out onto the bleeding edge with PPC Linux?

Your thoughts greatly appreciated

Permalink     7 Comments

JUnit, Assertions & Management

I've recently been having a discussion about the quality of JUnit tests and how manager types might be able to judge the quality of the tests.

In my mind this is a not so easy to solve. I know managers (esp on very big projects) need a way to judge the quality of what is being delivered but often times they take their statistics far to seriously. As an example take code coverage calculated by Clover or the like. As a developer I find code coverage results to be a fantastic tool to determine if my developer tests are covering all the code under test that they should. And to a certain extent the code coverage numbers are good to give to management so they can see the progress of the tests. If the tests are good then as this number goes up you should be able to assume better quality in the code base. All too often though I see tests that have 100 lines of code and a single println at the end, not a single assert. Tests like this will generate a lot of coverage but don't really tell you anything about the quality of your code.

In my experience developer tests are too often on the poorer end of quality. So on to the point of my post. How do we measure what good is? There are the simple statements link 'each test should be tightly focused and have one assertion'. The problem is that this statement is too broad to measure the quality of your tests. This statement could possibly be refined with a statement like this 'the ratio of non-comment lines of code to assertions should be low'. In other words you should have a few lines of code in a test and an assertion to make sure that what was expected actually happens.

What are your thoughts on measuring test quality? Should management even be concerned with this measurement?

Permalink     3 Comments

MyFaces @ ApacheCon!

I'm really excited that I got a spot @ apacheCon this year talking about MyFaces which is well on the way to becoming an apache project in the jakarta incubator.

If you want to come and throw tomatoes at me come see talk #995 'Building WebApps with MyFaces'

Permalink     1 Comment

Form Validation in JSF

I got an email a couple of days ago with someone asking me about how to do form validation in JSF. I figured that might be a common interest so here is the exchange

The way I'd do what you suggest is to code the validation in a method and have that method invoked from the
action that will determine where to go next (like the submit).

// validation method
public boolean validateForm() {
  // validate the form
  // each field in the form typically has a field in this class
  // where something is not valid add a message
  // if everything is valid return true other wise return false
}

public String submit() {
  boolean valid = validateForm();
  String logicalOutcome = null;
  if(valid) {
    logicalOutcome = "next page";
  } else {
    // null will cause it to return to the same page
    // since you added the messages in the validate method
    // they will be available in your ui if you use <h:messages/>
    logicalOutcome = null;
  }
  return logicalOutcome;
}

then in your faces config file (faces-config.xml typically) you'd have something like this

...
  <navigation-rule>
    <from-view-id>/firstPage.jsp</from-view-id>
    <navigation-case>
      <from-outcome>next page</from-outcome>
      <to-view-id>/otherPage.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>
...

if the form is validated the navigation rule would take you to 'otherPage.jsp', if not since the return is null you'd stay on the same page and display error messages

Hope this helps!

Permalink     No Comments

I love Sotto

You might have noticed that I changed to the Sotto template set for my blog. I love it! I'll be updating the pics shortly to something more my speed/style (i.e. mountains & motorcycles & skis :-) shortly but I'll be sticking with this theme for the time being.

Permalink     1 Comment

jsf-spring & RC2

I tried to integrate the two but it does not work. I posted about it on my Eclipse blog because I used some of the cool features in Eclipse debugging support to figure out why.

Permalink     No Comments

Finally: DJUG Preso Posted

I've finally posted the DJUG preso to my blog. When its up on the DJUG site I'll redirect the links there but for now you can consume all my bandwidth with these links.

The quick time has the advantage of getting to see Mr. Fudd telling you how simple JSF is.

Permalink     2 Comments

JSF & Spring

I've been playing around with JSF & Spring for the last day or so and its really cool being able to configure your beans with DI.

I've been using the jsf-spring project stuff. It works well and the bi-directional nature of it is cool (it makes the JSF 'context' part of the Spring context) but a lot of overkill for me since all I really want to do is inject my 'services' into the page beans.

I was experiencing a problem though with the validation of the faces-config.xml that ships with jsf-spring when deploying to JBoss. For some reason the dtd that's in the jsf jar file is not found at runtime by JBoss. Any pointers to why that's not working would be appreciated. I spent quite a bit of time trying to get the Entity Resolver stuff to work but had no success, and besides it should just work right. Ah well please let me know any pointers you might have.

Since I can easily get by with the greatly simplified stuff that ships with Spring now I'm going to convert to that implementation so it should not be a problem but I'd still like to figure out what was going wrong.

Permalink     No Comments

Where Have I Been?

Something went wrong with my blog and I've just not had time to fix it till now.

I've been struggling to get my Colorado Software Summit presentations done and my real job and my Eclipse Live book updates done and spend some time with my fantastic family. I really need to retire so I have time to do the stuff I want to do instead of the stuff I don't want to do (i.e. my real job).

Anyway the Roller community was great in helping. Thanks again Lance, Matt & Dave!

Permalink     1 Comment

Kent Beck @ Agitar

Agitar announced today that Kent Beck joined to help them make their products adapted to XP.

There is also a thread @ TSS going on this announcement.

Permalink     No Comments

Ed Burns (JSF RI Lead) posts JSF talk

Ed Burns posted his presentation to the Orlando JUG to the JSF RI site recently.

Tons of cool intro info on JSF as well as a quick explination of what the delta is between JSF & Struts.

Permalink     No Comments