« November 2003 | Main | January 2004 »

December 28, 2003

WebWork Tip #1 - Handling null properties

Almost a month ago I promised I'd start to document on my blog a tip per day about WebWork. I feel like a sleezy bastard for having failed to such a thing, but I'm finally making up for it. Disclaimer: this won't be completely daily, only because I'll be out of town for New Years, but once I get back it should be just about every day. Hopefully someone can roll this in to a decent set of documents (*hint*hint*)

OK, so today's tip is:

Handling null properties

Suppose you have an object, User, that you want to populate based on various form fields entered from the web. The most common practice is to create a UserFormBean (Struts) or a bunch of String properties in your action (WebWork) to set these values. Recently Matt Raible stirred up a bit of a discussion about using your domain objects (User) as the immediate input for your data.

Not letting this turn in to another one of those discussions, a common desire when writing applications this way is to make form input fields named things like "user.name" and "user.password". By doing this, a call to getUser().setName() is made, and your domain object is automatically populated, letting you no longer have to write the code to go from FormBean->DO yourself.

However, what if you have a more complex object? Suppose you want to do "user.shippingAddress.city". A call to getUser().getShippingAddress().setCity() would be made. Normally this will only work if getShippingAddress() returns a non-null object, meaning that your domain objects must now provide default instances for all their various properties. This just won't do!

So, thanks to my constant perstering of Drew Davidson (Ognl guru), a NullHandler was added to Ognl. This now allows for you to not have to create default properties in effort to avoid the "null problem" described above. Rather, WebWork is now configured to automatically detect a null reference and then create a new instance (only zero-arg constructors need apply) for you. The end result is that your domain objects remain clean and your webapps can still remain blissfully simple.

A word of caution: there is a small bit of overhead here, of course, so don't depend on it all the time. Also, dealing with lists becomes a bit more complex. Imagine a property "user.address[0].city" -- in order for the List property "address" to be properly returning an empty Address object when get(0) is called, more information is needed than is known by just looking at the property and the domain object. This will be addressed in the final version of 2.0, maybe in the form of providing a hidden form field such as "type:user.address:com.acme.Address" (huge security problem here) or in the form of another property file (not _another_ config item). Any suggestions would be very welcome.

And there you have it folks. Tip #1 -- please feel free to request tip topics, pimp alternative technologies (especially ones that are conceptually different, like Tapestry), or explain to me why Fresno Taco Bells don't serve the cheesy gordita crunch.

Gay Hobbits and Taco Bell

Some of the top search requests that lead to my website are:

  • anyone but bush
  • stupid things republicans say
  • stupid things democrats do
  • struts sucks
  • friendster slow
  • golf in the 70s
  • gay hobbits

Wait... GAY HOBBITS? OK, so some of the search terms are a bit odd, but gay hobbits was by far the wackiest one. Then I remembered why a search gay hobbits was causing my web server to show up. It's pretty amazing to see how such random topics such as Clay Aiken or gay hobbits can perk the interest of totally random people. I think I need to start posting about totally random events to see what other kinds of obscure terms I might.

One particular topic I'd really like to discuss: what happened to the cheesy gordita crunch at Taco Bell in Fresno, CA? They seriously just don't serve in the entire Fresno country! And don't get me started on Carl's Jr's sourdough ranch bacon cheeseburger being discountinued...

John Titor, Mad Cow, and President Bush

A few weeks back I ran across the story of John Titor (here and here). Anyway, I read through some of the posts and kinda chuckled at the absurdity of it all, but in the back of my mind I had this haunting feeling that this hoax had a remarkable amount of truth to it.

