Archive for the ‘Web Development’ Category

Book Review: ASP.NET 3.5 Application Architecture and Design

Friday, January 29th, 2010

This review is part of a series of book reviews I have agreed to do for Packt Publishing. I am not being paid for this review, although I did receive a free copy of the book. I do not work for either Packt Publishing or Microsoft.

ASP.NET 3.5 Application Architecture and Design was written by Vivek Thakur and published in 2008.

Who This Book is For

This book is intended for developers who have “basic understanding of the ASP.NET framework, and programming knowledge of either C# or VB.NET”, although it looks to me as if every example is written with C#. The word basic is a relative term, but Vivek seems to use it accurately – you don’t need to know that much about ASP.NET in order to comprehend this book.

Furthermore, Vivek states that “if reading about application architecture usually confuses you or sends you to sleep, then this book will be perfect for you!” He’s not lying. Vivek does an outstanding job explaining complicated concepts using everyday analogies.

Getting Started

Vivek starts the book by introducing the reader to the world of software architecture. He uses the analogy of an automobile company, where mechanical engineers, design engineers and the assembly line staff all have clearly defined roles – roles separated from each other for a variety of reasons. Vivek equates this process to that of the software “project life cycle”, and then moves into a discussion on software tiers and layers.

From there Vivek dives into n-Tier software architecture, giving some great examples along the way. I loved his approach to this topic because he starts at the beginning (a 1 Tier, 1 Layer application) and moves step-by-step towards a fully n-Tier application (his example uses 6 Tiers). The author also sticks to the same example (an order management system, or OMS) which helps the reader easily understand how a 1 Tier application is different from a 4 Tier.

I also really appreciated Vivek’s instruction on how to add new class libraries to Visual Studio. For readers who aren’t well versed in VS, this is definitely something useful.

Lastly, I thought it was a great idea to introduce the concepts of Data Transfer Objects (DTOs), Lazy Loading and distributing assemblies across multiple machines. Vivek’s explanations of each subject were clear and concise – perfect for readers with only “basic understanding of the ASP.NET framework.”

Moving On

About halfway into the book, the author moves into discussions of MVC and SOA design patterns. The only thing I really didn’t like was the introduction of the Windows Communication Foundation (WCF) in chapter 7, and that’s because Vivek only spent 4 pages on the subject. WCF is also the only .NET-specific topic in the entire book; I understand why it was introduced, but it felt rushed and (as someone who isn’t an expert ASP.NET developer) I didn’t get much out of it.

On the other hand, I really enjoyed Chapter 8 (Database Design). Vivek’s conceptualization of the domain model vs. the logical data model is spot-on, and I would recommend that any developer looking to build a database read it. I particularly liked the author’s example on page 197 for data normalization: who knew that the members of Metallica wrote books on ASP.NET? Sweet!

The Final Verdict

I definitely enjoyed reading ASP.NET 3.5 Application Architecture and Design. Overall, I think I would say that anyone interested in software architecture and design (regardless of the language used in development) could get a lot out of this book, minus a handful of exceptions (see my comment on WCF above).

Nice job Vivek!

JavaScript Tabs: ExtCore vs jQuery UI

Thursday, January 21st, 2010

A while back, I built a website for a client using jQuery 1.3 because I needed a slide-show widget for the homepage. More recently I’ve been using ExtCore for small website widgets – mainly because I’m a bigger fan of ExtJS than jQuery. (ExtCore also didn’t exist at the time I built that website).

Long story short, this particular client (a restaurant) asked me to add some new content to their menu. Rather than expecting the user to scroll down a lengthy list of mouthwatering lunch options, I suggested that we add tabs to the menu in order to logically separate the menu items.

Since I already had jQuery 1.3 running the slide-show on this website I simply decided to build the menu tabs in jQuery to maintain consistency. But I was suddenly struck by an idea: why not compare how ExtCore and jQuery UI create tabs from HTML markup!

ExtCore

ExtCore can be downloaded from the ExtJS website, and an online demo of the simple tabs can be seen here.

The first step to building tabs from HTML markup using ExtCore is to reference ext-core.js in your page header. You also need to include the tabs.css file and the “images” folder containing the necessary 5 background images. (These can be found under “/examples/tabs/” of your ExtCore download ZIP.)

Note: I’m using ExtCore 3.0, although I believe 3.1 is available for download.

Next, we need to add the appropriate HTML markup for our tabs. Here’s a quick example.

ExtCore HTML Markup

As you can see from the picture above, ExtCore takes a wrapping DIV element (class “tab_container”) and converts a nested unordered list into the tabs. Subsequent child DIV elements contain the markup for each tab’s content. (The source code in this example is taken directly from the ExtCore tab example.)

