Friday, March 07, 2008

A new day at SDWest.

Well, today we managed to really attend sessions. There were some work things happening that really just prevented us from providing our full attention, but given that the topic of conversation was also the money source for our time, the only real problem I see is the expense of being in Santa Clara. That cost to work is much less than the cost of two days of work.

Anyway, that being said, yesterday I did attend Native XML Databases by Elliotte Rusty Harold. His presentation was pretty informative, but I really cared the most about the first half. Since, I knew nothing about XML databases and only a little more than that about relational databases, I got a lot out of it. I'll have to go back to work and re-evaluate some of the database choices I made now that I've learned a little more. Maybe, as I write more of this stuff, I'll even be able to communicate more of it back to you.

Today, I attended four whole sessions.

The first was building RESTful web services with Axis2/Java. I think I was doing fine with it at first, but I decided to sit too far from the front to read all of the slides and I can't find the presenter's slides anywhere. I'll have to update the post later with the new information.

The second was building a multi-threaded server in Java with NIO. Ron Hitchens has posted the slides and source code at the site for his book. He had a very informative presentation I thought. Ron talked about using selectors, which is something I've never taken the time to think about. I was going to spend the time but when I figured out that there was no Multicast datagram channel, I decided not to spend any more time on it. Although some of the audience sort of seemed to miss the point as far as what the topic of his talk was about. They were asking questions as if he was teaching them how to write a web server and they wanted him to tell them exactly what to write. Some the questions just seemed a little out of place. Of course, ironically, Paul Tyma was giving a presentation in the afternoon that was essentially just the opposite of Ron's.

The third presentation was by Brian Goetz and was titled Effective Java Concurrency. Based primarily on some of his Java memory model work and his book. He had lots of good information, but I suspect that if I finish reading his book, I'll get to that information again.
Some notes I took:
- Allocation is cheap - use it unless the objects are very large
- final is the new private
- Make objects immutable if at all possible
- Document as clearly as possible whether an object is thread safe or not
- Try to eliminate or shorten stretches of code that can only execute serially or basically, make synchronization code blocks as short as possible
Also, Brian, if you read this, sorry we were bad people and made so much noise at the end. We were just excited to move on to the puzzlers.

The fourth presentation was Java Puzzlers with Neal Gafter and Joshua Bloch. That was a very entertaining presentation and I think the best that can be said is to read Neal's blog. He posts puzzlers regularly.

Thursday, March 06, 2008

First day of smaller talks...

I will try to write up a quick blurb about the sessions I attended yesterday tomorrow.
I also have more pictures I should post, but I just haven't yet.
I "went" to Better Test Design, Native XML Databases, Implementing RESTful Services in Java, and Java Performance Myths.

Security and defensive programming?

The first day of SDWEST, I attended tutorial on security and defensive programming by Jim DelGrosso. I'm not quite sure that I was part of the appropriate audience, but only because most of what he talked about didn't really apply directly to what I do. Since I'm primarily developing Java code for internal applications, I can generally trust the user of the application to not be malicious. It was a very interesting presentation and I would recommend it to any developer who hasn't thought much about security and personal information protection on their own machines. There were lots of little gotchas for websites that had never even occurred to me. But as part of my work, I wouldn't run into any of them generally. At the end, he had lots of good points about how to think defensively when coding and I like the recommendation to use unit tests to test security behaviors as well as correct behavior for valid inputs.
Jim provided a decent presentation that as a result of working on Java programs for internal work just doesn't apply to me most of the time.

Test Driven Development?

I attended Justin Gordon's tutorial on JUnit and Test Driven Development. After sitting through just the first half of the presentation, I definitely see how this could be a useful method to develop. I'm hoping to use it to work on my next work project only because its only me really working on it. I know almost all of the basic requirements already myself because the goal is really to build an internal library to access our data. I just need to hide the guts of the storage and unit conversions and whatnot from the rest of the team. It should be really easy to try out TDD that way. Also the other thing I'm working on is just fixing bugs in our new display/data system. That is the source of the data for the project I mentioned first.

I really like some the guidelines that Justin laid out in the session.
- Make the names describe the requirement under test.
- Test the goal of the code, not the implementation.
- Tests should be for one specific case, not a whole pile of cases.
- Don't try to write a bunch of tests at once and make them all work.
- Do not fix a bug until you have written a test that demonstrates the bug.

I think that last one is huge.

Overall, although I had to leave a little early, I thought Justin did a great job.

...more groovy

So additionally, I want to mention that I'm planning on trying out using Groovy on the next work project because its main use is to build a library to access our data that is usually in a database, but not quite always. The Groovy tutorial also seemed to lead me in a way to two other topics. First, Test Driven Development... The last lab for Groovy was to use it to test java classes. That seems to be one of the more powerful uses for Groovy, and I'll definitely be playing with that soon. Maybe I'll even use that as a way to introduce Groovy to some others at work using JUnit and Groovy to test our classes. The other presentation that I attended this morning was on Native XML databases...

Wednesday, March 05, 2008

Groovy 101?

I attended Andrew Glover's Groovy 101 tutorial and I have to say that I was fairly impressed at some of the stuff that you could do very easily in Groovy. I definitely do not like the name, but that aside I decided to give some Groovy coding a try.

Firstly, it is really easy to move into Groovy programming because standard Java is also Groovy. The syntax is legal. Also, the Groovy code compiles to Java byte code so you can call Groovy from Java and vice versa. Definitely go to the Groovy homepage to see what Groovy looks like. So far my favorite things are the SQL connectors and the MarkupBuilders. So much boilerplate or at least tedious code is completely taken care of by Groovy itself, so you can focus on the actual problem. That's much better.

I'm trying to replace a javascript that we use to launch some Java apps with a Groovy script. More later...

Overall, I enjoyed Andrew's tutorial. He was the first of many presenters to use a Mac at the conference. Wish I had one...

SDWest08


I've managed to make it to SDWest 08 this year and I've attended 3 tutorial sessions so far. I'll probably post a little more later, but I figured I'd try to get back to this posting thing again.

But, more importantly, I haven't been to this area before and I think its fun to drive around and see Sun Microsystems headquarters, or Google, or Yahoo. And the hotel we are staying at is across the street from Tivo. :)