Thursday, December 27, 2007

Reviewing the REST architectural style

These simple principles are easy to forget, so I'm reviewing them again.  A little midweek book report.

Fielding's REST architectural style formalizes the first best well known, scalable use of HTTP.  Fielding's context is the web in its greatest expanse, including all manner of edge devices, caches and other proxies that lend considerably to scalable infrastructure at critical points.  The global infrastructure benefits from the maintenance of its essential principles.
  • An HTTP resource is representated by a content object location (URL), for example "/path/file.html".  Technically, not redirecting "GET /" to "GET /index.html" is bad (vanity) practice. The reference "/" should not have content. The corresponding "PUT /" or "DELETE /" would be ambiguous, and (hopefully) undefined.   
  • The performance of the HTTP operators (GET, PUT and DELETE) on an applicable resource should be bounded by the network. This seems implicit.

In REST, Fielding emphasizes the (HTTP) Response Entity Body as a sequence of bytes identified by the combination of the (HTTP) Request Line and the (HTTP) Response Headers (metadata).

The Amazon S3 store has an interesting familiarity with Fielding's principles for REST.  The S3 PUT request defines metadata headers for the subsequent GET response.

Friday, December 21, 2007

Some architectural principles for the web

Web applications have a specific architecture, and this context has specific needs.  How Fielding's "REST" came to be applied to application specific (non SOAP) XML formats is beyond me, but what Fielding actually wrote is the first best example of architectural principles for web applications.  Beyond my own work on "RESP",  there are more principles that I need to enumerate for myself as I consider or work on commercial projects.

Avoid application silos
The extensibility of web service based applications will depend on a variety of small services that expose the data store independently from application processing.  This separation permits the various views on the data and its applications to be represented cleanly, and allows for necessary evolution of these views as independent entities.  The converse is a singular conception of the Web API, which evolution will get messy.  A nice point of conversation is comparing the open RDBMS to one exposed only through Stored Proceedures.  Each Stored Proceedure is another Web API, excepting the capacity of a Web API for some "varargs" style capacities in comparison with Stored Proceedures.
How dynamic is dynamic?
If it's static, serve it staticly.  Avoid implementing the world dynamically just because it's easy to do -- that's intranet, not internet.  Use AJAX, Flash or Applets for the dynamic components of a Web UI.  Evaluate alternatives in the context of an interchangeable server side.
Don't be afraid of a thick client
The only problem with a "thick" Flash or Java client side is that the rest of the web is obscured from reusing or mashing the best parts of your wwweb.  When the thick client uses documented Web APIs, then there's no issue.  Frankly, browser space is hell -- even SVG is getting messy despite the most serious and dedicated efforts of its developers.  For this writer the only thing that's sticking after all these years is the Java Applet.  But even that subject is complicated, Java's accidents can be severe (final java.lang.String, class ByteBuffer, final class HeapByteBuffer, and the list goes on).
Less is more
If there is no one size fits all universe (client or server side), its solution is really simple interfaces that can be picked up in a minute.  That's what will survive your evolutionary forces and processes.  Everyone in the game is making big mistakes: my own is not releasing anything for a decade, Amazon's is having a different authentication scheme for each service, Google's is having too few published APIs and not being API centric, Sun's is thinking that $1/cpu-hr is a business and generally having too little serious engineering discipline in the development of Java.  The smaller the release, the smaller the mistake.
Use XML
This one makes me laugh, in a "lol" sort of way, but it's true.  It's the only way.  JSON has too little structure, no attributes.  It's a very good alternative format alongside an XML service -- serialize a DOM for XML or JSON.  But XML is the canonical format, the best set of constraints for information service architects.  The best Art recognizes its external constraints, then establishes project constraints, and then gets creative.
Think Universal Space
If it's all XML, data and processing, then there's a web universal space that we're all building an economy into.  Forget discovery, let the search folks work on discovery.  Drop design time at run time: SOAP.  It doesn't scale.  Use Schema, keep design time in it's place. 

In summary, don't get aggressive on Requirements, get aggressive on Constraints, and then on getting creative and powerful within them.  Work the problem.  Save the World.

Thursday, December 13, 2007

Boxes White and Black


The classic "black box is closed, white box is open" differentiates Web APIs as it differentiated Host APIs.

An API, Framework or Programming Language presents a domain for a range of products.  An API or Tool domain differentiates itself in terms of its strengths, weaknesses, facilities and incapabilities.  This is only more true for Web APIs and Programming Languages exposed the open network.

When the domain is something most excellent, like the C programming language for example, it is a transparent facility or convenience over its intermediary tool chain and the target programming of the machine.  But when the work domain is too thick, its intermediary tool chain and target programming become obscured subjects for the programmer and the range of products ultimately suffer (at least on average over the long term). 