Now, don't take me wrong -- I don't believe the story one bit. But it was amazing that while reading this story I found myself seeing parts of the story not as farfetched as one might assume a story about a time traveler from 2036 sent back to 1975 to retrieve an IBM 5100. Particularly eerie were his "predictions" of trouble in the mideast and political struggles related to them in the United States. I can't help but feel that this next election is going to be critically important for the sake of the safety and wellbeing of the entire world. And I'm not talking about the desire to continue to make the rich get richer under the false precept that we must rid the world of all terrorists (anyone who doesn't drive Ford or Chevy, belong in the NRA, or say misunderestimate).

Anyway, back to the reason I was prompted to post this original. I titled the entry Mad Cow purely because I remembered John Titor claiming that Mad Cow would become a huge problem in the US. And then this week, what else hits our beef markets... none other than bovine spongiform encephalopathy (say THAT three times fast!) Like I said, I don't believe that anyone traveled back from 2036 to pick up and IBM mainframe, but this guy clearly knew how to strike in to the fears of his readers. Maybe more than he possible knew given the current political scene we're faced with in Iraq, Afganistan, North Korea, and most importantly, the United States.

I recently finished reading Dude Where's My Country and I couldn't help but get super motivated by Michael Moore's message to do whatever it takes to keep Bush from being reelected next year. I truly, truly believe he has caused far more harm to this country than anyone else, including Bin Laden (I expect to get quite a bit of slack for that one... feel free to write me or comment).

I'm currently reading Treason, which I must say is a terrible book. Not because I don't agree with anything Ann Coulter says, but because she writes so poorly. The first few pages of the book are filled with such venom (and NO humour!) that I could barely stand to finish the first chapter. However, out of respect for various points of view, I plan to complete this book so I can fully understand the issues both the left and right cannot seem to ever agree on. Most of all, I'm searching for understanding, though maybe there are better books that can offer that without being so utterly hateful.

December 27, 2003

In America

So last night I went and saw In America. I was a bit worried at first, because the opening scene involved the super-played-out scene where immigrants come in to New York for the first time waving and pointing at all the huge neon signs and all the various sights. Cheeeeese.

But then the movie changed, and that cheesiness was contrasted with the family moving in to a crappy apartment full of junkies. I won't give away anymore of the movie, but I must say it was one of the best I've seen in a long time (though, I do admit I don't get out to too many movies these days).

The most interesting parts to note are the sense of fragility that the film made me feel. At any given point in the film I felt as if this delicate family could be ripped apart any second. At first I thought it was just my mind getting a bit morbid, but my brother and my mom both felt the same way. Although we couldn't pinpoint what exactly it was that made us feel this way, it was clearly something that the director meant to instill. Truly amazing.

Also amazing were the performances of both girls, but especially the younger one, Emma. This little girl was absolutely perfect.

I didn't know anything about this movie when I got in to the theater (I like it better that way usually), but I was surprised to see that the film credits were to Jim Sheridan and his daughters Naomi and Kirsten... dedicated to Frankie Sheridan. I'm not sure how much of the story was a true story and how much was made up, but it was really neat to know that someone actually experienced at least some of what would otherwise just be a heartwarming story.

December 19, 2003

My Mom

Today I got some mail from my mom. Opening the envelope, I discovered two newspaper clippings: one that detailed how more kids than ever are being injured while skiing and snowboarding (I'm planning to go skiing a lot this season), and the other discussing how 22 people pedestrians were killed in San Francisco this year, as opposed to only 18 last year. The article points out that a higher percentage of those killed were at fault this year.

Great. My mom also likes to send me articles about people my age dying of skin cancer, or of kids murdering their parents. Uh huh... I know this can't be normal, right? And people wonder why I talk about how I don't expect to live past age 30...

December 18, 2003

Jon Udell's Dilemma

So Jon Udell has a dilemma: when using LinkedIn he was asked to define his relationship with someone using a predefined list of options. Of course, none of those options fit his needs and he finds it frustrating that LinkedIn is trying to box in his unique relationships.

Lately I've been thinking about my social network less about a graph of connected dots with a single dot (me!) in the middle of it all, but rather a cluster of dots in the middle of the network, where the cluster are various forms of "me", depending on how I present myself to the person I have a relationship with.

What I mean by that is that the way I act towards my mother is different than that way I act towards my roommate, which is different from the way I act towards my boss. Not only is measuring the "strength" of that relationship important (Spoke does this and I believe LinkedIn has plans to do this as well), but I believe that in non-virtual social circles the people at each end of the relationship are unique as well. There is only one "Patrick-talking-to-his-brother", just as there is only one "Chris-talking-to-his-boss". These slants on the individual make the social network much more complex.

In the real world we manage this daily without even thinking about it. I don't swear in front of my grandma, and so the person she knows is slightly different than others know me as. That unique perspective is important in our daily lives and is very subtle and most likely impossible to ever measure. I don't think that means that social networks are doomed to fail (duh, I wouldn't work where I do if that were the case), but I do think this subtlety adds an extra level of complexity to the task of mapping out someone's social network.

Jon writes that his relationship could have been better represented in the form of a Google query URL. In the future I think more software systems will begin to combine data from all over the place to better understand the unique perspective of each relationship. While not totally perfect, it might provide a good approximation of the billions of neurons that fire off in our heads when we decide on whether to claim, "That was a good fucking movie" or "That movie was really neat".

December 11, 2003

FeedDemon RSS Aggregator

Today I discovered FeedDemon, which went gold today. Before FeedDemon, which I fell in love with after just seeing the screenshots, I was using SharpReader. The funny thing is that it took me a second before I realized where I'd heard the name "Nick Bradbury" before.

It turns out Mr. Bradbury is the guy who created HomeSite (since purchased by Allaire, which was then purchased by Macromedia). Back when I was not a software developer, but more along the line of a website designed (at one time I actually had creativity that still flowed through my veins), I was fiercely in love with my beloved HomeSite 1.0.

I continued to use HomeSite until around the the 4.0 line, at that point I a) stopped writing web pages, and b) stopped enjoying HomeSite (I'm sure Allaire/Macromedia destroyed it, not Nick). HomeSite was the first IDE I used that actually did auto-competition -- and this was back in 1997 (maybe even 1996? I can't recall anymore).

Even today, my favorite IDE for code is IntelliJ IDEA, which has far-and-away the best code competition of any development suite. Clearly Nick was ahead of his time, and FeedDemon just proves once again he's totally in touch with how to build a functional application combined with an amazing user interface.

Rock on Nick!

Disclaimer: my memories of the years and/or the versions I used may be totally off base. All I know is it has been "eons" since I used HomeSite.

My brother's blog

My brother, Chris, now has his very own blog. I wanted to share that with the world. I also wanted to share the image of the clay chef with the toast. And lastly, I wanted to make a point of that it is now in writing that I am "infinitely smarter" than my brother, as well as you. Deal with it and shut up.

December 04, 2003

Dodgeball 3.0: why I'll upgrade my phone

Just found out about Dodgeball 3.0 from Many2Many. This is the reason why I will upgrade my phone and add text messaging to it. I've never really been impressed with all the fancy features on my phone (hell, it hardly works half the time anyway), but this is truly awesome.

I just heard from Dennis Crow, who is the creator of Dodgeball, and he informs me that it should be available in San Francisco in "early January". I can't wait.

This reminds me of ActiveCampus at UCSD. Through some funding by HP, my professor Bill Griswold was able to get hundreds of PDAs in to the hands of incoming freshman. Then using 802.11b cards and triangulation techniques, he could provide everyone a map of where their friends were on campus.

In a class I took with professor Griswold, Ubiquitous Computing, my team created a messaging system that was designed to route messages based on predefined rules. The idea behind it was that when linked up to ActiveCampus, rules could be created like "if I’m away from my desk and it is 8:00AM - 5:00PM, forwards emails to my phone". I'd love to see this kind of stuff really take off. Of course, as I mentioned a couple days ago, there is a great deal of anxiety that can be brought out when computer systems know where you are at all times.

December 01, 2003

the internet always endangered privacy

Another one I found through Danah... connected selves: Buying and Selling the Little Black Book.

Esther was one of the VCs at a recent "under the radar" event -- basically a "social software meets WWF" face-off between LinkedIn, Spoke, VisiblePath, and ZeroDegrees. At the time she seemed really concerned with two things: protecting data and avoiding the situation where you have to reject a referral (the you-are-not-my-friend rejection that no one wants to do on Friendster).

Both are a form of privacy. Recently at Spoke we developed a system that spiders the web for information about people to further enrich the social network (especially around searching). Now if someone searches for "OpenSymphony" I show up -- even though no _person_ in the network states that I am associated with OpenSymphony.

It's not that any of these social software companies are exposing more data than existed before (in some cases they are), but the bigger fear is that they are lowering the ease of access to data that was always there.

Google did this a couple years ago. Before Google, who would have been able to find out that in 1996 I used Fractal Painter (?!?). It's not that Google is invading my privacy -- it has just lowered the access to already public information.

In the future companies like Spoke might be able to use information found all over the web -- not just the raw who-knows-who data -- to build very rich graphs. Like all information, if not properly checked, it could lead to the perception of serious privacy problems.

I say perception because nothing new is being exposed. In 1997 someone could have found that newsgroup post of mine if he or she tried hard enough. Likewise, if someone connects the dots they can figure out pretty much my entire life history via various public newsgroups, mailing lists, blog comments, blog posts, and websites.

Is it scary that in the future all the information that a private investigator might have gathered can now be accessed with a mouse click? Yes. Does it mean that we should all be careful about what we let leak on to the internet? Yes. Does it mean that social networking companies (or Google for that matter) are evil? No. Does it mean they should take privacy seriously and do everything they can to protect the consumer? Of course. Should that be their duty (by law)? That's yet to be determined.

the uselessness of friendster

So Danah Boyd is talking about how useless Friendster is (she's mentioned it a few times in the last few days). Here she discusses how many weird friendster requests she has received.

I'm not an avvid Friendster user (mostly because it's slow as dirt... and you know how slow dirt is). But I can attest to the fact that I have several "friends" who I don't consider friends on there. I also have received a few requests from people that look faintly familiar. I have a horrible memory, so I might have known them at one time, but who knows.

This is the problem with Friendster: it encourages users to grow "uber networks" not through actually socializing but rather through artificial procedures. Fakesters, made up friends, requests from unknowns. All of these are happening because of the binary relationship that Friendster advertises.

The key here is binary and advertise. Binary is bad because as well all know, binary relationships are totally unrealistic. I may consider someone my "best friend in the whole wide world", but he might not think the same. Likewise, my friendship with someone I took a class with in college compared to my friendship with my brother is vastly different.

Advertising your social network via a set of concrete numbers is a neat gimmick, but it causes pointless competition. I'm not quite sure why people do this (I'm quite content with me 23 friends), but it happens nonetheless. What value does this advertising add? I find much more interesting information on Friendster after I've found someone that looks interesting (cute!) -- then I learn how I'm connected. I have never been interested in seeing who in my social network has lots of friends.

I think both of those are the root cause for why Frienster is useless now. I really like the Spoke approach (again, I'm totally biased) because it doesn't use a binary relationship and it doesn't advertise anyone in particular as a well-connected individual. In short, it lets the true social dynamics play out.

The real key for social software, including Spoke, is when we can expand upon building networks from easy stuff like email and move in to IM, phone calls, and someday, using location-aware devices like ActiveCampus@UCSD (my alma mater), in-person interactions. Oh well, I suppose we better walk before we start running.

Update: my grammar was horrendous -- had to fix. Apparently my bad review wasn't so off target after all :) MT seriously needs a good applet-based editor to place red squiggles under my words while I spew my garbage.

OSWorkflow Designer Live

Hani, with the help of some mysterious students from China, got the OSWorkflow Designer in not only working shape, but actually totally usable. Even better, you can try it out right now. It's really cool to see how far OSWorkflow has come in the last 1.5 years since I forced version 1.0 on to the OpenSymphony team and become a permanent squatter :)