Tagged: barcamp

Practical Hypermedia for our post ORM world

This post is for people who have started learning about hypermedia and feel that it over complicates the elegance of REST. When I started hearing about hypermedia I felt it was adding architecture acrobatics for the sake of buzzword enhancement. After having applied these techniques in a few places not only have a drunk the cool aid, I’ve setup a stand beside my desk. I look back and try to understand where my initial negative reaction came from. I realized that many of the examples were trivial and did not demonstrate the reality of what hypermedia brings to the table.

The main epiphany I’d like to share is that REST has proven itself as the best way to take an ORM focused approach to an API and Hypermedia is proving itself as the best way to take a business process approach to an API.

A key aspect of Hypermedia that I don’t see used often enough is the notion of a template. The template portion of the spec calls for the API to send down to the client the parameters necessary to call the API itself. This notion is akin to how you load a web page with a blank form and then submit the form directly. You don’t post to twitter by typing a bunch of stuff into the url, you load twitter first and then fill in a textarea.

Essentially in my early experiments I was writing XML api payloads where the template portion was basically an HTML form that the client could decompose and render. The problem that I felt was that I was basically writing a full old school web application that happened to send XML rather than HTML back to the client. Then my client had extra complexity in parsing the XML and implementing all the UX rules to get the client looking and feeling right. I also had to build 2 webapps that both were basically doing the same thing, view, validation and calling a service.

Now lets take a look at doing this for real using AngularJS, JSON and a deadline.

Continue reading

BarCamp Philly 2010 Summary – Opendata and beyond

When wrapping up the VIm talk @trevmex mentioned that people share their dotFiles on github.  This blew my mind.  I can sit in front of anyones desk and start using their eclipse and immediately be productive.  The secret to VIm is the years of refactoring the configuration and shortcuts, known as the dotFiles.  You probably couldn’t even execute a mapped command on my machine since I map the leader based on my keyboard.

I’m used to reading about VIm plugins and tips on sites like http://www.vim.org/ but I never really thought about the power of collaborating on the ultimate VIm config via the forking, pushing and pulling that is github.  The idea of forking someones config and :%s/leader=’\’/leader=’`’/g is really compelling.

So I got to my next session, Philly Opendata, a bit early and powered up the University of the Arts guest wireless to see what this gitHub dotfile concept is really about and could not connect. After an hour of discussing how VIm keeps your hands on keyboard and head focused on the task I’m again reduced to a mouse clicking consumer wondering where the button is that will get my osx to work, or give me a clue as to why it won’t.  I would have searched for “iwspy on osx” but without wireless it would have been a short trip.

The point of this segue is that Maurice noticed my plight and leaned over with the security settings to his mifi app to get me out of the 80’s.   That has never happened at any formal show I’ve been to.  He had signal and was willing to share.

Turns out Philadelphia has data and is also willing to share.

Getting access to this data is important for so many reasons.  Before I talk about the social importance of opendata I have to step back and comment that crunching huge datasets and experimenting with bizarre visualizations is the type of fun that drew me to computers in the first place.  Whether plotting Fourier power transforms of breathing sheep or number of potholes per coffee shop there is something exciting about creating a unique perspective on otherwise boring or overwhelmingly complex data.

Having transparency into our government machine is really just a continuation of our need for independent newspapers.  Thomas Jefferson is often quoted as saying that Democracy depends upon an informed population.

The city of Philadelphia has committed to releasing 311, GIS and crime data. There was a very lively discussion at this session around the types of apps we could build, the benefits that the city will reap and most importantly WHEN it will launch.

This was all good and exciting conversation and one particular thread stuck with me long after the session ended.  We talked about how we can audit the data and ensure that it is used properly and not abused.

We live in an age when a comedian can save the elephants by editing a wiki page.  When I was a kid I was raised to believe that reporters were ‘investigative journalists’ and dug deep to get the facts.  I grew up just a few miles from where Geraldo Rivera got his start with an acclaimed expose of a mental institution that resulted in action being taken.  I was not until I got older and became exposed to Fox and the Daily show that I’d realized how seemingly sane people could look at the same data information and draw such dramatically different conclusions.  (Actually I learned that in grad school.  “Number-smithing” and “creative graphing” are required classes for practicing engineers.  There was a similar class for the business students, but it skipped the numbers part altogether.)

It would be really easy for me to take all the pothole data and plot it on google maps.  A little massaging could show my street as having a few extra’s and maybe I’ll even ‘fix’ a few in the other neighborhoods.  People will see my app and maybe my street gets a little bump in priority.

Visualization is a powerful tool and data of this magnitude will always be analyzed with bias.  Even a simple flow chart describing the new health care policy can be warped towards an agenda.

Opendata puts us all on a level playing field.  I’m looking forward to the apps and visualizations coming out.  I will be disappointed if we wind up with a  liberal and a conservative app mirroring our polarized two party system.  I personally feel that there is a responsibility in the hands of the designers and developers to attack this data and ensure that the people of Philadelphia have multiple avenues of getting accurate facts.

The first tenant of the IEEE code of ethics hints at the damage we can do here.

1. to accept responsibility in making decisions consistent with the safety, health and welfare of the public, and to disclose promptly factors that might endanger the public or the environment;

As far back as the 12th century the Rabbi Maimonides wrote a Physicians oath with another line that I find appropriate:

May the love for my art actuate me at all time; may neither avarice nor miserliness, nor thirst for glory or for a great reputation engage my mind; for the enemies of truth and philanthropy could easily deceive me and make me forgetful of my lofty aim of doing good

A Doctor’s specialized knowledge and training puts his actions and opinions under a special light with regard to ethics.  Typically computer professionals live by a ‘do no harm’ credo as well, but our actions were usually bounded by our working domain.  With open data and blogs we can now use our skills and training for the betterment of democracy or as a lever to move a personal agenda.

Now that I am ready to wield this data in the name of Democracy and Truthiness I’m headed over to listen to Tom Janofsky talk about his experiences with Cloud Computing on EC2.

After all, once this great Philly data is out I’m going to need that elastic processing power….