cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Erskine <a.ersk...@cs.ucl.ac.uk>
Subject [C2] state and actions proposal
Date Wed, 31 Jan 2001 06:34:29 GMT
Hi

I have a proposal for actions in C2.  The proposal is that an action should be definable in
the context of the state that it affects, and the action's possible parameters.  This would
necessitate being able to define state entities in the sitemap, along with the actions that
can affect these entities.

Furthermore, it should be possible to define an action's interface (ie the state it affects,
it's parameters, and what it returns [+to where!]) separately from it's implementation.

In other words, there should be a construct analogous to classes from OO languages at sitemap
level, along with the ability to access entities of a particular class at pipeline level (xsp
level too).

eg

<map:classes>
    <map:class name=....>
        <schema>
            <attr name="id" type="integer">    (insert favorite schema defn method here)
            ...
        </schema>
        <interface>
            <action name="...">
                <param ...>
                <returns ....>
            </action>
        ....
        <implementation>
            <view src="..">                --- most but not all entities would allow
a virtual SAX                                                                     representation
            <action name="...">
                  ----action implementations here---
        </implementation>
    </map:class>
    ...
</map:classes>

The class/entity system need only be complex enough to allow C2 to fulfil it's mandate as
an interactive presentation layer, and NO MORE.  The entity management responsibilities would
lie as before with whatever RDBMS, CMS, etc

Among the many benefits of this I can imagine, the most important IMHO would be the ability
to write general purpose actions for these enties, e.g. a general table class, allowing insert,
update, delete actions which could be reused by all entities of that class;  table view class
(entities constructed according to view conditions, e.g. XML query, or SQL query etc); general
purpose entity validation...etc etc etc

The abstraction provided would also mark a web first....C2 web apps would be portable!!  So
long as the sitemap constructs and xsp pages were written in terms of the abstract class/action
definitions, the implementation could be changed from RDBMS to CMS to EJB and back again without
a grey hair on anyones head.

If someone can convince me this is nonsense, I'll pack my boots.  If anyone thinks there might
be something in it, I'll send a few code snippets from my scratch-pad...

- Allan

Mime
View raw message