I am disheartened by reading the comments... people, PLEASE for once in life go and read Java EE specs and see what it is intended to do.
Java EE is a framework to write business applications, for any kind of business, from issue trackers to ERP, the "business" in it doesn't mean "$$$ business" literally.
Maybe I am in the minority but I have spent a lot of time reading the Java EE specs and trying to implement them. After implementing them for a couple of years I realized that Java EE is a solution looking for a problem. After writing applications for small web startup to a top financial institution, my reflection is that EE breaks KISS. The spec tries to be everything for everyone and thus is overly complex for most business applications and for all the benifits it is supposed to offer it creates as many problems.
Example if you look at the Entity Bean OR mapper locking specs you will see that if you have any kind of load (Assuming one of the E stands for enterprise that is generally true) well you get locked up if more than one thread is trying to access that object at a time and your concurrency breaks down and if you are using a good provider it start spouting out Deadlock Exceptions. After I tweaked the provider to turn some of the "EE features" off, made a lot of work arounds and wrote a lot of scripts to generate all kinds of code I finally had something useful.
BEGIN RANT
Now I do not claim to be some super coder. My experience is that all the things EE spec was supposed to do it didn't. Unlike the servlet spec we still have vendor lock down, we have more code (XML, umpteen million interface files, lots of wrappers code that needs script generators or xdocletization) all so we can move data in and out of a database and on to a web page or GUI.
END RANT
I am planning on developing some QT applications and using netbsd for the os. I was leaning twards a AMD dual atholon but was wondering if anybody had recommendations for soemthing else (say 64 bit)?
Links to where to buy would be cool also:) THanks.
I can't think of a single occasion where this would be desirable.
You are correct in web scripting there is no place I can think of either. But I am refering to application development specifically server side application development in which there is a lot of places that this is desirable. For example if you need to create a thread to communicat with SAP or any legacy application. Ofcourse PHP would be a bad choice to for integrating these types of systems (large systems). And so I digress.
The discussion is I thought was about J2EE vs. PHP not Java vs PHP. So I was comparing J2EE functionality to PHP. However ofter a night of sleep and reading you post. I should not expect PHP to act like an OO language. I should expect it to act like a web scripting langage.
The reason I don't use PHP on big projects is based on fine grain of control and flexablity. If you have used both Java and PHP then it is clear which supports a larger and more powerful set of OO features. There are a lot of application that are simple and thus can be solved using PHP. Applications that require complex processes, use of threads, network communication (not just within a quick web page), data mining and clients that are not web based such as GUI's and external applications I believe that the choice is clear.
I have found that large applications leave the limitations of the web server. External processes are need and that is why Java I have found is a much better solution than PHP.
"PHP frees me from having to think about database pooling because it takes care of all the dirty work for me." JBoss frees me from thinking about database poooling too. I don't get your point.
"PHP is also much faster then any solution coded with EJB. In fact any solution coded with EJBs is significantly slower then just about any other technology. If you don't believe me go visit theserverside.com and read some the their benchmarks." For applications that don't have complex state and complex client to client or client to server interactions PHP is much faster. PHP caching and the caching you have describe probably works great for sites that have lots of reads and very few writes. Just like MySQL is faster than PostgreSQL because it reads fast. Once you have lots of writes MySQL dies. This is true about when PHP has lots of writes the data gets old really fast. If you where caching from a row level your cache would not get stale. In message boards this is probably fine but in a stock application it is a lot different.
The PHP scripts are run via cron just like any other script
So you use cron to schedule you PHP scripts not PHP. The main distinction I believe I am trying to make here is that PHP runs in a Apache process. Java runs in some type of EJB server. All the EJB servers I know of support some type of shedule event by desing. This is a more eligent implementation IMHO. Also there are a lot useful API's that can be access from Java into the EJB server than PHP into Apache. I guess it just boils down to flexablity and features. Java provides more of both for serverside programming. Threads can be created that run long past the connection closes. In PHP you do not have access to Threads.
One thing may clear this up. Have you used any one of these languages Java,Pyhton or C++? If I understand you posts correctly you are suggesting that PHP OO can hold a stick to Java. If this is the case I wonder how much Java web development have you done? Have you used any of these Velocity,Jython, Taglibs, or EJB? How many 100K objects do you pass around in you PHP applications? Passing by reference ? Last time I tried PHP with lots of object I kept getting out of memory errors. Well I guess I should have thought to myself it make complete sense that PHP would pass be value instead of by refrence. And I should use a _work_around_ to fix it. And I should build my own intelegent object caching.
Oh one more thing how do you get connection pools form PHP or does every Apache proccess have to create a database connections?
Try require() [php.net] and include() [php.net] Use it all the time. I don't think it is nearly as good a packages in java in a large project. Small projects it works great.
Ask these [zend.org] guys about compiling PHP scripts. Alternatively talk to these [php-accelerator.co.uk] guys about caching your interpreted, 'compiled' code. Alternatively if you want the ability to take control over you application and really do some cool stuff with caching/cluster ect.. try these guys JBoss If you read about there Interceptors you may see what kind of control I am talking about.
PHP fully supports ncurses for direct input. Also, I personally have written quite a few small daemons with PHP which had their own UI. Example code to write your own can be found under this [php.net] section of the PHP manual. And I quote from the link you posted "This extension is EXPERIMENTAL". PHP is a web scripting language. If PHP does not become a generic scripting language it will probably suffer the same fate ColdFusion did. Why reinvent what Python already does and better. Python is a much better scripting language I am trying to use replace Python with all the stuff I currently use PHP for because I get things like... threading, OO stuff, application servers, PASS BY REFERENCE and a whole lot more.If I want to script I use Python.
it doesn't end at printf("Hello Your right you can extend all you want in C!! So you can get PHP to make RPC call into you EJB server when it is time to build a maintable, scalable large application. Not that you can't do it in PHP I have tried.. And I am sure you can it is just I found it a lot easier, faster and better to do it in Java.
Just thought I would add my flame to the fire. Lateef
Re:Seems like a silly move...
on
Yahoo Moving to PHP
·
· Score: 4, Interesting
J2EE or PHP? I had to make this decision myself. I would like to share some of the reasons I chose J2EE over PHP. J2EE is a specifaction that is implemented by Java. PHP is a scripting language that runs on web servers. One of the problems I came up against was writing PHP was fast but as soon as the application left the modules that where included by PHP you would have to write them in C/C++ and compile them into PHP. This was NOT maintable and C/C++ are not RAD (Rapid Application Development). Basically PHP is limited to the running inside of Apache which for a small site is not much of a limitation but all of the website I have worked this was a huge limitation. For example there is no way to schedule a PHP script to run without outside software. Java is a langauge that provides a lot of different ways to schedule events.
PHP has a couple major database interface problems that Java does not. One the database abstraction exist only by extention such as PEAR. Persitant connections create a connection for every Webserver process. So if I have n number of connections to the webserver I have n number of database connections. Since the query took a lot less time then it does to send the web page back to the client. For a small site this is no problem because there are very few connections at a time. But when you start dealing with multiple servers and large numbers of user connecting at the same time the database server soon cannot support he number of connections required. If you set connection pooling off this works OK for MySQL because it uses threads (this I don't get MySQL threads are ok but Java ones are not?) but Ohh.. my if one was to every use a database design for large systems such as PostgreSQL you would be creating heavy processes for every connection and again this would not scale. J2EE application servers use connection pooling:) and this is configurable so you can optimize it based on YOUR application not the number client connections.
PHP caching I have used very little of. I used the PEAR caching system and it works OK. The J2EE caching that I have used is the Jboss implementation. The J2EE caching is so much more finegrained than the PHP caching that it is almost like comparing applies to oranges. But J2EE has a concept of row level caching vs. PHP which has a concept of query level caching. My experience is that J2EE caching is faster and much more intelegent.
PHP supports objects... (sorta'). In the projects I have worked on it is really nice to have name space which is something PHP does not support. As the applications get larger I found that keeping track of all the PHP functions became cumbersome. Then I started using PHP objects which at first where great except they are limiting after you have used a more fullfeatures language like Java or Python. I thought I read somewhere that you can do pass by refrence in PHP but I haven't been able to find that link. I found out that the PHP objects where by default pass by value when I ran into out of memory errors. In small sites with small object complexity PHP works fine.
Generally I have found that large application evolve into supporting things I could have never imaged when I start working on it. If I where a C programmer then PHP might make sence because I could extend it to support all the features. But I don't have the time or knowlegde to become a really good C programmer so I use J2EE (Jboss).
Funny you mention JBoss! I have been thinking a lot about an open source accounting package. I came to the conclusion that it would be best implemented with J2EE. I think this is truely the only way to implement a modular and scalable mid to large accounting package.
Beacuse JBoss impements an ORB it would not be to difficult to have nice gui client but also the web client would be relativly easy to build with jsp/tag lib. Also the datasouce abstarction is so good.
Just my two cents.
M$ already has the great PR on the $ for schools thing. Now if the DOJ rejects the offer then the DOJ looks bad am M$ looks good.
What I think would do the most damage is for them to expose the hooks they put in LDAP for Active Directory so the good people at SAMBA. This is the direction that I believe would lead less M$ control.
Just my 2 cents.
First ofcourse great job to all the Slashdot admins for Tuesday and everyday!
A thought I had for a site that I am working on that Postgresql seems to scale better. Now I use persistant connections and I have to have transactions. The other site I work on I use MySQL and it is fast but Postgresql seems to scale better. Plus in the future as we grow we are looking at using Postgresql Replication (pgreplicator) or the other Replication options on Postgresql. I would think that this would increase performance by using this server.
As a disclamer I do not know much about how the Slashdot system works but I am wondering for others have feedback?
thanks
lateef
The ever important "we all have to eat" which I to have to eat! You write just becuase a technoligies is better it doesn't mean you will make any money off it. I am a Java programming consultant and there is more work than I can shake a stick at. Thus M$ is cumming out with C# becuase Java is so much better than anything else out there. As far as ASP/IIS vs PHP/Apache is concern if you develop a little in PHP/Apache then you would find out very fast how much faster eisier and more functional it is over ASP. Mostly you probably would have more fun.
Here is what I see for the future. Finally MCSE means nothing, it seemed like people thought if you knew what what going on. MCSE means you know how to use a mouse and click around. Now that that misinformed IT craze is over businesses will start looking for better technoligy. I see in the future businesses wanting platform independet modular solutions (non of wich microsoft provides).
Here is what I don't get though? Why would you buy a 50,000$ DB and then use ASP/IIS to connect with it. Why would they be willing to sacrafice the stability and uptime of a Uni* so they could run IIS? For the same reason why would anyone run Apache under Windows?
Using NT and Linux all the time there is no comparison on stability and reliability. Once I set up a web server runing PHP/Apache combo I can forget about it until the UPS dies. When I have to use Windows to test some an application the performance suck and if I push a lot of transaction through it down it goes again.
That is what I found using the two diffrent technologies.
The ever important "we all have to eat" which I to have to eat! You write just becuase a technoligies is better it doesn't mean you will make any money off it. I am a Java programming consultant and there is more work than I can shake a stick at. Thus M$ is cumming out with C# becuase Java is so much better than anything else out there. As far as ASP/IIS vs PHP/Apache is concern if you develop a little in PHP/Apache then you would find out very fast how much faster eisier and more functional it is over ASP. Mostly you probably would have more fun.
Here is what I see for the future. Finally MCSE means nothing, it seemed like people thought if you knew what what going on. MCSE means you know how to use a mouse and click around. Now that that misinformed IT craze is over businesses will start looking for better technoligy. I see in the future businesses wanting platform independet modular solutions (non of wich microsoft provides).
Here is what I don't get though? Why would you buy a 50,000$ DB and then use ASP/IIS to connect with it. Why would they be willing to sacrafice the stability and uptime of a Uni* so they could run IIS? For the same reason why would anyone run Apache under Windows?
Using NT and Linux all the time there is no comparison on stability and reliability. Once I set up a web server runing PHP/Apache combo I can forget about it until the UPS dies. When I have to use Windows to test some an application the performance suck and if I push a lot of transaction through it down it goes again.
That is what I found using the two diffrent technologies.
"(User #448875 Info) http://www.geocities.com/carlgt1
I think the development is easier & faster in IIS, e.g. using VB or C++ for distributed COM DLL's; or just using ASP pages with ADO or Oracle Objects for OLE. So right there is a big reason I know a lot of places like IIS.
"
I think development is easier & faster on Apache, e.g. using PHP or Java. First of all it is important to point to the enviornment that I am developing on, Linux. Windows as much as it tries does not have a console, and I mean a full featured console not some lame non-maximizing thing.
It is much easier, faster (perfomance and time) and with more funcitonality develop a web site in PHP vs ASP (PHP can access COM object). If we are talking a web application which is diffrent than a web site then JSP/Servlet in the long run offers more bang for the buck.
Apache running on a 486 can probably put out 10mb of static web pages (can IIS even run on a 486?). From a developers point of view Apache takes up very little resources and can be configured to integrate with more systems then IIS. From a development stand point the more options I have the better.
Did I mention the $$$$?
Maybe I am in the minority but I have spent a lot of time reading the Java EE specs and trying to implement them. After implementing them for a couple of years I realized that Java EE is a solution looking for a problem. After writing applications for small web startup to a top financial institution, my reflection is that EE breaks KISS. The spec tries to be everything for everyone and thus is overly complex for most business applications and for all the benifits it is supposed to offer it creates as many problems.
Example if you look at the Entity Bean OR mapper locking specs you will see that if you have any kind of load (Assuming one of the E stands for enterprise that is generally true) well you get locked up if more than one thread is trying to access that object at a time and your concurrency breaks down and if you are using a good provider it start spouting out Deadlock Exceptions. After I tweaked the provider to turn some of the "EE features" off, made a lot of work arounds and wrote a lot of scripts to generate all kinds of code I finally had something useful.
BEGIN RANT
Now I do not claim to be some super coder. My experience is that all the things EE spec was supposed to do it didn't. Unlike the servlet spec we still have vendor lock down, we have more code (XML, umpteen million interface files, lots of wrappers code that needs script generators or xdocletization) all so we can move data in and out of a database and on to a web page or GUI.
END RANT
Feels good to get that off my chest.
I am planning on developing some QT applications and using netbsd for the os. I was leaning twards a AMD dual atholon but was wondering if anybody had recommendations for soemthing else (say 64 bit)?
:)
Links to where to buy would be cool also
THanks.
Does anyone know if suse 9 supports NPTL?
I can't think of a single occasion where this would be desirable.
You are correct in web scripting there is no place I can think of either. But I am refering to application development specifically server side application development in which there is a lot of places that this is desirable. For example if you need to create a thread to communicat with SAP or any legacy application. Ofcourse PHP would be a bad choice to for integrating these types of systems (large systems). And so I digress.
The discussion is I thought was about J2EE vs. PHP not Java vs PHP. So I was comparing J2EE functionality to PHP. However ofter a night of sleep and reading you post. I should not expect PHP to act like an OO language. I should expect it to act like a web scripting langage.
The reason I don't use PHP on big projects is based on fine grain of control and flexablity. If you have used both Java and PHP then it is clear which supports a larger and more powerful set of OO features. There are a lot of application that are simple and thus can be solved using PHP. Applications that require complex processes, use of threads, network communication (not just within a quick web page), data mining and clients that are not web based such as GUI's and external applications I believe that the choice is clear.
I have found that large applications leave the limitations of the web server. External processes are need and that is why Java I have found is a much better solution than PHP.
"PHP frees me from having to think about database pooling because it takes care of all the dirty work for me."
JBoss frees me from thinking about database poooling too. I don't get your point.
"PHP is also much faster then any solution coded with EJB. In fact any solution coded with EJBs is significantly slower then just about any other technology. If you don't believe me go visit theserverside.com and read some the their benchmarks."
For applications that don't have complex state and complex client to client or client to server interactions PHP is much faster. PHP caching and the caching you have describe probably works great for sites that have lots of reads and very few writes. Just like MySQL is faster than PostgreSQL because it reads fast. Once you have lots of writes MySQL dies. This is true about when PHP has lots of writes the data gets old really fast. If you where caching from a row level your cache would not get stale. In message boards this is probably fine but in a stock application it is a lot different.
I think truely the devil is in the details.
The PHP scripts are run via cron just like any other script
So you use cron to schedule you PHP scripts not PHP. The main distinction I believe I am trying to make here is that PHP runs in a Apache process. Java runs in some type of EJB server. All the EJB servers I know of support some type of shedule event by desing. This is a more eligent implementation IMHO. Also there are a lot useful API's that can be access from Java into the EJB server than PHP into Apache. I guess it just boils down to flexablity and features. Java provides more of both for serverside programming. Threads can be created that run long past the connection closes. In PHP you do not have access to Threads.
One thing may clear this up. Have you used any one of these languages Java,Pyhton or C++? If I understand you posts correctly you are suggesting that PHP OO can hold a stick to Java. If this is the case I wonder how much Java web development have you done? Have you used any of these Velocity,Jython, Taglibs, or EJB? How many 100K objects do you pass around in you PHP applications? Passing by reference ? Last time I tried PHP with lots of object I kept getting out of memory errors. Well I guess I should have thought to myself it make complete sense that PHP would pass be value instead of by refrence. And I should use a _work_around_ to fix it. And I should build my own intelegent object caching.
Oh one more thing how do you get connection pools form PHP or does every Apache proccess have to create a database connections?
Try require() [php.net] and include() [php.net]
Use it all the time. I don't think it is nearly as good a packages in java in a large project. Small projects it works great.
Ask these [zend.org] guys about compiling PHP scripts. Alternatively talk to these [php-accelerator.co.uk] guys about caching your interpreted, 'compiled' code.
Alternatively if you want the ability to take control over you application and really do some cool stuff with caching/cluster ect.. try these guys JBoss If you read about there Interceptors you may see what kind of control I am talking about.
PHP fully supports ncurses for direct input.
Also, I personally have written quite a few small daemons with PHP which had their own UI. Example code to write your own can be found under this [php.net] section of the PHP manual.
And I quote from the link you posted "This extension is EXPERIMENTAL". PHP is a web scripting language. If PHP does not become a generic scripting language it will probably suffer the same fate ColdFusion did. Why reinvent what Python already does and better. Python is a much better scripting language I am trying to use replace Python with all the stuff I currently use PHP for because I get things like... threading, OO stuff, application servers, PASS BY REFERENCE and a whole lot more.If I want to script I use Python.
it doesn't end at printf("Hello
Your right you can extend all you want in C!! So you can get PHP to make RPC call into you EJB server when it is time to build a maintable, scalable large application. Not that you can't do it in PHP I have tried.. And I am sure you can it is just I found it a lot easier, faster and better to do it in Java.
Just thought I would add my flame to the fire.
Lateef
J2EE or PHP?
:) and this is configurable so you can optimize it based on YOUR application not the number client connections.
... (sorta'). In the projects I have worked on it is really nice to have name space which is something PHP does not support. As the applications get larger I found that keeping track of all the PHP functions became cumbersome. Then I started using PHP objects which at first where great except they are limiting after you have used a more fullfeatures language like Java or Python. I thought I read somewhere that you can do pass by refrence in PHP but I haven't been able to find that link. I found out that the PHP objects where by default pass by value when I ran into out of memory errors. In small sites with small object complexity PHP works fine.
I had to make this decision myself. I would like to share some of the reasons I chose J2EE over PHP.
J2EE is a specifaction that is implemented by Java. PHP is a scripting language that runs on web servers. One of the problems I came up against was writing PHP was fast but as soon as the application left the modules that where included by PHP you would have to write them in C/C++ and compile them into PHP. This was NOT maintable and C/C++ are not RAD (Rapid Application Development). Basically PHP is limited to the running inside of Apache which for a small site is not much of a limitation but all of the website I have worked this was a huge limitation. For example there is no way to schedule a PHP script to run without outside software. Java is a langauge that provides a lot of different ways to schedule events.
PHP has a couple major database interface problems that Java does not. One the database abstraction exist only by extention such as PEAR. Persitant connections create a connection for every Webserver process. So if I have n number of connections to the webserver I have n number of database connections. Since the query took a lot less time then it does to send the web page back to the client. For a small site this is no problem because there are very few connections at a time. But when you start dealing with multiple servers and large numbers of user connecting at the same time the database server soon cannot support he number of connections required. If you set connection pooling off this works OK for MySQL because it uses threads (this I don't get MySQL threads are ok but Java ones are not?) but Ohh.. my if one was to every use a database design for large systems such as PostgreSQL you would be creating heavy processes for every connection and again this would not scale. J2EE application servers use connection pooling
PHP caching I have used very little of. I used the PEAR caching system and it works OK. The J2EE caching that I have used is the Jboss implementation. The J2EE caching is so much more finegrained than the PHP caching that it is almost like comparing applies to oranges. But J2EE has a concept of row level caching vs. PHP which has a concept of query level caching. My experience is that J2EE caching is faster and much more intelegent.
PHP supports objects
Generally I have found that large application evolve into supporting things I could have never imaged when I start working on it. If I where a C programmer then PHP might make sence because I could extend it to support all the features. But I don't have the time or knowlegde to become a really good C programmer so I use J2EE (Jboss).
What I would love a Velocity, Tomcat, JBoss book!!!
Funny you mention JBoss! I have been thinking a lot about an open source accounting package. I came to the conclusion that it would be best implemented with J2EE. I think this is truely the only way to implement a modular and scalable mid to large accounting package.
Beacuse JBoss impements an ORB it would not be to difficult to have nice gui client but also the web client would be relativly easy to build with jsp/tag lib. Also the datasouce abstarction is so good.
Just my two cents.
M$ already has the great PR on the $ for schools thing. Now if the DOJ rejects the offer then the DOJ looks bad am M$ looks good.
What I think would do the most damage is for them to expose the hooks they put in LDAP for Active Directory so the good people at SAMBA. This is the direction that I believe would lead less M$ control.
Just my 2 cents.
First ofcourse great job to all the Slashdot admins for Tuesday and everyday!
A thought I had for a site that I am working on that Postgresql seems to scale better. Now I use persistant connections and I have to have transactions. The other site I work on I use MySQL and it is fast but Postgresql seems to scale better. Plus in the future as we grow we are looking at using Postgresql Replication (pgreplicator) or the other Replication options on Postgresql. I would think that this would increase performance by using this server.
As a disclamer I do not know much about how the Slashdot system works but I am wondering for others have feedback?
thanks lateef
Miguel, http://www.go-mono.com/ideas.html#guavac
Here is what I see for the future. Finally MCSE means nothing, it seemed like people thought if you knew what what going on. MCSE means you know how to use a mouse and click around. Now that that misinformed IT craze is over businesses will start looking for better technoligy. I see in the future businesses wanting platform independet modular solutions (non of wich microsoft provides).
Here is what I don't get though? Why would you buy a 50,000$ DB and then use ASP/IIS to connect with it. Why would they be willing to sacrafice the stability and uptime of a Uni* so they could run IIS? For the same reason why would anyone run Apache under Windows?
Using NT and Linux all the time there is no comparison on stability and reliability. Once I set up a web server runing PHP/Apache combo I can forget about it until the UPS dies. When I have to use Windows to test some an application the performance suck and if I push a lot of transaction through it down it goes again.
That is what I found using the two diffrent technologies.
Here is what I see for the future. Finally MCSE means nothing, it seemed like people thought if you knew what what going on. MCSE means you know how to use a mouse and click around. Now that that misinformed IT craze is over businesses will start looking for better technoligy. I see in the future businesses wanting platform independet modular solutions (non of wich microsoft provides).
Here is what I don't get though? Why would you buy a 50,000$ DB and then use ASP/IIS to connect with it. Why would they be willing to sacrafice the stability and uptime of a Uni* so they could run IIS? For the same reason why would anyone run Apache under Windows?
Using NT and Linux all the time there is no comparison on stability and reliability. Once I set up a web server runing PHP/Apache combo I can forget about it until the UPS dies. When I have to use Windows to test some an application the performance suck and if I push a lot of transaction through it down it goes again.
That is what I found using the two diffrent technologies.
I think development is easier & faster on Apache, e.g. using PHP or Java. First of all it is important to point to the enviornment that I am developing on, Linux. Windows as much as it tries does not have a console, and I mean a full featured console not some lame non-maximizing thing.
It is much easier, faster (perfomance and time) and with more funcitonality develop a web site in PHP vs ASP (PHP can access COM object). If we are talking a web application which is diffrent than a web site then JSP/Servlet in the long run offers more bang for the buck.
Apache running on a 486 can probably put out 10mb of static web pages (can IIS even run on a 486?). From a developers point of view Apache takes up very little resources and can be configured to integrate with more systems then IIS. From a development stand point the more options I have the better. Did I mention the $$$$?