Web Things Considered

Tuesday, September 20, 2005

Tagging hits mainstream

I happened to catch the end of this commentary tonight on NPR discussing tagging, del.icio.us, and Flickr. Social software sites such as these were a big inspiration for NetworthIQ, so it's nice to see them in the mainstream press.

(sneak preview exclusive only available to Web Things Considered readers.... you probably could guess that tagging is in our future too)

Monday, September 19, 2005

Internet Explorer coming around?

I'm pretty much a confirmed Firefox guy. I'll probably give Flock a try, when it comes out, but for now Firefox is where it's at. There are two big reasons for this, LiveHTTPHeaders and the Web Developer Toolbar (along with tabbed browsing and the general abundance of plugins).

But as a web developer, I still have to respect IE's market share. Today, Microsoft released a web developer toolbar for IE. I'll have to check this out and see if it can make life in IE easier. Let's just hope this goes better than my experiment with IEHttpHeaders, which crashed IE on three different computers I tried to run it on.

Update:
Nikhil Kothari's Web Development Helper also looks like a great tool for debugging web apps if you're working with ASP.NET 2.0.

Sunday, September 18, 2005

In the New York Times

This is a big day for NetworthIQ, Fourio (our company) and myself. We were mentioned in a an article in the New York Times discussing how people are sharing their financial information on the web.

It's a pretty amazing feeling to to see an idea you had get put in front of millions of people. Needless to say, our user base has nearly doubled and we've had nearly as much traffic as we had in the whole first two months of operation, all in the last 14 hours. Let's see what happens as the west coast wakes up. Now, we have to get back to work on getting some new features implemented so that we can keep the momentum going.

Wednesday, September 14, 2005

SEO thoughts

Just wanted to point to my entry over on the NetworthIQ blog discussing the latest SEO results and how we implement our SEO strategy.

DropDownList inside a GridView (or DataGrid)

I'm still coming up to full speed on ASP.NET, as evidenced by a conversation I had yesterday about Grids and DropDownLists and their events. In the interest of reinforcing the concepts, I've implemented a sample page and am summarizing it here to further commit it into my brain.

The page requirements:
1) Table/Grid displays a list of states (U.S. states) with a column for the state name and a column that contains a dropdown list of the state's cities.
2) Upon selecting a city, the page will display the city name (and perhaps futher lookup some information specific to the city).

The basic ASP.NET flow here is (using 2.0 here, but works similarly in 1.1 using DataGrid):
1) Create a GridView with a bound column for state and a template column for the DropDownList
2) Create a label to display the city name upon selecting it in the DropDownList.
3) Bind the GridView to an array of state objects (could be bound to many other things as well, but keeping it simple for this example). State contains properties for Name and for Cities.
4) Hookup RowCreated event on the GridView so that we can populate the cities into the particular row's DropDownList.
5) Add postback event for getting the selected city and populating the label with it.

Here's what the aspx code looks like:

<asp:GridView ID="gvStates" AutoGenerateColumns="false"
runat="server" OnRowCreated="gvStates_RowCreated">
<Columns>
<asp:BoundField HeaderText="State" DataField="Name" />
<asp:TemplateField HeaderText="Cities">
<ItemTemplate>
<asp:DropDownList ID="ddlCities"
AutoPostBack="true" runat="server"
OnSelectedIndexChanged="ddlCities_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

<asp:Label ID="lblCity" runat="server" Text="Label">
</
asp:Label>

And here's the code behind:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Create states array and bind it to Grid
ArrayList states = new ArrayList();

string[] cities =
new string[] { "Portland", "Salem", "Eugene" };
State state = new State("OR", cities);
states.Add(state);
cities =
new string[] { "Seattle", "Tacoma", "Olympia" };
state = new State("WA", cities);
states.Add(state);

this.gvStates.DataSource = states;
this.gvStates.DataBind();
}
}

