From: Brian Candler Date: 2003-05-08T07:23:09+09:00 Subject: Re: Why is PHP so popular? What can we learn from the PHP camp? On Wed, May 07, 2003 at 11:11:30PM +0900, Rasputin wrote: > Client side Java - particularly GUI code - is absolutely awful. > 'Write once, debug everywhere'. Life's too short. > > Server-side, it's a different story. The servlet API is a joy to use, and > speedwise it p*sses all over CGI. - being able to initialise your DB > connection when the server boots then re-use it is a real boon. I've seen some *real* bad server-based Java/servlet/Tomcat applications - servers needing to be kicked several times per day. Maybe I've been unlucky, and there are good solutions out there too. > IMO, ruby appservers are the way to go, rather than a CGI-based approach > have persistent objects on the server, and spawn a new thread for each client. > The servlet model is A Good Thing for OOP code, as opposed to a > 'when the client connects fork off a shell with this in' legacy approach. You can go this way with Ruby easily enough: Webrick supports this sort of 'servlet' approach. My personal favourite du jour is FastCGI. Each app has a pool of processes handling one request at a time: this means that thread interactions are not a concern, and it helps concurrency especially with databases (Ruby's cooperative threading means that the whole interpreter blocks if one thread has issued a slow query and is waiting for the response, for example; it's not a problem if the queries are issued from separate processes) You still end up working with the CGI model of stateless request-response, but at least it's familiar :-) I think I would like the Borges/Seaside approach using continuations, if I could understand it properly. Regards, Brian.