This kind of triage can be applied to answering the question, How flexible is it?  What are its first class objects for ready manipulation in this domain, and what would we want to be able to manipulate in this domain but cannot?  It can be applied to Web User Interfaces as well as Web APIs and Programming Languages.   And should be a very good predictor of utility and success.

Wednesday, December 12, 2007

Online app creation company: AppJet

Thanks to Nick Gonzalez at TechCrunch for covering AppJet.

AppJet is really nice, the first thing I've seen in the space for the server side online that I really like. Maybe just because the site hits you with what it is. Or because AppJet as a whole is an essay in simple effectiveness.

I really like the
print(HTML{name:"value"})
sticky (as in glue) sugar (as in syntactic) -- fairly transcendent little one. Not crazy about
print("<html>");
though. Taglibs, anyone?

AppJet is web script. No one tool is right for all jobs -- especially not for everyone. Bijan likes Pipes, and a million HTML folks can like AppJet (knock on wood). Like "shell" in host programming, it's the right tool for the job when it's the right tool for the job -- script is script.

And web programming -- we can be sure -- will be all about lots of systems doing lots of different things.

Online app creation techno: CXF

An apache incubator project, CXF is a framework for creating enterprise services in JAX-WS, POJO and JavaScript (on the server side).

Tuesday, December 11, 2007

Review of "online app creation"

Finally some good info on the shape of the world, a post by Erik Schonfeld at Techcrunch lists the following.


Coghead

Configurable application templates for traditional business apps.

Salesforce

SOAP data objects for synchronous data operations. Data object operations include query, create, update and delete. Workflow process programming in Java or C#.

Zoho Creator

Deluge Script produces state machines over database tables.

Dabble DB

RDBMS building with app API in JSON.

WyaWorks

Looks like data forms. SOAP API.

LongJump

An RDBMS shape with events. App data REST API. SOAP Events. Configure existing apps.


Monday, December 10, 2007

Essential streaming over HTTP


Added a page to my personal site to cover some HTTP techniques for streaming, and general content delivery optimization. 

In short, HTTP/1.0 does streaming (across Proxies) when the "Content-Length" header is not included.  Really nice to know. 

Unfortunately, most Java Servlet Containers don't implement the 'no buffering' option permitted in the Servlet Spec.


Saturday, December 8, 2007

Review: online server side web application development



Yahoo Pipes

"An interactive feed aggregator and manipulator".  A very gooey GUI, but it's popular, ultra easy to use, and it's free. 

Salesforce.com

"Force.com is a platform".  Marketeers aside, they're working hard to get the enterprise market to take another look at the services model.  Techno enterprise.  Sounds expensive in more ways than one.

Jelly

A bean "glue" language.



Tuesday, December 4, 2007

Rich and Thick and Thin


An online editor user interface needs a thick client, and a thin server.  If a thin web client is HTML or AJAX, a thick web client is Flash or Java.  The thick web client provides stateful user interaction which it mediates in complex ways to produce minimized server side operations.   In this way a rich user experience can be delivered with a high volume, scalable server side.

A thin AJAX client is useful when there is a direct (one to one) relationship between user interface operations and server side operations.  The reason being that JavaScript gets stretched thin when it's not simple.  I'm writing this using Gmail, which could be held up as evidence to the contrary.  However I'll submit that Google have rather shown what it takes to deal with as much complexity in JavaScript, inventing GWT as an engineering organization framework and hack repository.

The choice I've made for the Syntelos client side is the Java Applet.  While Flash has great graphics, the platform is more than a bit tricky from an engineering perspective.  The open source Batik based Flex toolset is too inflexible with respect to generated code version, and too large a footprint for application to the internet scale server side. 

The Java choice permits fairly massive code reuse between the SX Server and the Viz Applet. In comparison with Flash, the Java client side is extensible -- if subject to the vagaries of the Java Applet Plugin World.  If there's one thing I know about Javaland, it's that everything changes, year by year.  Here's looking for native threads,  Java3d and JMF in the Java Applet Plugin World.  Anyway, I can live with The Applet Plugin Situation, preferring MacOSX, and reusing code from the server side in the client side.   It only needs to be the first option, my first option -- since the server side is completely independent.

The rest of the world tends to call it a Rich client.  With the state of the JAPW graphics rendering in Solaris and Windows and Linux (no native threads), I can't call it Rich.  I'll just call it Thick.

Sunday, December 2, 2007

Blogger template

This is really boring, but here's my blogger template to replicate the Google apps "Micro Ghost" template in Blogger.

To use it, upload this into Blogger > Template > Edit HTML.