Re: SQL for presentation



frebe73@xxxxxxxxx wrote:
At this forum, it is often claimed that almost all kind of data
transformation could be done using SQL select statements.

I'm not sure that SQL is the best way to go and will presume
that you mean some language consistent with relational theory.
Given that, we probably wouldn't claim that all kinds of data
transformation could be done using that language - simply the
most reliable transformations.

It is also
claimed that the "business logic" should be implemented in the database
as views and the application on top of the database only should be
responsible for presentation (and communication).

Views are useful, but constraints shouldn't be ignored. Don't
misunderstand the intent of things you've read here: the point
is not to minimize the role of the application but rather to
put features where they most reasonably belong. I think the
argument you'll most often read is that data integrity and
availability are increased when "business logic" is manifest
in the database.

In web applications, the presentation - HTML - is a data structure.


HTML is a markup language. I would hesitate to call it a
structure simply because it has a hierarchic tag scheme. It
certainly lacks the rigorous features that the relational model
calls structure and uses to store and manipulate data.

If
select statements could make almost any kind of data transformation,
why couldn't we use select statements to produce the HTML text?

As a matter of fact, two databases I've worked with do exactly that.

I see a
problem in the fact that HTML is hierachial and select statements
doesn't seem suitable for returning hierachial results.

This puzzles me; what's difficult about "returning hierachial results?"

> But what if a
relational version of HTML existed, would the select statement be
suitable for buildning the GUI too?

No. Select does what select does and GUI building isn't part of
what select does. Building a BUI requires one to handle request/
response communications -- and that's certainly beyond what select
does.

There are. however, those who envision applications built entirely
from declarative language. Granted, not many exist and those that
do are not sophisticated, but it's not clear that the goal is
impossible. The difficulty is that very few people are able to
work towards that goal.


/Fredrik

.



Relevant Pages

  • Re: Source-to-source transformation: best approach?
    ... I don't know why TXL would be especially suited for source to source ... this for wide classes of language (in the sense that I have looked at ... its derivative, Stratego), and my tool, DMS. ... RecDescent for my long-term source to source transformation needs. ...
    (comp.compilers)
  • Re: Integral and non-integral
    ... >> struct X ... should be allowed to write, in a header file, ... The question is why this is actively prohibited by the language. ... Except for the use of underscores this is also a transformation the ...
    (comp.lang.cpp)
  • Re: [OT] code is data
    ... it would be the best to cache the result of the transformation. ... classes using this metaclass, then both the class statement and the ... first relationship) someday, just for fun. ... Still a programming language. ...
    (comp.lang.python)
  • Re: What was Noam Chomskys contribution to *LINGUISTICS*?
    ... We have a universal grammar ... > defining a universal language U, and all real language R can be produced ... > by a transformation, one for each language, that maps sentences of U into ... A transformation takes you from "Mary kissed John" to "John was kissed ...
    (sci.lang)
  • Re: OOs best feature survey results
    ... Again isEqual returns a boolean value. ... > that Add is not a built-in function. ... I don't know anybody except you that would like to use a language like ... but I don't see anywhere where relational theory ...
    (comp.object)