Technology


9
Dec 07

RESTful DB and App Servers

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: RESTful DB and App Servers
Date: Sun, 09 Dec 07 19:40:21 GMT

Like I said before, most of the week’s linkage
has had to do with CouchDB or, generally speaking,
to do with JSON-formatted REST-accessed database and
application servers.

http://mvalente.eu/cat.cgi?JavaScript%20in%20All%20of%20the%20Tiers
http://del.icio.us/mvalente

CouchDB is sure fun to use, but its Erlang dependency just
pisses me off.

http://couchdb.org/
http://code.google.com/p/couchdb/
http://jan.prima.de/~jan/plok/archives/108-Programming-CouchDB-with-Javascript.html

The way that I’ve been thinking about a new web development
framework indeed involves a REST interface and JSON or XML
formatted data. But I just think that a) you might as well
standardise the programming languague used at all tiers (and
that means Javascript) and b) you should have REST/JSON as
interface not only to the DB tier but also to the logic tier.

Sure enough there are some alternatives if you want to go
that way.

Basura DB (Python based JSON/REST DB implementation)
http://www.intertwingly.net/code/basura/
http://intertwingly.net/blog/2007/09/24/Tests-Id-Like-CouchDB-to-Pass

Persevere (Java based)
http://code.google.com/p/persevere-framework/
http://www.ibm.com/developerworks/web/library/wa-aj-objmap/

Robaccia (Python based web framework includes a RESTful JSON server)
http://bitworking.org/news/restful_json_server

JSONStore
http://taoetc.org/97

DBSlayer (HTTP/JSON interface for MySQL databases)
http://code.nytimes.com/projects/dbslayer

But aditionally to databases, I’m thinking more in line with
the proposed RADAR architecture of having the REST interface
also available for the app server. There arent as many options
here…

The RADAR Architecture
http://pragdave.pragprog.com/pragdave/2007/03/the_radar_archi.html

Naked Objects
http://www.nakedobjects.org/tutorial/index.shtml

NetKernel
http://www.theserverside.com/news/thread.tss?thread_id=47695
http://www.1060research.com/netkernel/

And sure enough all of the above is typically Java-based (yuck!),
with some other languages thrown in (Python, Erlang), but none
goes all the way and standardises on Javascript as the implementation
language and the glue language. Apparently I am not the only one
considering this idea…

Alt Framework
http://marcello.cellosoft.com/projects/alt/

Simile’s Exhibit Framework
http://simile.mit.edu/exhibit/

— MV


23
Nov 07

MVC, MVP, PAC and Others

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: MVC, MVP, PAC and Others
Date: Thu, 22 Nov 07 23:42:21 GMT

I’m trying to wrap my mind around Model-View-Presenter,
Presentation-Abstraction-Control and other UI architectural
patterns, so I might as well warn you that my brain might
explode…

http://ctrl-shift-b.blogspot.com/2007/08/interactive-application-architecture.html
http://www.martinfowler.com/eaaDev/uiArchs.html

Definitely stuff to think about regarding a future web
app framework.

— MV


21
Nov 07

SOFEA and the Future Web Development Framework

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: SOFEA and the Future Web Development Framework
Date: Wed, 21 Nov 07 01:38:21 GMT

“SOFEA is an architectural style which in its definition
criticizes (and manages to make a very good definition of)
the current web frameworks, and (as they say) “none of them
satisfies”.

http://unclescript.blogspot.com/2007/11/coming-frameworks-sofea-jda-squirrel.html

This is what I have been talking about in my posts about a
future web framework. The guys that are proposing SOFEA make
a very good technical argument in their paper and presentation.

http://wisdomofganesh.blogspot.com/2007/10/life-above-service-tier.html

If you pay particular attention to page 26 in the paper (about
how the Service Oriented Front-End Architecture model should work)
you will see that it is precisely what I’ve been talking about.

David Coffey also seems to have come to the same conclusions. And,
like me, that it all converges into Javascript. He’s building Triad,
a Javascript MVC framework.

http://blog.davidadamcoffey.com/4/triad-a-javascript-mvc-framework

Compare his diagram:

http://blog.davidadamcoffey.com/wp-content/uploads/2006/11/mvc2.png

With my previous post:

http://mvalente.eu/cat.cgi?A%20Future%20Web%20Development%20Framework%20-%20Architecture

— MV


3
Nov 07

A Future Web Development Framework – UI Controller

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: A Future Web Development Framework – UI Controller
Date: Sat, 03 Nov 07 21:03:21 GMT

There is even less to say about the controller part of
the framework. We dont even have to deal with religious
wars regarding what language to use. Your option is Javascript
and nothing else. Anyone thinking “what about Java” or “what
about Flash” (and current iterarions, Air, JavaFX, etc) will
have to explain what is the justification to have a VM/interpreter
available (the browser) and to start yet another VM/interpreter
(JRE or Flash plugin).

Nonetheless there are a couple of points that should be made.

A future web framework would have to guarantee that the controller
part, in Javascript, doesnt allow for business-logic embedded in
the controller code and doesnt allow for obtrusive Javascript (in
particular inline code)

The right way to do it would be to make declarative the use of
the UI behaviour the same way that, using CSS, we did away with
inline styles.

An obvious candidate would be, of course, Behaviour

http://bennolan.com/behaviour/

But there are other options. One is event:Selectors

http://alternateidea.com/event-selectors/

(although its based on Prototype.js and much prefer JQuery.js)

Another would be XForms and any Javascript implementation of
it (ie. not having to depend on the browser implementing the
standard)

http://ajaxforms.sourceforge.net/
http://www.formfaces.com/

Here though we start getting into a lot more than the UI
behaviour, namely we start getting into template/view stuff
and I want to deal with this in a separate post.