The only thing to notice is that each DIV element has a CSS class assigned to it – these classes are essential to proper tab theming. The DOM ID properties are used to click back-and-forth between tabs.

Lastly, you need to include a JavaScript snippet which converts your HTML markup into a fancy tabbed widget:

ExtCore JavaScript Code

jQuery UI

jQuery UI has a tab widget which is dependant on the larger jQuery library. An online demo of their tab widget can be seen here.

The first step to using tabbed content with jQuery is to reference:

  • jquery-1.3.2.min.js
  • jquery-ui-1.7.2.min.js

Your file versions may differ (I think jQuery 1.4 was just released), but these are the versions I’m using. I’m also using the “smoothness” theme – for some reason jQuery UI would not allow me to download the package without specifying a theme. (That may affect my analysis for speed in the next section.)

You will also need to include the CSS file and images folder included with your download of jQuery UI. In my case, it’s jquery-ui-1.7.2.css and an “images” folder containing 13 background images.

Next, write your HTML markup:

jQuery HTML Markup

Compared to ExtCore, jQuery UI expects less HTML markup as we lose several layers of nested DIV elements. The most obvious difference between jQuery UI and ExtCore is probably that jQuery UI doesn’t need the extra CSS classes applied to the DIV elements.

Next, we add our JavaScript snippet:

jQuery JavaScript Code

Again, jQuery UI expects less code to generate the tabbed widget.

A Deeper Look

Let’s take a look at the file sizes for each library. This is about as un-scientific a study as it can get; I’m using Firebug’s “Net” tab to grab file size and download speed numbers. These numbers will probably be different for you because of any number of factors… but you get the idea.

As I already mentioned, ExtCore requires 1 JavaScript file, 1 CSS file and only 5 background images:

  • ext-core.js (78.9 KB, 156ms)
  • Ext.tabs.css (1.3 KB, 147ms)
  • 5 png files (2.8-2.9 KB each, average 107ms)

Combing the file sizes and their download times (on my home network), you get a total of roughly 94.7 KB taking 838ms.

jQuery UI requires 2 JavaScript files, 1 CSS file and 13 background images (again, with the “smoothness” theme):

  • jquery-1.3.2.min.js (55.9 KB, 116ms)
  • jquery-ui-1.7.2.min.js (188.1 KB, 221ms)
  • 13 png files (22.3 KB total*)

*Something interesting I noticed about the jQuery UI tabs is that my page only seemed to load 5 of the 13 background images, totaling something like 605 bytes and a total of 684ms. Perhaps someone more familiar with jQuery can explain that to me… I didn’t dig deep enough to figure out what was going on, but I’ll base my total on what Firebug says. I’m guessing that I’m not using all of the CSS background images for this theme.

Overall, that brings jQuery UI tabs to a total of roughly 245 KB taking 1021ms.

What Does That Even Mean?

According to my inaccurate, quasi-scientific study it appears that ExtCore requires slightly more code than jQuery UI. On the other hand, ExtCore also appears to be downloaded by my browser more quickly than jQuery UI. In reality, those numbers probably offset each other as the extra markup required by ExtCore increases the HTML file size. The fact that I’m using a theme on jQuery UI probably also has a slight impact on performance.

Which do I prefer?

In essence, both libraries create tabbed widgets from the same basic HTML markup – though the differences are significant enough that they’re not cross-compatible.

Judging both frameworks as they stand in my examples, I will say that I like the conciseness (is that a word?) of jQuery with regards to both HTML markup and JavaScript code. But I also like that ExtCore requires fewer files. As someone who uses the larger ExtJS framework a great deal, I’ll say that I am very likely to choose ExtCore over jQuery UI most days of the week.

Are there any ExtCore or jQuery UI users out there? What do you think?

Why Small Businesses Shoud Hire a Freelancer

Tuesday, January 12th, 2010

Although websites are the easiest way to attract new customers to your business, roughly half of the small businesses in our country do not have a website. That’s an amazing statistic considering how many people use the Internet to connect with friends and search for products/services in their local area.

Small Business Website Design

Over the past two years I have developed a number of websites for small businesses in my area. When I ask why they never had a website, the excuse I hear most frequently is that websites cost too much.

To be fair, many small business owners have a hard time finding the extra money to build a website — particularly nowadays with the bad economy.

So what are your options?

Option #1: Build the website yourself.

Domain names and web hosting are pretty cheap, and most personal computers come with do-it-yourself software. You own a business. Building a website can’t be that hard… right?

