Hi Kevin,

On Fri, 22 Feb 2002 15:27:10 -0600, [EMAIL PROTECTED] wrote:

> Ovidiu and Stefano,
> 
> First, I'm new to cocoon, but not the methodology.

Welcome! One more head to think about problems and come up with a way
to solve them ;-)

> I'm in the process of prototyping a conversion from a home grown (Flow
> based) framework to Cocoon 2.  I was hoping to discover that it was
> included.   I had put a small amount of effort in defining an XML syntax,
> because the existing syntax is compiled into java objects...but I decided
> it would be in the best interest of the company to jump into a well
> supported project such as Cocoon.
> 
> Here are my thoughts and requirements for our system:
> - web service or xml-rpc based interaction
> - multiple web service invokations based on dynamic request parameters (per
> request)
> - web service request message creation (inline transformation) based on
> request xml (I think I can already create xml inline for delivery as a
> request to a web service)
> - content aggregation and inline transformation (already in C2) for either
> web service request delivery or response

This sounds very similar with the work being done by the HP group I
work in to use Cocoon as a SOAP server. I'm sure we can find a way to
expose the same business logic as a Web application or a Web Service,
and have Cocoon drive them both.

> I have defined Flow and FlowOperation as the primary concepts in the
> system.  A Flow has one to many flow operations.  A flow operation can do
> anything you can do with java, as long as you create a Controller to handle
> it.  The flow is invoked as something like:
> http://mycompany.com/RootController.jsp?flow=ViewPerson&id=128282722.
> Forms post to flows, and all links reference flows.  You can then add,
> remove, or modify flowOperations without the tight coupling of the UI.

If I understand this right, the model you describe
(model-view-controller) is very similar with the model I described in
the previous email. The controller is the flow layer, and it drives
the pages to be presented to the client browser or the original
requester, in case of a Web service.

> With that said, since I'm very new to C2, I'll stick to just giving
> feedback on how I want to use C2.  I'm unclear on what is exactly already
> present in the project, but I see a great deal of potential.
> 
> I would be extremely interested in contributing to the development of a
> Flow control layer with C2....because we are looking to convert our system
> right now.  I'm ready to start today, but I'll definitely need a guiding
> light to get started.
> 
> I will say that I'm interested only in an xml-based flow syntax, possibly a
> much simpler version of one I was considering for the home grown version.
> 
> Please let me know if I can help, or if you can point me in a direction
> where Cocoon 2 already fulfills my needs.

There was quite a bit of discussion on the topic of flow control,
checkout the threads on Cocoon-dev:

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&w=2&r=1&s=flowmaps%3A+the+wrong+approach&q=t

http://marc.theaimsgroup.com/?w=2&r=1&s=%5Brt%5D+Managing+Flow+and+Resources&q=t

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=100802231017059&w=2

I am currently investigation the use of so-called "continuations" to
help in describing the flow as a program in a programming language,
rather than as a finite state machine in XML. I believe this approach
is much more powerful and easier to write applications in, than with
the finite state machine approach. Check out these two papers to
understand the difference:

  http://youpou.lip6.fr/queinnec/Papers/webcont.ps.gz

  http://www.cs.rice.edu/CS/PLT/Publications/esop2001-gkvf.ps.gz


> ==================  Flow Config ==========================
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <site>
>   <flowOperationRegistry>
>     <flowOperation default="true" classname="
> com.iverticalleap.presentation.flow.FlowOperation"/>
>     <flowOperation name="loadSubjectListXML">
>       <delegate>/jsp/FilterFormController.jsp</delegate>
>     </flowOperation>
>     <flowOperation name="xsltDisplayTransformation" classname="
> com.iverticalleap.presentation.flow.XsltTransformationDisplayFlowOperation
> ">
>       <delegate>/jsp/TransformationController.jsp</delegate>
>     </flowOperation>
>     <flowOperation name="xsltContentTransformation" classname="
> com.iverticalleap.presentation.flow.XsltTransformationContentFlowOperation
> ">
>       <delegate>/jsp/TransformationController.jsp</delegate>
>     </flowOperation>
>     <flowOperation name="reflectionContentFlowOperation" classname="
> com.iverticalleap.presentation.flow.ReflectionContentFlowOperation">
>       <delegate>/jsp/ReflectionController.jsp</delegate>
>     </flowOperation>
>   </flowOperationRegistry>
>   <flowList>
>     <!-- the following are the ideas i've come up with  -->
>     <!-- 1 (basic) -->
>     <flow name="DisplayCreateStudentFlow">
>       <flowOperation refname="loadSubjectListXML"/>
>       <flowOperation refname="loadClassListXML"/>
>       <flowOperation refname="xsltDisplayTransformation">
>         <propertyList>
>            <property name="xsltUrl">/jsp/admin/createPerson.xslt</property>
>         </propertyList>
>       </flowOperation>
>     </flow>
> 
>     <!-- 2 (same thing but with reflection so you don't have to create the
> controller -->
>     <flow name="DisplayCreateStudentFlow">
>       <reflectionFlowOperation name="loadSubjectListXML">
>         <invoke methodName="getSomeObject" className="
> com.iverticalleap.service.SomeService">
>            <parameter name="identity">
>              <value><!-- value is dynamically derived from posted variables
> -->
>                <invoke methodName="getParameter" className="
> java.servlet.http.HttpServletRequest"> <!-- also thought about calling this
> an <implicitObjectInvokation name="request"> -->
>                  <parameter name="parameterName">
>                    <value>PersonIdentity</value> <!-- html form variable
> name -->
>                  </parameter>
>                </invoke>
>              </value>
>            </parameter>
>         </invoke>
>       </reflectionFlowOperation>
>       <flowOperation refname="loadClassListXML"/>
>       <flowOperation refname="xsltDisplayTransformation">
>         <propertyList>
>            <property name="xsltUrl">/jsp/admin/createPerson.xslt</property>
>         </propertyList>
>       </flowOperation>
>     </flow>
>   </flowList>
> </site>

If I understand the above description right, the flow is described as
a finite state machine, where flow names are states
(DisplayCreateStudentFlow for example), and the transition events are
method names. For a given user, the application is in one possible
state in any moment in time, and it transitions to a different state
based on an event.

I think the finite state machine approach is difficult to extend to
complex sites. It is very difficult, and rather limiting, at least for
me as a programmer, to think the application as a finite state machine
only. Any time I need to introduce a new state in my application, I
have to reconsider all the transitions to that state, and the impact
it has on the existing system.

I'd be more happy if I can describe the flow in a "normal" programming
language, where I can express complex flow by writing a program. This
is what I'm trying to do in the Schecoon sub-project. Using the Scheme
language, and the fact that continuations are first class objects in
it, I want to implement the ideas described in the resources I
mentioned earlier. But the language to describe the flow will not be
Scheme, but one with a more familiar syntax.

Best regards,
-- 
Ovidiu Predescu <[EMAIL PROTECTED]>
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to