It’s not a kind of magic – php and Java together

First of all, do not get me wrong. I have my love towards scripting languages, mainly Python – that is very easily a godsend language to save us from Perl and other horrible deaths. But there are places where static typing has it’s clear benefits and actually helps us to do our work better.

I’ve been lately diving into a php-application that is quite well constructed, follows a very nice MVC-framework and all and all is programmed by guys who are worth their salt. But even then I feel the urge to cry out loud and show them a well constructed Spring Framework MVC-application with clean separtion of business logic, web flow and processing. Few years ago I cried how Java as a language prohibits us from doing things that we want, but lately I’ve really – really – started to like the clarity and structure that comes with good application of Spring Framework best practices and Java. Sure there is still some overhead that one has to do to get the project up from the ground, but after that it pays itself back.

Tool support is something that can not be undervalued and that is also where static typing helps a lot. When you have had to define datatypes that get passed around instead of just using arrays and lists of stuff, tools can guide you to work better and allow you to think in terms of the business goals that you are trying to achieve. With Spring this can come almost naturally, as it is very good practice build your service layers as separate beans and inject them into the controllers.

Luckily you can combine the speed of php development and prototyping with the robustness and quality of Spring framework. I’ve been testing Caucho resin and more importantly Quercus – php-engine written in java. With Quercus you can have views or even whole frontend code written in php, and use services and dao from java. I’m still in the progress of building a larger prototype and doing proper testing with higher loads and longer time running processes.

I’m yet to include also JavaRebel ( ) into the equation, allowing fast development also with java components. I’ve only done small scale tests with JavaRebel, but my gutfeeling is that next software components that I purchase for myself and other developers will be JavaRebel – and Resin Pro for the development server.

Kategoria(t): programming. Lisää kestolinkki kirjanmerkkeihisi.


Täytä tietosi alle tai klikkaa kuvaketta kirjautuaksesi sisään:

Olet kommentoimassa -tilin nimissä. Log Out /  Muuta )

Google+ photo

Olet kommentoimassa Google+ -tilin nimissä. Log Out /  Muuta )


Olet kommentoimassa Twitter -tilin nimissä. Log Out /  Muuta )


Olet kommentoimassa Facebook -tilin nimissä. Log Out /  Muuta )


Muodostetaan yhteyttä palveluun %s