Click to See Complete Forum and Search --> : Your thoughts on jsp or php.
snuck
02-02-2006, 04:41 PM
I am about to undertake the creation of a large web project, and would like a little advice.
I have some php experience, which obviously is a plus for that, however since I learnt it I've started university, and for the last year have been writing lots and lots of java every week. That said however I've not come into contact with jsp at all.
Whilst trying to avoid a flame war, what are you (backed up) thoughts on php vs jsp in general, and how much of an advantage would the fact that I have to write so much java that all I need do is sit at a keyboard and java code falls out be?
Thanks for your help.
bwkaz
02-02-2006, 07:50 PM
Java or PHP, huh? My answer: Python! :p
Seriously, though, PHP is problematic if you have to do a database interface. Java I just don't like (yes, yes, personal preference, I know). Python or Lisp is what I'd use, and Python is probably easier to learn. :)
voidinit
02-03-2006, 03:47 AM
Though you can probably do all of this in any other language, here's the benefits to .jsp.
1.) You don't have to invent any wheels. You can write huge applications in jsp just by writing "glue" code that ties together multiple libraries.
2.) Hibernate: The OO mindset makes the most sense to me. However, I hate breaking down an objects fields to store them into seperate columns of a database. Enter Hibernate. Basically with hibernate you tell hibernate to go store a plain 'ol java object, and it does sans serialization. Hibernate automatically maps an objects fields to columns in a database. It does relations, autogeneratred primary key schemes, transactions all that.
3.) Jakarta commons: Need to do something really difficult like multi-part form data for file uploads? It's probably been done before and it was probably done by Apache's jakarta. Look at their libraries and you'll see you can develop whole applications just by stringing their libs together.
4.) Log4j: Too much to describe. Once you get the hang of it though you have an entire logging framework that won't slow your application by much ready to go.
5.) The full J2EE package. If jsp isn't enough, bolt on a framework and you have ejb, xml-rpc, jmq all ready to go.
6.) Message Queues: This is a big deciding factor in many projects. A message queueing system (JMS) brings application communication to a whole new level. I can't think of another framework or system that allows for such a complete message framework, but remember I'm no PHP/Python/Perl expert. At work messaging is the new black. Look at ActiveMQ or JBossMQ for implementations of the message API. Basically you have queues and topics. A queue has many publishers, but one consumer at a time in a first come first serve fasion. A topic has many publishers and all consumers get the message. The publisher gets a handle to the message queue/topic, then fires a message down it. (A message is an object that can contain just about anything) The consumer get's the message delivered to it's onMessage(javax.jms.Message message) method and acts upon it. For a transaction based system, like credit card processing (that's what I do), it's a godsend.
snuck
02-06-2006, 08:10 AM
Thanks guys :)