Its not always easy to define where the UI/controller part
is different from the UI/view/template part. I have a button
that takes 2 fields and computes some function. Should that
be done in the controller or in the template? I have a button
on a menu that takes me to another application screen. Where
should that be done, in the controller or in the template?

(just for the record, the first one is template level since
it has to do with data processing, data binding and business
logic, and the second one is controller level since it has to
do with application flow)

But it is difficult to define and decide and it is one of the
major problems with current web frameworks since it leads to
spaghetti code mixing controller stuff and model stuff. A new
web framework should be able to stop or minimize this problem.

— MV


7
Oct 07

A Future Web Development Framework – Application Logic

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: A Future Web Development Framework – Application Logic
Date: Sun, 07 Oct 07 21:21:21 GMT

There really isnt much to say about the middle component for
a 3-tier architecture (the business logic). You can of course
get into religious wars about which language it should use. This
is the component that usually generates all the talk precisely
because of the language issues. When discussing Django, Rails,
.NET, etc, people arent really arguing about what the application
(logic) server should do or what its architecture should be: they’re
just arguing on whether Python is better than Ruby is better than
Rails is better than PHP…

Me, although I currently favour Python, I am more of a syncretic
integrator: whatever solves the problem faster without spending
too much of my brain processing time (this immediately eliminates
Java.. LOL :-). Thats why I like some of the more recent options
available like Virtuoso or ActiveGrid that allow you to program
the business logic in a variety of languages (either choose one or
use all at the same time).

http://www.activegrid.com/
http://www.openlinksw.com/virtuoso/

Virtuoso, for example, by including the VM runtime for several
languages, is able to run code in Java, .NET, Python, Perl or PHP.

http://www.openlinksw.com/virtuoso/architect/vtechnical.htm

(nice graph there, maps some of my ideas nicely)

Nonetheless there are two points worth exploring about the logic
layer, whatever the language of your choice: how the logic layer
interfaces to the storage layer and how the logic layer interfaces
to the presentation layer.

The first problem I have already referred to in my previous post
about storage. Even though the usual interface is the SQL language
(due to the fact that 99% of the times the storage layer is implemented
using a relational database), nowadays most programming is being done
using an object-oriented language. Hence the object-relational impedance
problem and the proliferation of object-relational mappers (ORM), which
have become especially popular due to its use in Ruby-on-Rails ( more
precisely ActiveRecord).

As I stated in my previous post I dont think that this is the way of
the future. The indiscriminate use of the relational/SQL database is
way past due in an object/document/unstructured/hierarchical oriented
world and object-oriented databases should become the norm. On the other
hand I do have to admit that having my data closed down in some format
which is proprietary really bothers me a lot. Since I wrote my post about
storage, CouchDB has entered the radar of many people and it seems to
contain the basis for what is needed: a OO database that stores its
objects in a simple text format (JSON) with a REST interface.

http://couchdb.org/

The second problem (logic-to-presentation interface) actually mimics
the logic-to-data interface and it also has something to do with a later
issue (templating or view/controller). As in the logic-to-data interface
problem, where the logic level (ex: Perl or Python) currently embeds a
lot of data stuff (ie. SQL), the logic-to-presentation interface also
suffers from a lot of confusion, especially when you have templating systems
that allow you to mix code and presentation. PHP is a particularly bad
example of this problem.

This could be solved by explicitly denying the logic level to output
any kind of presentation code. Presentation level stuff (ie. templates
or view/controller) would be in charge of doing any presentation stuff,
getting all the data/logic from the applicatin server (through REST calls,
with data in JSON, XML, SOAP, whatever), with the application server being
explicitly prohibited from outputing any kind of HTML markup code (it just
wouldnt be taken into account or rendered).

What comes to mind as an example is an application server, using whatever
language, that would behave exclusively like TurboGears/CherryPy with the
jsonify decorator: you could call any URL in AJAX form and you would receive
results in JSON (or any other format), no HTML allowed.

http://docs.turbogears.org/1.0/JsonifyDecorator

Although I see no problem with the same server delivering both page
templates (ie. view/controllers) and logic (they are both HTTP after all),
that implies some discipline. An actual separation of concerns would
imply separate servers: one would only serve static pages (ie. templates)
and could be a standard HTTP server (Apache, etc) and the other would
only serve the processing results for received requests.

Event though I’m a bit agnostic regarding the choice of language for
your application server, I do have to state my opinion regarding current
trends and what I see as being the future endgame and the best choice.

Everyhing points towards a Javascript future.

http://steve-yegge.blogspot.com/2007/02/next-big-language.html

This is probably unpopular to say and there will be several voices
talking about Javascript’s speed. But the fact is that it doesnt make
much sense to use a language at logic/application level and then to
use another at presentation/template/view/controller level. Especially
when you take into account the current AJAX and JSON trends. You just
create aditional impedance when your doing stuff in Javascript at
presentation level (lets say field validation for example) and then
you’re encoding form fields into XML or POST fields, requesting some
processing from the application server which has to unmarshall the data
into whatever its format is, process it and remarshall the data back
into XML or JSON for delivery to the presentation layer.

In the last couple of years Javascript, which was available server
side back in the Netscape days (it was called LiveWire), is making
its comeback in the application server layer with a bunch of new
developments like OpenMocha, Phobos or Helma.

http://helma.org/
http://openmocha.org/

https://phobos.dev.java.net/

So, to sum it up: a future web development framework would include
an application server that exclusively served webservice requests
preferably in a REST way and in JSON format, explicitly barring any
output of presentation/HTML code. Although it could work in any
language, Javascript would probably be the best option given current
trends.

— MV