Where’s your database’s ER Diagram?

I was recently training a new software developer, explaining the joys of three-tier architecture and the importance of the proper black-box encapsulation, when the subject switched to database design and ER diagrams. For those unfamiliar with the subject, entity-relationship diagrams, or ER diagrams for short, are a visual technique for modelling entities, aka tables in relational databases, and the relationships between the entities, such as foreign key constraints, 1-to-many relationships, etc. Below is a sample of such a diagram.


I. The Theory

Like many enterprise technologies, ER diagrams can be a bit of an overkill in single-developer projects, but come in handy as soon as you need to explain your design decisions to a room full of people. Since a software application is only as flexible as its underlying database, ER diagrams help define the initial set of business rules for how people will be able to interact with the system. As a software development practice, they are often encouraged, but in medium to large companies, they may be absolutely required. There are enough tools now to create ER diagrams quickly and easily, many of which will generate SQL database creation statements for a variety of platforms directly.

II. The Practice

Due to tight time constraints and ever-expanding scope creep, I find most developers skip creating or maintaining ER diagrams whenever the opportunity arises. One telling example of this is a developer who creates a diagram, starts building the application, and realizes their initial diagram was completely flawed. Given that they are now behind schedule because they made mistakes in modelling the data, they do not have time to go back an update the model, and their ER diagram becomes a distant memory compared to the final database. Most managers would rather see finished software products than accurate diagrams, although will take both if offered.

ER diagrams are incredibly useful in the early stages of designing a new application, but as an experienced software developer, I spend more time enhancing and maintaining databases than I do creating them from scratch. Furthermore, it can be difficult to create an ER diagram for an existing database, especially if you were not involved in its creation. Even when companies do maintain ER diagrams, they tend to be months, often years, out of date, as it can be difficult to motivate each and every software developer to update the database documentation after making a change.

III. Where’s your database’s ER Diagram?

What about your software application? Is there now or was there ever an ER diagram for your company’s database? Is it 100% accurate to the current production database? I’d like to hear from other developers to find out if people are diligently maintaining ER diagrams, or if it is really a common practice to let them fall by the wayside after a database is established.

Wikipedia SOPA Protest Easy Workaround

After hearing all the media buzz around Google and Wikipedia protesting SOPA, I expected to go to Wikipedia’s website and see the entire website disabled. To my surprise, the Wikipedia worked just fine for me this morning. I asked friends and colleagues if they could access Wikipedia and they could not. Then I realized the reason… I use a JavaScript blocker that requires me to enable JavaScript per-site and Wikipedia’s block amounts to a post-load JavaScript hack. Simple and easy to implement, but also easy to defeat.

If you want to continue using Wikipedia today, install a JavaScript blocker into your browser and set it to block anything from “wikimedia.org”. In Firefox, I recommend NoScript and in Google Chrome I recommend NotScripts.

I fully support Google and Wikipedia in their efforts to block SOPA. I just found it interesting that Wikipedia’s block implementation was so trivial, anyone could get around it and access the website as normal. Once you finally do enable JavaScript the page looks like this:

Google Abandons Maps for Adobe Flash/Air

On September 2, 2011, Google announced it was deprecating the Google Maps API and actively encouraging users to migrate to JavaScript Maps API v3. While abandoning support for the Flash API comes as a bit of a shock, it is not completely unexpected, as Google has not released an update for the API in the last year and support for issues related to the Adobe Air version had deteriorated. As a silver lining, Google’s depreciation policy indicates the product will continue to function for three years until September of 2014.


Disappointed with Adobe

As JavaScript has radically evolved over the last few years, it is understandable that Google wants to settle on a single, browser-independent platform for its Google Maps API. In fact, the more I ponder the loss of Google Maps on the Flash/Air platforms, the more I am disappointed with Adobe for the current Flash situation. Following the release of Flash Builder 4, Adobe decided to take Flex in a different direction, one I objected to in my review of Flash Builder 4, focusing more on wooing designers than developers with its new skinning interface. In fact, prior to Flash Builder 4, I encouraged Java developers to learn Flex given the similarities in syntax and the richer user interface than Swing/JavaFX. These days, I do not encourage anyone to learn Flex, as the current API is erratic and future of Flash/Air is unknown.

The Future(?) of Adobe Flash and Adobe Air

The loss of Google Maps for Flash/Air feels like another nail in the coffin for Adobe Flash. Flex developers may recall that Adobe launched Air more than three years ago as a stand-alone Flash application platform. Adobe Air provides a run-time environment, similar to the Java JRE, that offers developers a richer feature set and more customization than a standard web-based Flash application allows. Unfortunately, with the growing mobile market, Adobe has virtually abandoned all efforts to market the Adobe Air platform. In fact, I can count on one finger the number of individuals, myself included, who I know have the Adobe Air runtime installed.

Final Thoughts

The last few years has seen the rise of mobile platforms in a big way, so much so that proprietary web platforms like Flash, Silverlight, and others have fallen by the wayside. I think Adobe’s biggest mistake regarding Flash in the last few years was in not actively pushing Adobe Air as a general purpose platform. Despite adding a number of Flash-specific features in the latest CS5.5 release, Adobe has not done a lot to encourage developers to stick with the platform. The loss of Google Maps for Flash may be just one in a series of events that leads to the end of the Flash platform as we know it.