The problem with this approach is that you probably don’t know what you’re doing. Do you buy a Linux or Windows hosting plan? Do you need PHP or .NET support? Do you even know what HTML is?

Assuming you even get the website up and running… how can you be sure if it works in Internet Explorer, Firefox, Safari and every other web browser?

More importantly – will it look professional? Your customers will judge your business when viewing your website, so you definitely want to make a good impression.

Option #2: Contact a web design firm.

Web design firms obviously have the resources and experience to build your website. The problem is that they’re expensive. (Can you afford to spend $5000 or more right now? I definitely can’t.)

Web design firms have to charge higher prices in order to cover their operating costs (salaries, benefits, utilities, etc). They will also try to sell you features or services you don’t need; things like Flash intros, Search Engine Optimization, and a slew of other things. They’ll even charge monthly maintenance fees on top of their development costs.

Although it’s true that those extra services are worth something (Search Engine Optimization helps your website appear at the top of the search engine listings), the fact is that most small businesses don’t really them. Will a cool Flash video on your homepage make your customers say “Wow”? Maybe. Will that video influence them to buy your product or service? The answer is almost certainly “no”.

Option #3: Hire a freelance developer.

Freelance developers are often the best choice to build a website for your small business. We have the necessary experience it takes to write the code and the knowledge to help you make informed decisions. Our prices are much more affordable than web design firms because we have virtually no financial overhead.

Some freelancers even accept bartered services… it’s win-win! (Note: be prepared to offer something worthwhile.)

Some things you should consider.

At this point, you’re probably leaning towards hiring a freelance developer. But if you’ve never worked with a freelancer before, there’s a few things you should know:

  • Freelancers won’t work for peanuts. Just because we charge less than design firms doesn’t mean you can get a quality website for $50. We are experts in our field, so expect to pay a fair price (or barter for equal services).
  • Freelancers don’t work for you 9-5. Many freelancers have regular jobs, so be prepared to meet with your freelancer on nights or weekends.

What are your thoughts?

In case you haven’t figured it out yet… I’m a freelance developer! I’d like to think that I’m not too biased, but I want to know what you think.

Have you ever worked as a freelancer? If so, what was your approach to working with small businesses?

Have you ever hired a freelancer? If so, what was your experience like?

10 Albums That Inspire Great Software

Thursday, December 31st, 2009

It’s no secret that computer nerds often have strong musical skills… which is odd given that music is processed by the human brain’s right hemisphere, while math/logic are processed in the left hemisphere*. This fact is also hard to explain as many of us geeks have awkward social/language skills (a right-hemisphere responsibility).

* So says Dr. Chudler at the University of Washington.

For example, there’s me (Art). I played guitar in a garage band back in high school. I majored in Music at Loyola University Chicago, studying classical guitar. I also minored in Computer Science, and I work as a professional software developer. Beyond my highly coordinated fingers (from typing and plucking strings), I don’t know if I see an immediate correlation between the two areas… but I’m not a neurologist, so I won’t even pretend to offer an explanation as to why I’m good at both. I wouldn’t say that I’m necessarily awkward with my social or language skills, but I would say that I’m a terrible salesperson. Make your own conclusion.

Furthermore, almost every developer I’ve met has a similar story. And in addition to playing some kind of musical instrument, we all seem to be very productive while listening to music.

I have found that a good song puts me into a focused groove – like something just clicks inside my brain and the code writes itself. Complicated concepts unwind into simple solutions as if I can suddenly think in multiple dimensions.

In other words, I start working like I’m f*cking Mozart. Only on a computer. And waaayyy less famous.

The caveat, of course, is that a song isn’t long enough to maintain productivity like this. An hour (give or take) is ideal to generate some solid code, so finding an entire album (with no crappy songs) is almost priceless.

After giving this topic a good deal of thought, I’ve come up with the ten albums which I enjoy the most while writing code. The list is in no particular order:


Strung Out on Kid A (Tallywood String Quartet)
Kid A is probably my favorite Radiohead album. One of the coolest things about Strung Out on Kid A is hearing the different keyboard and guitar layers played by a string quartet. There’s also a bunch of different albums to choose from! If you like classical music, buy one – you won’t be disappointed.

Swordfish (Soundtrack)
Oddly enough, I’m not really a fan of trance/techno music. And I’ve never seen this movie. But this CD rocks. Paul Oakenfold does some really, really cool stuff.

Dark Side of the Moon (Pink Floyd)
Dark Side of the Moon is obviously one of the classic Pink Floyd albums. Smooth, a bit jazzy, and each track melts into the next. Simply brilliant. I will say that this isn’t my favorite Pink Floyd Album (I would pick Animals every day of the week), but you can’t lose with this CD.

