The conception, birth, and first steps of an application named Charlie

Subscribe: Atom or RSS

The Practical Man

by Alister Jones (SomeNewKid)

A few moons ago, I was unsure of how to start Charlie. Fortunately, by working my way through Cuyahoga, I gained the inspiration I needed to move forward. As this new moon shows its face, I need a guide to what ASP.NET version 2.0 can contribute to Charlie. For this reason I am working through the Wilson WebPortal in precisely the same way that I worked through Cuyahoga: by rebuilding it from scratch. Once I have learned the best bits of ASP.NET version 2.0 and the best bits of the Wilson WebPortal, I will determine how I can combine those strengths with the strengths of Charlie. In doing so, I hope to simultaneously overcome the major weakness of Charlie: that I’m creating everything from scratch.

The Wilson WebPortal is free to use, but its source is available only to those who subscribe to WilsonDotNet.com. I cannot then show any code on this weblog, but I’d definitely like to talk about some of the lessons I am learning by working through its code.

The first lesson is actually about Paul himself: he is so darn practical. Way back when ASP.NET was new, many developers complained about the time needed to serve the first webpage request after a period of website inactivity. ASP.NET was designed to unload applications that had not been active for a while. The problem was that websites without constant traffic would unload, and the next visitor would experience a slow-loading first page. Rather than complain about the problem, Paul took the more practical approach of solving the problem. He introduced what amounted to an alarm clock for an ASP.NET application, that would keep waking the app up before it had the chance to fall back to sleep. Naturally, the Wilson WebPortal includes this alarm clock.

As I started working through the Wilson WebPortal, I came across the following comments introducing a custom Cache class:

// I use my own cache instead of HttpRuntime.Cache to better control lifetime.
// My experience on shared hosts is that HttpRuntime.Cache drops far too often.
// So this is intended to be a major performance win, although it may look odd.

This is so practical. How many of us would simply use HttpRuntime.Cache without giving it a second thought? And how many of us would then curse about our website still being slow even though we were using the built-in cache? With its whitespace removed, the code for Paul’s custom cache is about 50 lines. In my opinion, it is this sort of practicality and simplicity that distinguishes Paul from most other developers. He’s a practical man.

Another area where Paul puts practicality first is in the design of his business objects. Every single business object in Charlie is based on the five-part Entity System. The benefit is the simplicity of each class taking on a single responsibility. The penality is the complexity involved in maintaining a large number of classes and the means by which those classes communicate. Paul takes precisely the opposite approach. A business object is represented by a single class. The benefit is the simplicity of having one “class in charge”—everything to do with the user is in the User class, everything to do with the portal is in the Portal class, and so on. The penality is that these single classes are relatively complex, as they take on numerous responsibilities. I asked Paul about this on his own website, so you can read Paul’s own rationale: About the responsibilities of the classes in Wilson.WebPortal.Core. The architects can argue about the merits of a class-in-charge design, but what cannot be denied is the resulting simplicity and practicality that the design achieves. Paul also refers to the utility of this design in the context of ASP.NET 2.0 providers. I haven’t yet come to terms with providers, so I cannot yet see the connection—but I’ll get there.

Right now, Charlie is not too far behind the capabilities of the Wilson WebPortal. But what the Wilson WebPortal does, that Charlie does not, is stay true to the design of ASP.NET version 2.0. I feel sure that this is a major strength of the Wilson WebPortal, and a major weakness of Charlie. I haven’t yet decided what to do to address this weakness (if anything), because I’m still working my way through the Wilson WebPortal as a step towards learning the best bits of ASP.NET 2.0.

by Alister Jones | Next up: The Magician and the Teacher

0 comments

----