Article View: aus.computers.java
Article #820Re: Java or PHP? Serious decision to make
From: Tom Davies
Date: Mon, 01 May 2000 00:00
Date: Mon, 01 May 2000 00:00
89 lines
5712 bytes
5712 bytes
Brad, I'm not experienced at using PHP, but I am experienced with Java and web applications. I assume you are evaluating a server-side language -- while Java applets work well in Intranet environments there are not enough good JVMs in people's browsers for non-trivial applets to be a good idea, IMHO. Java on the server, with JSP (Java Server Pages) and Java Servlets are a Good Idea. For us, PHP is simply not an option, as we are developing an application that happens to have a web front end. We need several 100KSLOC of business logic which can be used from whatever interface we decide to write. Given that your platform is Linux, Java wouldn't have been an option until recently, as there wasn't a really good JVM for it. Sun and Inprise now support Linux with a 1.2.2 JDK, so that isn't an issue. The main advantage I see to Java is that it is a 'real' programming language with a full OO featureset, giving you the modularity, scalability (in terms of lines of code), reuse and maintainability you want. There's also plenty of free third party software available -- e.g. XML parsers, HTML generation libraries. The learning curve for Java is very quick if you are coming from C++ (just stop deleteing :-) There are certainly more experienced Java programmers around than PHP programmers. Java has much faster development time in comparison to C++, due to a better library, and (more importantly) to garbage collection. Java connects very well to Oracle databases -- Oracle has 'bet the farm' on Java, and in fact has a web server and servlet engine built into the DB server in Oracle8i. This has the advantage of less communication overhead between the servlet and the DB, although I haven't used it myself so I don't know how effective this is. I imagine PHP is simpler than Java for simpler things. I'm not sure what you mean by 'power functions'? I think that a model which takes advantage of Java's strengths is to combine JSPs and servlets -- the servlet processes a request, using the parameters to instantiate a Java object which contains the data needed for the response page. This is given to a JSP which uses it to produce an HTML page. By doing things this way, the only code embedded in the JSP page is simple iteration, conditional and member access code. The business logic is all in classes used by the servlet. There are certainly other options. Have a look at http://www.servlets.com/soapbox/problems-jsp.html, http://webmacro.org and look at Cocoon from java.apache.org. To me, the really important thing is to have a framework that is servlet based, so that you have access to the full power of Java. If someone wrote a PHP servlet, so that simple pages could be done with PHP but more complex stuff would be able to call Java with no overhead, that would be great -- as long as you made sure that you didn't duplicate business logic in both environments, which would cause maintenance hassles. The question I'd ask of PHP is: what do you do when PHP isn't enough? (e.g. when you find you want a serious in memory data structure) There may be a good answer to this question -- I don't know PHP well enough to be sure. Hope this helps, Tom Brad Willcott wrote: > > Hi there. > > Firstly, this is NOT a challenge for a fight to the death, but a > serious request for real-world experience advise. So no flames please. > > I am trying to decide on a company standard for Web development. I am > in the process of converting the company's servers from M$ NT Server 4 > to RedHat 6.2 Linux. This, ofcourse includes the Web server. I am > pretty much sold on using Apache, and have already got an experimental > server running with modules for: Perl, SSL, PHP and FrontPage 2000 > Extensions. > > My question to you folks, is what are the reasons for/against using > Java (not Javascript) and/or PHP as my company's web development > language? As yet I have no preferrance for either apart from PHP's > Open Source philosophy. I am interested in information on such things > as: Learning curve, development/maintenance time, flexibility, > accessing back-end Oracle databases, simplicity, power functions, etc. > > Perhaps you may feel it benefitial to use both. Why? Why not? > > We will be developing Web sites of varied styles and complexities. > Many accessing back-end databases requiring complex relationships and > integrity checking. Some will have two views of the database: > Client/Customer view, and Company/Data Maintenance view. I'm looking > to develop browser based data systems. > > So, I wish to thank you all, in advance for your input to this > discussion.
Technical Details
Message-ID:
<390D7179.1F941D@smartchat.net.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<20000427.8194900@devserver.act.ewsystems.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ce1c,5221373be980f1b9 X-Google-Attributes: gid10ce1c,public X-Google-Thread: 10b1d3,5221373be980f1b9 X-Google-Attributes: gid10b1d3,public X-Google-Thread: 10d6db,5221373be980f1b9 X-Google-Attributes: gid10d6db,public From: Tom Davies <tom@smartchat.net.au> Subject: Re: Java or PHP? Serious decision to make Date: 2000/05/01 Message-ID: <390D7179.1F941D@smartchat.net.au> X-Deja-AN: 617686925 Content-Transfer-Encoding: 7bit References: <20000427.8194900@devserver.act.ewsystems.com.au> To: Brad Willcott <brad@ewsystems.com.au> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@connect.com.au X-Trace: merki.connect.com.au 957145338 16152 210.8.10.195 (1 May 2000 01:42:18 GMT) Organization: Customer of Connect.com.au Pty. Ltd. Mime-Version: 1.0 Reply-To: tom@smartchat.net.au NNTP-Posting-Date: 1 May 2000 01:42:18 GMT Newsgroups: aus.computers.java,ba.php,ufra.lists.php