Three Snakes, One Charm (Black Crowes)
I’m a big Black Crowes fan, but I might be alone in saying that this is my favorite album. It’s less produced than Shake Your Money Maker, but cleaner than Amorica. If you’re into pure Rock-N-Roll, this album is hard to beat.

Legend (Bob Marley)
The best thing about Reggae music is that it forces you to be in a good mood. It’s scientifically proven. Legend may be a best-of album, but let’s be honest… it’s the single greatest Reggae album there will ever be.

The Fragile (Nine Inch Nails)
As a double CD, The Fragile is a fantastic album to play while writing code as you get more than 100 minutes of pure awesome. The Fragile is by far my favorite NIN album… a fact that few NIN fans seem to agree with. The thing I love most about this CD: I hear a new layer or instrument every time I listen to it.

This is War (30 Seconds to Mars)
I got this CD for Christmas this year and I love it. Say what you want to about Jared Leto (I liked him in Requiem for a Dream), I definitely suggest you give this album a shot. It’s a solid set of songs that get you pumped up – and nothing helps you write code more some adrenaline. (Actually, not true. Caffeine does a pretty nice job…)

Across a Wire: Live in New York City (Counting Crows)
This is actually the only Counting Crows album I own – but it’s a fantastic CD. It’s a live performance that starts with a few of the band members playing acoustic instruments, but progressively adds electric guitars, drums and other instruments. Check it out.

Unplugged (Alice in Chains)
You can’t go wrong with any of the MTV Unplugged albums (Nirvana, Eric Clapton, etc). Alice in Chains gives the listener a totally different spin on their music, and it’s very cool to hear Layne Staley’s voice over the acoustic guitars.

Mellon Collie and the Infinite Sadness (The Smashing Pumpkins)
This was a tough call for me, because I could have chosen any Pumpkins album to put on this list. Mellon Collie and the Infinite Sadness is a double CD with a ton of variation; the instruments, tempo and dynamics change constantly, but it’s fascinating to hear how all the songs work together.

This list is far from complete – but I’m sure many of you will disagree with my selections.

What are your thoughts? What albums would be on your own list?

2010: New Year’s Resolutions

Wednesday, December 30th, 2009

Wow, another year has come and gone. I feel like the past few months have just flown by… which is either really good or really bad depending on how you look at things.

As 2009 comes to a close, it’s a good time to look back and see how well we stuck to our New Year’s resolutions. Although I’m sure that I am not alone, I will be the first to stand up and say that (yet again) I’ve failed to complete all of my goals for this year.

This blog has been a very useful tool to document the accomplishments (and failures…) that I have achieved – and documenting my New Year’s resolutions is just another way to help myself stay focused on what I find important. I suppose “important” is somewhat of a relative term; it would seem that I am constantly shifting my focus towards some new goal. Priorities shift up and down on the list, but I suppose that’s just life.

So how did I do in 2009? According to my New Year’s resolutions for 2009, I guess I did alright:

  1. I did not learn Silverlight, and I’ll be honest and say that I probably won’t ever spend the time to learn it. I have come to terms with the fact that I’m a developer (NOT a designer) and thus Silverlight / Flash aren’t the best way to spend my time. I actually did sign up for a Flash class at the local community college, but it was cancelled due to low enrollment. I’m taking that as a sign from God.
  2. I did redesign my website! Although I did briefly attempt to create multiple sub-domains and online demos, I found that the redesign helped bring in some extra work. I never got around to the other details, but I’m not convinced that I even needed them.

The question now becomes: “What are my resolutions for 2010?

In 2010, I hope to:

  1. Double the amount of freelance work I generated in 2009. This will be achieved by: spending some money on local advertising, continued networking with local web development companies, and possibly creating an email newsletter when I have a large enough client base.
  2. Change my use of social media. I have already started to do this… but I want to use social media sites strictly as professional tools. I plan to limit my use of Twitter, LinkedIn and the wide variety of message boards I visit so that I only post professional (i.e. “useful”) content. Facebook is a notable exception – I like that it’s a network of friends, and I don’t want them all to think I’m a total square.
  3. Give at least two professional presentations. I spoke at an LCNUG meeting earlier this year and I attempted to create an ExtJS user group for the greater Chicago area. I won’t say that either presentation was amazing – and I know that I can do a bit better.
  4. Use more photos on my blog. Personally, I like blogs that have photos. I don’t know if you (i.e. my readers) actually care, so if you have an opinion definitely let me know.

If anyone else has suggestions for what you’d like to see me accomplish this year… I’m all ears!