protected void gvStates_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (!IsPostBack)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Bind drop down to cities
DropDownList ddl =
(DropDownList)e.Row.FindControl("ddlCities");
ddl.DataSource = ((State)e.Row.DataItem).Cities;
ddl.DataBind();
}
}
}

protected void ddlCities_SelectedIndexChanged(object sender,
EventArgs e)
{
this.lblCity.Text = ((DropDownList)sender).SelectedValue;
}


This code should be more defensive with null checking, type checking and exception handling in place. But, you get the idea of the general work flow (and now, so do I).

A couple of points that I'd like to highlight:
- AutoPostBack is required on the DropDownList in order to submit the page immediatlely opon selecting an item. For some reason I thought if the event was there, that was all that was needed (time to come out of my WinForms haze).
- Use the FindControl() method to grab a reference to the DropDown.
- In this case RowCreated or RowDataBound would work for binding the DropDownList. If you needed the State name to lookup cities, you would need to use RowDataBound. However in this case, since the object we're bound to already has the cities, RowCreated works fine too.

Tuesday, September 13, 2005

Atlas and LINQ

A couple of notable events (to me anyway) from PDC today. Atlas and LINQ were both announced.

Atlas is Microsoft's much touted AJAX implementation. I believe AJAX (and Atlas) has a bright future, and I'm looking forward to diving in to it deeper. I just hope that developers don't start doing everything with Atlas without understanding what's going on under the hood, just because they can.

LINQ is new to me, but looks to be the successor to C-Omega which I touched on briefly in my last post about object persistence in .Net. Being able to query both XML and relational data directly in the language, complete with compiler support, is a powerful idea which will hopefully make all that data access code a whole lot easier to write.

More stuff to play with now. Man, you sure can't ever stand still in this industry.

Monday, September 05, 2005

Object Persistence in .Net (PADNUG 8/31/05)

I have very little free time these days, but the timing/topic/speaker were the right combination to motivate me to go to my first PADNUG (Portland area .Net user group) meeting last week. We're using NHibernate for NetworthIQ and I wanted to hear more opinions about it from the community. Plus, I didn't want to miss the chance to see Ted Neward speak. I took a J2EE class from him a couple years ago and was utterly amazed at how much I learned in that week. Ted is one smart dude, he's probably the brighest developer I've come across in my career. Oh yeah, and since Ted has stated that "Object-relational technologies are the Vietnam of the Computer Science industry," I knew he'd have some interesting thoughts on the subject.

In the spirt of agile development, Ted gave an "agile" presentation on Object Persistence in .Net. Below are my notes, most of which comes from from his "agile" PowerPoint (Notepad) presentation used for the talk.

Object Persistence in .NET

Key Points

  • Most modern languages are object oriented
  • Objects (fields) --> databases (columns)
  • Should match up? Not so much (object relational impedence)
  • The RDBMS is governed by the relational calculus (Chris Date)
  • When trying to bridge from model (object --> hierarchichal, object --> relational) you run into object impedence
  • Models don't slave well to other models
  • Microsoft Research is tackling it

ADO.NET issues

  • ChrisT sez objects are cooler than relations (we work with objects mostly)
  • no compiler support for when you f*ck up your SQL (latebound)
  • dangerous security implications (SQL injection)
  • tedious (lots of typing)
  • smells of DAO (rows and columns not objects)
  • type mismatching
  • nulls/nullable/nullable types (fixed in 2.0, right?)
  • connections and connection pooling
  • transactions
  • entlib can help (not an end-all)

DataSets

  • a big bowl object: DOM for data people
  • disconnected (+ connection-management, sort of)
  • in-memory options
  • "strongly-typed" DataSets aren't (?)
  • boxing/unboxing overhead
  • memory footprint (God help the PocketPC)
  • eager-fetched data retrieval strategy
  • Does it provide much more than ADO.NET (not really)

