- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
LINQ to My Domain
I've begun my foray into the world of LINQ, and in my investigation I've seen a lot of work based on the LINQ to SQL "design surface" available in Visual Studio 2008. It's a neat tool. I point it to my database, drag some tables over, and it infers my domain structure and relationships from the databases fields and keys. That's all well and good for a simple domain model that is directly related to the database schema. I could see using this for a quick prototype, or a really small application. I see three files created by the designer:
MyClasses.dbml - This looks like any ORM frameworks mapping file. It associates classes with tables, maps fields to object properties, and defines relationships.
<Table Name="dbo.Balloons" Member="Balloons"> <Type Name="Balloon"> <Column Name="BalloonId" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> <Column Name="Color" Type="System.String" DbType="NChar(20)" CanBeNull="true" /> <Association Name="Balloon_Kid" Member="Kid" OtherKey="KidId" Type="Kid" /> </Type> </Table>
MyClasses.dbml.layout - This looks to be specific to the layout of the design surface and appears to serve no purpose outside of this design.
MyClasses.designer.cs - This is the beast that I'm looking to replace. It contains the class definitions and attribute based mappings to bring my database schema into my application, and ready it for use by LINQ.
So this leaves me with a couple questions. One, why are attributes used to specify mappings? Can this be done strictly via XML? More importantly two, can I use my own domain model, and if so how do I map it to the database?
My goal would be to design a layered system, separating the underlying data store from the repositories required to push and pull my domain objects from these data stores. This would allow in memory implementations of the data store, and would make unit testing (and developing) a whole lot easier. I will be digging into this in the coming days and will report back soon. Stay tuned!
Restlet Ported to GWT
If you want to communicate with the server in GWT, you have GWT-RPC and you have JSON (and in fact a few different flavors of JSON). If, however, you pine for the elegance of a RESTful interface, you've had to roll your own.
Now the folks at the Restlet project have ported the Restlet API to GWT.
Thanks to the support for generics in GWT 1.5 RC1, we were able to achieve this port with reduced efforts and limited troubles. We had to get rid of the server-side features that don’t make sense in a browser, and of the APIs like NIO and logging that aren’t emulated by GWT. The major impact was the adaptation of the API to the asynchronous communication imposed by AJAX and GWT.
So now you can make much easier use of RESTful back ends. If you've been working with Rails or Grails, you won't have to ask why RESTful backends are good. If you want a quick intro to Restlets, see this quickstart.
Getting Started with Facebooker
Developing for the Facebook platform can be a big headache, and on Rails your headaches are unfortunately compounded from the get-go. While the otherwise-inferior PHP users get an API library from the Facebook development team (I'm kidding, I love you PHP guys), on Rails we have to deal with gems that aren't even at version 1.0 yet. While Facebooker is quite good at this point, its documentation covers a rather sparse selection of its impressive feature set, and RFacebook, which is better documented, hasn't been updated in aeons and is way more difficult to use besides. And unfortunately the standard Facebooker tutorial doesn't include the newest features from the recent Facebook profile overhaul or even all the necessary steps to get a new Rails application running on Facebook. So, enter Josh.
In this blog post I'll tell you the best way to integrate Facebooker into a new Rails project so you can start developing social networking applications quickly and easily, and how to hook them in to Facebook's new profile plan. The goal is that by the end of this post you'll have a totally working Facebooker Rails application and you'll understand how to develop in it at least a little bit.
Topics: Facebook, Ruby on Rails
Book review: “JavaScript: The Good Parts” by Crockford
I heart David Flanagan. I'm making my way through "The Ruby Programming Language" this summer. Its exhaustiveness really satisfies. But a decade ago, my programming Bible was Flanagan's "JavaScript: The Definitive Guide". As I transitioned from a career in content to a career in code, "the Rhino book" taught me everything I needed to know about object-oriented JavaScript, DOM scripting and the other building blocks of today's Ajax landscape. I've bought a hard copy of each of the book's five editions. It remained, until recently, the only JavaScript book I'd recommend.
That all changed with the recent publication of "JavaScript: The Good Parts" by Yahoo's Douglas Crockford. Crockford probably needs no introduction. His incisive website and frequent blog posts have championed JavaScript's power and potential while calling out its drawbacks and frequent misuse. Now, with "JavaScript: The Good Parts," he has managed to provide a reference as useful for JavaScript pros as it is for novices. Part language primer, part apologia and part critique, Crockford's book draws from and extends many of his long-gestating themes about how to use JavaScript - and how not to use it.
Topics: Ajax, Javascript
ADO.NET Entity Framework
ADO.NET Entity Framework is an object relationship mapping (ORM) tool. It was designed to provide a layer of abstraction between the logical schema and concept schema of an application, and to decrease the amount code need for a data centric application.
Some benefits of the Entity framework:
- Data storage engine and schema independence: Due to the layer of abstraction between the logical and conceptual schema of your application, you no-longer need to know and hard cord the application to a specific data storage engine or schema.
- More expressive conceptual model: Entity types can inherit from other entity types and allows the creation of more complex types in addition to the standard scalar types support by the database.
- Access to multiple database system: Because the application is free from hard code data storage dependencies, the developer has the ability to access data from multiple storages using a consistent application object model
- LINQ: Language Integrated query support that offers compile time syntax checking for queries against the conceptual model.
The Entity Framework works by allow the developers to hand code or use code generation tools to create the XML metadata for the conceptual entity data model, a storage entity model, and a mapping specification between the two. The XML file created for the conceptual entity data model is then stored in the conceptual schema definition file (.csdl), the storage entity model is stored in the storage schema definition file (.ssdl), and mapping between the two in the mapping specification language file (.msl). These XML file are then loaded into the metadata workspace of the entity framework, and a set of classes are generated to allow the developer to work directly with the conceptual model and indirectly with the logical model.

Figure: ADO.NET Entity Framework Architecture
So with these benefits design and built directly into the the framework and the logical approach used by framework to interact with various data providers, some experts in entity-based applications and software architectures on the .NET platform still feel that the framework has some pretty large deficiencies.
They are concerned that the framework is...
- Inordinate focus on the data aspect of entities leads to degraded entity architectures
- Excess code needed to deal with lack of lazy loading
- Share, canonical model contradicts software best practices
- Lack of persistence ignorance causes business logic to be harder to read, write, and modify, causing development and maintenance costs to increase at an exaggerated rate.
- Excessive merge conflicts with source control in team environments.
Are these claim valid concerns to consider?
Sure, only if the framework is mature with several versions under its belt and its prohibits the productivity, maintainability and scalability of the application.
Isn't the right approach to software development to deliver a subset of the full feature set right the first time than try to deliver everything at once with massive issues that prevent the usability of the tool?
You decide...
Below are some useful references to get you going with Entity Framework.
Achieve Flexible Data Modeling With the Entity Framework
ADO.NET Entity Framework Pre-release documents
Microsoft ADO.NET Entity Framework Overview
ADO.NET Entity Framework Taking Some Heat
Programming Against the ADO.NET Entity Framework
ADO .NET Entity Framework Vote of No Confidence
Google Calendar: Finally, a search box that makes sense
I've been complaining for months about a usability problem with Google Calendar's default search behavior, so I figure I should document that it's finally been fixed. Ever since gCal introduced the concept of public calendars, hitting "enter" in the global search box has kicked off a trawl through the public-calendar database. Instead of searching MY OWN calendar for, say, my Aunt Donna's birthday, gCal instead searches public calendars of, like, sports schedules and Kazakhstanian bank holidays. Smart.
Now, though, that behavior seems to have been flipped. "Search My Calendars" is now the default action, while "Search Public Calendars" has become the secondary action. Bravo!
Topics: Google, Google calendar, Usability, user experience design
Project Website Part 4: Drag and Drop in jQuery

Drag and drop is like those Nutty Bars snack things.
Allow me to explain.
I like Nutty Bars. But I never expect to like them. They are kind of funny looking, for one thing, what with that weird criss-cross pattern on the top, and the chocolate never quite covering the wafers. But when I get past that and actually eat one, it's actually kind of tasty.
Which brings me to drag and drop. Which I always expect is going to be an overwhelming pain in the neck (probably based on bad experiences using Java Swing). But whenever I manage to get over it and actually implement a web drag and drop, I'm always surprised at how easy it is using an Ajax framework.
jQuery is no exception.
Topics: Javascript, jQuery, Project Website, Ruby on Rails
The App Store, iPhone, and You

Kind of an interesting day in iPhone development land. Among the stories that crossed in front of my eyeballs today,
- The first popular application to get bounced from the App Store for cause. (The game Aurora Feint could send your contact list out over the Internet in plain text. This appears to have been more in the line of an overenthusiastic developer error than a malicious ever overlord, so hopefully they'll be able to get back in the store.)
- Update, Friday Morning Looks like Aurora Feint is back on the App Store with their update this morning. (In fact, Apple seems to have released a lot of updates overnight.) So, good for that, that's pretty close to how the process should work.
- The first open source iPhone project that I am aware of, WordPress
- The second open source iPhone project that I am aware of, Box Office
- Word that Apple is seeding a beta of the 2.1 firmware and SDK to paid developers.
- The possibility that the 2.1 SDK might lift the NDA that has prevented developers from discussing the development kit publicly.
I'm particularly excited by the release of the source code projects. So far, developing for the iPhone has resembled walking blindfold through a booby-trapped Indiana Jones cave, and seeing the source for successful projects can only help wandering developers.
Really, it's amazing that any successful software made it to the App Store launch given the limitations imposed on beta SDK development -- a tribute to some amazing developer work.
Which takes us to the murky world of Apple's NDA and the general air of mystery that Apple has placed over the entire process. The Aurora Feint team says that Apple has never contacted them over the status of their app. Some users report the app was deleted from their phones during a sync, others (like me) still have it. Many developers have posted updates to Apple with no clear idea when they will get posted to the App store. Dave Thomas posted about the trouble they are having writing iPhone SDK-related books.
I don't want this to be a rant -- the App store is full of amazing work, but for the benefit of the current developers, new developers, and the users who are coming to depend on this software platform, it's time to open up the lines of communication and let a developer community form.
Topics: iPhone
Multiple Column Sorting with Drag and Drop using Scriptaculous
The other day I wanted to do drag and drop between multiple columns using scriptaculous. Allowing this behavior is extremely simple, but out of the box the interaction feels clunky. Here, we'll be going through an example of how to do multi-column drag and drop with scriptaculous.
Enabling multi-column drag and drop just involves setting a single option, but without setting a few other options the dragging will feel jittery and won't allow us to drop on empty areas. Also, interaction with the server will require a small bit of consideration to support persistence of any changes.
Topics: Javascript, Ruby on Rails, Scriptaculous
Five jQuery plugins that are a joy to use
Yesterday I discussed how to separate the jQuery plugin wheat from the chaff. Today, I offer a completely subjective and biased list of jQuery plugins to know and love.
Topics: Ajax, Javascript, jQuery, plugin
Visualizing Your Database Schema Entirely in Rails
I was recently looking into a tool to visualize the schema in a rails app, and found mostly windows only solutions. Some of these included two steps: one to convert your schema into another format (usually XML) and another step which included using a windows only executable to convert that into a diagram.
However, among these I found an interesting plugin which would allow you to not only view your schema live in your application, but also to make changes to it.
Topics: Ruby on Rails
jQuery plugins: Five tips for separating the good from the bad and the ugly
I opined recently that jQuery plugins can be more trouble than they're worth. That said, they're often indispensable. True, the worst plugins suffer from bloated code, confusing APIs and too many features. But the best provide instant black-box functionality with just a little configuration. The trick is figuring out which plugins are worth the effort and which ones aren't. Here are five tips for doing just that.
Topics: Ajax, Ajax libraries, Javascript, jQuery, plugin
Resolved: Should schema.rb be included in your source control?

This issue provoked a comment in two separate recent posts, and hey, when the people talk in vast numbers like... well, two, we respond.
As you know, Bob, there are two ways a standard Rails application tracks your database schema. The first is the collected set of your migrations, which can all be run with rake db:migrate. In theory, the set of migrations run sequentially results in your database schema. Rails also maintains an automatically generated file schema.rb, which is updated when migrations are run. This file is a Ruby script representing the current snapshot of the database and can be loaded into a blank database using the command rake db:schema:load.
The question that arises is which of these two methods -- migrations or schema.rb -- should be considered the ultimate source of truth about the application's expected database schema? The answer has implications for your group practices. If you consider schema.rb to be the final source, then you will want that file in source control, and you are less likely to place effort into ensuring your migrations are always runnable from scratch. If you consider the migrations to be the final source, then you probably don't want schema.rb in source control but you do always want to know that the migrations run.
Topics: Ruby on Rails
Flash 10 - FileReference Runtime Access
This is what I was waiting for - FileReference Runtime Access! To quote the original blog post:
"This greatly lowers the bar to using Flash as a photo editor, document manager, customized application experiences, marking up content and saving locally, all without the need for server side script."
And then: "It is only beta (Flash 10) but there are great market opportunities to prepare for when this launches."
Flash is just getting better.
Also, do check out the other great posts from http://drawlogic.com
Topics: FileReference, Flash, flash player 10
Papervision3d 2.0 (Great White) in Flex 3 (Part I)
I'm developing a prototype that loads GPS coordinates/time of flights from an external file into Flash player in a browser and renders them at runtime using PV3D over an interactive Yahoo Maps API.
This prototype is in part being used to test performance of Flash Player running the excellent PV3D. So far it holds pretty good.
Topics: 3d, Flash, Flex, papervision3d
About Pathfinder
Recent
- Bullseye Diagram
- Roles Testing For Security
- Blackbird takes the pain out of JavaScript logging
- Making GWT JSON not Quite so Painful
- IDEA - preconference workshop 06 Oct 08
- HTML5, Ajax history management, and The Ajax Experience 2008 Boston
- A Look Back At Past Posts
- Flash Player on iPhone gossip
- Microsoft to Jump on Board EC2
- TAE Boston 2008: The Unsexy Presentations
Archives
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006



