First of all excuse me if I am posting something that has been discussed many times.
I have a few small and medium projects and I want to choose an abstraction layer for them. I have prepared my UI and Business layers and now I need a decent object oriented library for my Data Layer.
I have looked at ADODB and have tested it in some small scripts. Recently I read some articles in PhpPatterns website which mention Eclipse library. I have also looked at PEAR (which I decided to put away because they are not present everywhere) and PHPLib (which does not seem as efficient as others to me).
1- As I have written everything (UIL and BL) in OOP I prefer something that matches my current and new OOP codes.
2- I need a fast library because some of my websites have a really high traffic (40000 page views/day) and on small websites I prefer to have a really fast pages. I have read somewhere that ADODB creates a lot of overhead (ie of a lot of delay on pages).
Anyway I will appereciate if someone can help me choose between Eclipse and ADODB (or suggest something else?).
I'm a little confused with your requirements. Even if I assume that those 40k hits/day happen in 12 hours that is still less than a hit per second. You .sig indicates that you've done stuff with ASP. While it pains me to ever recommend a Microsoft solution I think that ASP is more likely to be a viable solution than PHP. PHP is just starting to have OO type features. In the Microsoft world I'm sure you're familiar with the ".uh oh" version of software. I can't believe that PHP 5.0 will be production quality right away given that it is still just in RC state.
I know that you're not likely to want to make a radical technology change so I won't push my personal bias of JSP/Servlets (but I'm positive that I can handle more hits/second on the same hardware vs. PHP without caching). However, for performance I'd strongly encourage you to stay away from an interpreted language like PHP. Yes, you can duct tape on lots of things to make it go faster. But your requirements of OO and speed really make it harder to recommend.
Thank you very much for your oinions. In fact these websites are running on a shared server. This is why I consider this rate as a high traffic website. Also hits are gathered arround 3-4 hours of a day.
OO currently exists in PHP4 but it is not very mature but I do with it for the time being. IbForums is an example of a great PHP4 OO program. In fact we just use general features like classes etc.
And about J2EE (JSP/Servlet specifically) , I like it but the problem is that most of my projects will run on low cost shared accounts on the internet and you rarely find a hosting company which provides such services at a reasonable price (unfortunately). Though I have passed MCAD exams I rarely suggest .NET solution to my customers for the same reason. (cost, high load on shared servers etc).
Re: Object Oriented PHP, Eclipse , ADODB or other?
Originally posted by wmac I have looked at ADODB and have tested it in some small scripts. Recently I read some articles in PhpPatterns website which mention Eclipse library. I have also looked at PEAR (which I decided to put away because they are not present everywhere) and PHPLib (which does not seem as efficient as others to me).
PEAR DB is the closest thing you get to a standardized database abstraction layer in PHP. I don't really get your point of PEAR DB "not [being] present everywhere": First of all, it's present on all default installations. Secondly, the other database abstraction layers you mentioned are never present by default - so why would you want to dismiss PEAR DB which is present in most of the cases?
I saw somebody mentioned J2EE. I am sure you know that the predominant programming environment and language among Fortune 500 is J2EE/Java as it's related to the web-centric applications and OOP. Why? The notion that you should spent abnormal amount was perpetrated by "big" vendors. I have the environment when one single command will create tables in a database and associated java classes with support of ACID and other things. Now, it cost me $0.00 and my application back-end is almost ready. Is this nice? And all that is Java/XML/OOP. Yep, I am using Eclipse, but for a different reason.
I am compelled to respond. I also worked with banks, many banks. I found out that they were forced by the "big" vendors to buy $300,000.00++ software infrastructure even before of buying or development an application. You know that from your experience.
In the end I came up with a similar to Websphere, SunONE, Weblogic solution and was able to implement it in few places, including DuPont interactive website. One of the advantage of my approach to compare it with a canonical J2EE based development is a rapid delivery of a production software. In case of DuPont we were able to deliver product in less than 5 months - typical time is 12-18 month, as you know. I think now it could be reduced down to 2-3 months. And the most impressive point, it was built with almost ZERO COST software infrastructure. Now, forget about 2-3 months. Who wants to wait? Think about an universal software platform in Java with pluggable business modules – portals, e-commerce, collaboration (CRM), ERP, etc. available out-of-box.
Would it be acceptable by this audience to have everything or even more what JPMorgan, CVS/pharmacy, UPS, etc have, but for the 1% or less what they paid? It will still be cheaper than PHP based solution, and much faster, more reliable, scalable for millions of users when needed and if hardware permits.
Yes, the most interesting point about Java is that we always can find something free. Lot of people have developed different software in java and have made them available for free. Look at sourceforge and you will find CRM, Workflow and some other advanced things.
But yet if we want to think practical we should go to "Hosting Offers" forum and do a search on "J2EE". I found only 5 threads which offer J2EE. (Minimum price $25/month) And it does not gurantee that how many people will be on the same server .
We should agree that Java is either very slow (in comparison to PHP) or we need more powerful hardware. Isn't it?
1. Sourceforge is a great resource of the Open Source Software projects in many different languages including PHP and Java
3. I think we should agree that
- any scripting language is not as fast as compiled byte code and/or object code
- there are not known actual studies to compare performance of PHP/Phyton vs Java
- we know that very serious study (two actually) has been conducted by "The Middlware Company" to compare .NET(C#) and J2EE(Java). Here is short synopsis from the report summary of the second test. In first test .NET outperformed J2EE in an order of magnitude. Both tests were instigated by MS, in MS location;but first was designed with serious problems.
From the report:
" Web Application Test
......The test result showed that both .NET and the fastest J2EE platform performed approximately the same.
24 Hours Reliability Test
......The results of this test were that the fastest J2EE and the .NET platform performed almost identically, with less than 2% difference in performance.
- You will not contest that PHP is much slower than language it written in (cousin of C#). In different words - nobody would suggest that scripting language PHP is faster than C#, C, C++ compiled code in runtime environment.
4. Finally here is a few additional considerations wriiten by one guy. I don't think I can do it better.
"The installation base is the primary reason I'm using PHP for a project now; it's intended for use by novices who most likely are in a virtual hosting environment without access to a servlet container. But whenever I'm working on it I find myself longing for a lot of the features of Java.\n\n Simply put, Java is a real programming language and PHP isn't. While you can code in a non-OO way with Java, anyone that uses it much has the whole concept drummed into their heads at an early stage. So even a rotten app written in Java is generally much more maintainable than one written in PHP. The language is bigger, it's more flexible, and it gives you much finer-grained control over what's going on than does PHP. Want a GUI? No problem. Database connection pooling? Ditto. A multi-threaded app? Objects that persist between server calls? To use XML and XSL? You get the idea.\n\n And there are so many fantastic open-source resources for Java. Jakarta awes me, and so does a lot of the stuff on sourceforge. I'm learning Ant, Hibernate and the JSTL right now--it's like being a kid in a candy store. By contrast, what's available for PHP is a joke. Sure, Metabase and Smarty are both good projects, but I have a hard time thinking of any other decent PHP libraries (and that includes what's in PEAR). And those examples aren't anywhere near the functionality and maturity of Eclipse or Cocoon, just to name two.\n\n My thought: if you want to hack out a webapp in a weekend, definitely go with PHP. If you're building anything you're going to be stuck maintaining for a while, or even rebuilding a Java app that completely stinks, salvage as much of the code as you can and stay with Java. You'll be much happier in the long run.\n\n"
It was written last year. Few things are different now in a Java world, for instance formalization of "Attributes and Aspects Oriented Programming"