ActiveDirectory

  • some support for early-bound
  • not general-purpose
  • dynamic schema/schema manipulation after deployment

OODBMS

  • no object-relational impedance mismatch!!
  • behavior and data combination/disconnect
  • whose definition of OO do we use?
  • how do we import into OODBMS
  • reporting? It's up to you to do it all
  • data access approaches mean object access approaches
  • have to navigation objects as opposed to the SQL join approach
  • dasBlog, I mean regexp, kicks ass, sez ScottH (don't ask about reporting on blog entries)

XML and related tools

  • querying/reporting difficult across files
  • "objects and xml go together like chocolate & PB" (nope)
  • xml is hierarchical, objects can by cyclical
  • XML needs single root, SOAP provides SOAP body element as a cheat (SOAP 1.1)
  • Schema committee wrestled with it for 2.5 years and punted

Nhibernate

  • (there are lots of ORM tools, but we mainly discussed NHibernate)
  • O/R-M: match objects to database stuff
  • Reflection-based schmutzer (serializer)
  • lazy vs. eager evaluation (either way can run into problems with memory issues for eager and db/network overhead for lazy)
  • Is it worth the price (saved dev time) for not being able to decide when to fetch data
  • question of how deeply coupled (at some point you have to be coupled)
  • is it too chatty? Will it scale?
  • prefer pulling more data (overhead of making calls to db can be costly)

C-omega

  • Microsoft research project
  • elevate relational concepts to the language
  • compiler support
  • ORM need not apply
  • when you gen the code, the types are created

Overall, it was a good presentation. Not a lot of new stuff for me. Most of this I had already known from my previous research on NHibernate, but I picked up some tidbits that you can only get in a presentation/discussion format, and not just reading. C-omega looked pretty sweet, but anything like it in a production release is a long ways out.

The biggest thing I took away is that ORM's can be a big help, but be wary, they're not perfect. If you own the database schema, and it's relatively straightforward (i.e. don't have to make seven joins to get your data), you can have good success with them. I'd say that matches up pretty well with my experience using NHibernate so far. For NetworthIQ, we'll have to revisit the scaling issue at some point, probably adding some profiling and doing some more performance testing. But, so far I'm pleased with it.

Saturday, September 03, 2005

And then there was silence.... (clearing Bloglines backlog)

For anyone who follows a significant number of blogs, especially in Bloglines, you probably start marking a lot of posts as new in order to come back to them later. I had a really bad habit of this, especially since the clipping feature is too cumbersome to use effectively. So, over the last couple of days, I've been cleaning them out, transferring a few to del.icio.us, but mostly just skimming and and clearing. Now, my feeds are all read. A rare sight indeed to have no new items, kind of refreshing. I'll be able to get through new items much more quickly now, without having to wade through the old stuff. And this time, no more marking as new. It either gets read, or goes to del.icio.us immediatlely for later reading.

Now, about that backlog in del.icio.us.... ahh, that's ok, at least I don't have to see it every time I get online like I do with Bloglines.

Thursday, September 01, 2005

YAB (Yet another blog)

I know, I know, real original subject there. Oh well, it's all I could come up with.

It's time to throw my hat into the blogosphere. I've been in the stands for too long. Though i've been blogging for a month or so for NetworthIQ (and blog), it's time for a personal/technical blog. I'm using blogger because I'm cheap and I don't want to pay for hosting (what else would you expect from someone working on a personal finance app), plus they have awesome templates (I'm a big fan of Dan Cederholm, Doug Bowman, and Dave Shea).

So, what's this blog about you ask? Well, from the title you probably guessed something about the web. You're right. I have a passion for the web, and web development, so I will primarily focus on those topics. My interests in the web are wide ranging, from the front end to the back and everything in-between (entrepreneurship, marketing, project management, etc.). I'll also probably throw in a dash of personal stuff, maybe some personal finance posts, the periodic political ramble, and the occaisonal sports rant (Go Ducks!).