JD Daniels wrote:

Derek:

Short answer: I'm Hiding from it. heh heh. I have a project now that is a month overdue because I tried to jump on the woody --> Cforms bandwagon. I am just not Java literate enough. I came from php... it is the separation of content and logic that made me move to cocoon initially. xsps are used strictly to produce xml data. thats why i came here. the prospect of sax in php was too much for me. My Ideal development would be:

Java Object --> Methods to add, remove, edit things

Flow --> Tells the java objects what to do

Cforms --> The end user's tool to tell the flow what they want to do

JXTemplate --> Cform's method of showing the end user the options


What is stopping me from this utopia of web development is:


PHP:

switch ($formitems)
{
  case count($formitems)>1:
     $itemids=implode("','",$formitems);
     break;

  case count($formitems)==1:
     $itemids=$formitems["0"];
     break;

  default:
     break;

}

$whereclause="WHERE lid IN ('$lid')";

Java:

Huh? switches only work for booleans??
There's how many types of arrays?? (But arrays don't exist? why is a list different from a collection?)


A switch works on integer numbers, an if statement works on boolean values.
There is only one Array type; there are zillions of arrays of other classes, eg String[] which are of type "Array of Strings".
A List is not different from a collection, it is part of the Collections framework like Map and Set.


If you're really going to use Java, I'd suggest a book on Java. Personally I think Core Java Fundamentals by
Horstmann and Cornell is good, but you're milage may vary:)


Now the first step of my utopia is a nightmare.
I can use xsp to use esql... which 98% of my stuff is merely viewing results from databases, so I can continue with my life while I try to learn java.


I think most of these types of comments come from PHP users like me...

When I first set myself down to play with a web site, dogpile (before google's time :P) put me onto a devshed article on php. so I says to myself : "Self, there must be an easier way to send an email from this form." go to php.net, type in "mail" in the function search box... five minutes later you are emailing. Say, MYSQL only like dates in a certain format. go search, get the date function your done.

In the sitemap the sendmail action, otherwise the Java Mail Api (available at SUN).


The next step:

I decide I love making things for people. I love watching front office staff beam when I remove 2/3 of their paperwork.
I like watching a manager's face when he can get a summary of what his company's status is at the the push of a button.


Time to step it up a notch. I go to a real estate office. Sit there for a few days, make notes, get a big list of how to make them more efficient. The result is a really good product. They love it. Generates excellent money for me and my family.

It is almost 8000 lines of php. Content and logic all mixed up. About 4 months in, they wanted a change. simple change really, but finding the spot and making the change to the 27 different places it was displayed in 9 different templates really, really was not fun.

So I start the search for a "perfect" template system. I discover XML + XSLT wow. straight data files I can format any way I want. This is where cocoon comes in. I don't worry about separating content and logic. It just happens by itself. but I have gone from fast logic development and horrible maintainence to super easy maintainence and a nightmare of logic development.

Sigh


I think that what people who are asking for "best practices", or "better documentation" are php converts who miss the simple days of " how do I do this? " and having an answer in minutes. The way i feel about the documention is I imagine searching php.net for the date function and getting a result that says " Yup we do that 5 different ways. Enjoy!" Very impressive, but I'm still stuck. *grin* But we all know that cocoon is not like that. It never will be. PHP is like that because it is a shortcut language to a bigger language. Cocoon is a framework where anything is possible. I think what the docs need is some good pointers to java development. answer questions like "Why should I use a bean?", "Compile your bean, put it here, and use in your flowscript this way"

Compile a class, put it in your cocoon/WEB-INF/lib, restart your container, and you can access it.


And of course the point of this big rant:

People will follow the easiest path. XSP can function like PHP. I dont think it is right, but it happens. I myself do not have much in the way of logic in my xsp, just esql queries. You'd think that select only queries would be fine, but.. well... when faced with changing a few lines to say UPDATE or INSERT from SELECT vs. learning how to make a java bean, get a handle on it in flow, and passing the result to JXTemplate.... um yeah I'm using xsp for DB updates. I dont want to, but I really get my arse confused trying to make sense of javadocs. Plus, from php.. edit->save->reload=ok that works to java .. edit, compile, upload, reload container, reload page... I know its bad, but I'm lazy 8-)

That's what I feel too. I know it;s possible, but the Wiki generally has an XSP example for just my case, and no flowscript example. It's a bugger but such is life:)


If there comes a time I actually have spare time, I want to UPDATE my skillset SELECT * FROM cocoon. But not yet.



Probably should shut up now :P


JD



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



Reply via email to