cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: [RT] Flowmaps
Date Thu, 20 Jun 2002 08:06:42 GMT
Ovidiu Predescu wrote:

...

> You can also do everything in JavaScript, but beware that you're moving the
> business logic in JavaScript, where it shouldn't be.


Where should it be then (not provocative, just a question I cannot 
simply answer myself)?

I think that if we don't come up with a business-logic framework of some 
sort, we will see programmers do the most wild things.

IMNSHO, Cocoon should be PnP, and not *require* java programming, ie no 
compilation step.

<user-perspective>
   Assuming that I want to make my business rules *without* java, what 
can I use?
   Where do I put them?
   How do I organize them?
   Is there a repository for them?
   How do I use them in the flow?
   How do I make transactions?
</user-perspective>

 >  This is great for rapid
> prototyping however. Here's how you'd write in it JavaScript (beware, not
> tested):
> 
> importPackage(java.sql);
> 
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> Connection conn  = DriverManager.getConnection(
>                    "jdbc:mysql://localhost/test?user=...&password=...");
> Statement stmt = conn.createStatement();
> ResultSet rs = stmt.executeQuery("SELECT field from MyTable");
> ...
> 
> 
> The EJB sample would look similar, where you use JNDI to lookup your EJB
> bean and access it:
> 
> importPackage(javax.ejb);
> importPackage(javax.naming);
> importPackage(my.very.own);
> 
> Context ctx = getInitialContext();
> SomeBeanHome beanHome
>   = (SomeBeanHome)ctx.lookup("my.very.own.SomeBeanHome");
> SomeBean bean = beanHome.create();
> ...

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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


Mime
View raw message