cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Edwards <tedwa...@civica.com.au>
Subject Re: FLOW & inserting data to SQL
Date Tue, 27 Jan 2004 22:30:25 GMT
Hi Joose,
check out the Petstore example for ideas on how to access databases from 
flow. I'm using flow to access an Informix database and a MySql database.
Its a snap.
I take Joerg's point about the separation of concerns, however but if 
you design your flowscripts carefully you can still achieve some 
semblence of SOC, for example, I shove all my database actions into a 
separate flow script (usersDB.js for example).
The main advantage it offers me is that I'm not mired in coding Java all 
day. If I need to swap to a java based data access I can make the calls 
from my userDB.js script.
Hope this helps.

Tony

Joerg Heinicke wrote:

>On 27.01.2004 13:14, Joose Vettenranta wrote:
>  
>
>>Hello,
>>
>>I've seen lot's of discussion back and forward on the subject "how to
>>    
>>
>to 
>  
>
>>save/retrieve data from SQL-server from flow-script" but I have never 
>>really seen any answers how to do that. So, how can I do simple UPDATE
>>    
>>
>
>  
>
>>command to database from flow script?
>>    
>>
>
>Don't do this in the FlowScript because it is only the controller. 
>Updating the model is part of business logic and so do this stuff in 
>Java classes that you call from the flow script: Separation of Concerns.
>
>Joerg
>
>  
>
>>basic structure of my flow script is:
>>
>>do {
>>  SendPageAndWait ("foo", "page: page);
>>  if (cocoon.request.get (stuff) matches logical expression)) {
>>    UPDATE table SET stuff=valueFromForm
>>    page++;
>>  }
>>} while (page < 10);
>>
>>that is the basic structure of the flow script I'm trying to create.
>>
>>- Joose
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message