Saturday, December 29, 2007

Some major design themes from around the web

I'm new to the field of web development, and I've been learning a lot by reading articles and blogs by those who seem to be leaders in the field. What I've found is that there are correct ways and incorrect ways to apply the technology that's available. Here's what I've learned so far.

It is imperative to separate content and style. This refers to HTML (the content) and CSS (the style). In the early days of the internet, content was simple, consisting entirely of text. When graphics-based browsers came out (Netscape (RIP) with the first major browser in 1993), there had to be a way to tell the browser how to display the text, hence HTML (hypertext markup language) was used to "mark up" the text for the browser, telling it how to display different elements. As things got more advanced, this ran into serious problems, so CSS (cascading style sheets) came along. The idea now is that HTML marks up the content (but doesn't tell the browser how to handle that content), and CSS defines how the marked-up content looks.

Use AJAX to streamline the user experience. AJAX stands for Asynchronous JavaScript And XML. It's a method of allowing a web page to request information from a server and insert that information into the web page without requiring a full refresh. This allows a user to click on objects, open sub-trees, and otherwise call information without reloading a page. This makes a web page more like an installed computer application, and less like a traditional web page.

Use a PHP framework to separate models, views, and controls. This is just like separating content and style, but on a deeper level. The model refers to the structure of the code, the view refers to how the page renders, and the controls refer to the actual commands that are within the code. Separating these three elements into distinct layers (and into their own documents in their own folders) allows an application to grow while maintaining a clean code base. However, it's a complicated process, and is best suited for very large web sites. I guess I need to make a detailed plan of each page of my own site before I can decide whether or not to use this method. If I do use, there are many frameworks to choose from (in addition to coding my own, which is way beyond me right now): Symfony, CakePHP, and Zend. Symfony appears to have the most complete documentation as now (including a published book), CakePHP I successfully installed, and Zend is probably great too. All the message boards I perused seem to agree that no one framework is better than any other. Use to taste.

Speaking of frameworks, what about Ruby on Rails? RoR uses the Ruby programming language, extant since 1993 but only exploding in popularity today. As far as I know, the language is entirely object oriented, which PHP is not. PHP5 supports object oriented programming, but doesn't force it on you. Those who use Ruby (the language) and Ruby on Rails (the framework) tend to proselytize like Mac users. They say it's the greatest programming language in the world, but unfortunately it's untested (at least compared to PHP). RoR espouses the MVC framework, just like CakePHP and other PHP frameworks, so I'll stick with PHP instead of learning another programming language. Ruby and RoR seem to be great, and I look forward to using them someday. Just not for this project.

How many languages must I learn?

When I started this project, it seemed like the LAMP stack of applications was the best solution, but it's not the only one. Since I'm new to programming, I don't have a preference for any language, and I carry no bias for one or another, so it's important to me to spend enough time choosing the right one for the job. Right now it looks like I have to learn

  • SQL (Structured Query Languange) for MySQL, the database application.
  • PHP (Php: Hyertext Pre-processor) to communicate with that database
  • HTML (HyperText Markup Language) to correctly mark up the content of the finished web pages
  • CSS (Cascadding Style Sheets) to control the design of the finished HTML pages
  • JavaScript to provide client-side scripting and to make use of AJAX
  • XML (eXtensible Markup Language) to move data from the database to the web page
What a job. HTML is the easiest (it's not even a language, just markup), but the others will require diligence and study.

What will I use to build this application?

The application will be constructed using what is commonly called the LAMP stack, which refers to Linux, Apache, MySQL, and PHP.

Linux is an operating system that is commonly used by servers. Servers host the web sites (including this blog) that make up the world wide web. When the application is finished and ready to deploy, I will have to choose a commercial company to host it, and their servers may or may not run Linux, but that doesn't affect the design of the application, and I don't ever have to deal with Linux. The LAMP stack could be WAMP (with Windows), but for the sake of simplicity I'm just assuming it will be Linux.

Apache is a web server. It's actually a piece of software that enables a physical computer to "serve" web pages. Apache takes a raw HTML file from the server, reads the code, and outputs a finished web page to the client (the end user - you.) For development purposes, I've installed Apache 2.2.6 on my computer, so that I can view the output of my own code without having to upload it to a commercial server and then access it over the internet. This speeds the development cycle. Once installed (on the commercial server or on my own computer) it requires little or no upkeep, so Apache doesn't constitute a large portion of my application's development.

MySQL is a database engine that will store the discography information itself. MySQL is freely available, but also comes as a commercial application (MySQL Enterprise) supported by MySQL AB, the company that owns the code. I will be using the Community version, which is free to download and use. MySQL won't be visible to the end-user, but will run in the background. MySQL, like other databases, uses Structured Query Language (SQL), and is complicated enough to warrant its own future posts. Stay tuned. I am using MySQL Community Server 5.0.

PHP is another language that is commonly used as a translator between the front-end (the part of the application that the user actually sees) and the MySQL database. It's a completely separate and very complicated (and powerful) programming language. PHP is a server-side language, meaning it gives commands to the server, which executes those commands and then sends them back to the client. This is the opposite of JavaScript, whose commands are executed by a locally installed version of Java, and then sent to the web browser. PHP stands for PHP: Hypertext Pre-processor. I am using PHP 5.0.

Each of these applications is free to download and use, which has made the LAMP stack the one of the most popular ways to build and host web sites.

Wednesday, December 26, 2007

A discogra...what?

I'm going to build a discographical database. Discographical information pertains to the who, what, where, and when of, in this case, jazz albums. For example, take the (arguably) most famous jazz album of all time, Miles Davis's Kind of Blue. The discography entry for this album would be something like the following:
Miles Davis (trumpet) Cannonball Adderley (alto sax) John Coltrane (tenor sax) Wynton Kelly (piano -1,2) Bill Evans (piano -3) Paul Chambers (bass) Jimmy Cobb (drums)

Columbia 30th Street Studios, New York City, NY, March 2, 1959


1. CO62290-3 Freddie Freeloader (false start) Mosaic MQ9-191
2. CO62290-4 Freddie Freeloader Columbia CL 1355
3. CO62291-3 So What -
4. CO62292-5 Blue In Green -

From the discographical entry, you can see who all the players were and what they played, and you can see it was recorded on March 2nd, 1959, in New York City at Columbia's 30th street studios. You can see that on this date at this location two tunes were recorded - "Freddie Freeloader" and "So What" - and that "Freddie Freeloader" was recorded twice. You can also see that the first recording of "Freddie Freeloader" is available on an album put out by the Mosaic record label, and that that album has the identification number MQ9-191. The second recording of "Freddie Freeloader" is available on an album put out by Columbia, which you could find by looking for CL 1355, and so on.

A veteran user of discographies would also be able to tell by looking at the issue numbers (CL 1355, for example) what kind of physical media the number represents, such as a CD or LP, and he would also be interested in the matrix number (CO62291-3 for "So What"). For an extended discussion of matrix numbers and their importance to the field of discography, see Howard S. Friedman's excellent paper on the subject.

You may have noticed that the discography entry for Kind of Blue only includes two tunes, which would make for a rather short album. What about "Flamenco Sketches," "All Blues," rest of the tunes that made this album so famous? Those were recorded on a different date, at another "session," so they require a separate entry in the discography.

Miles Davis (trumpet) Cannonball Adderley (alto sax) John Coltrane (tenor sax) Bill Evans (piano) Paul Chambers (bass) Jimmy Cobb (drums)

Columbia 30th Street Studios, New York City, NY, March 2, 1959


1. CO62293-1 Flamenco Sketches (alternate take) Columbia C5X 45000
2. Miles Davis comments Mosaic MQ9-191
3. CO62293-6 Flamenco Sketches Columbia CL 1355
4. CO62294-1 All Blues -
Now we have another album, Columbia C5X 45000, and another track (the alternate take of Flamenco Sketches) that doesn't appear on the original Kind of Blue. As you can see, none of the albums currently available actually give a complete picture of either of the two sessions that produced Kind of Blue. This is why accurate discographies are so important.

According to the New Grove Music Encyclopedia, discography is

The systematic cataloguing of sound recordings. Data for listings, in which aspects of the physical characteristics, provenance, and contents of sound recordings are described, are acquired from the recordings themselves (with their containers and any accompanying written and iconographic materials), as well as from logbooks, lists, and catalogues compiled by the record producer or manufacturer, journals and other printed materials, and oral sources.


A very basic discography will include:

  • Name of leader or group
  • Date and place of recording
  • Musicians and their instruments
  • The titles of the tunes
  • Album issue number
  • Album recording label

A more complete discography will include, where applicable, matrix numbers, take numbers, and an exhaustive list of albums on which each take appears. Accurate information about recorded performances is essential in jazz, where recordings - rather than scores or sheet music - are the principal sources for study.

Tuesday, December 25, 2007

Ready....go!

I am going to design, build, and make available a database of discographical information intended for jazz researchers. I am a computer "power-user," but I have no programming or coding experience beyond some basic HTML. With this blog I will track my progress in learning the skills I need, implimenting those skills in the design of the site, and overcoming what obstacles are sure to arise. I intend to use the LAMP stack for this database: Linux, Apache, MySQL, and PHP.