The Artima Developer Community
Sponsored Link

Java Buzz Forum
PHP and Ruby: Evolution before Revolution

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
PHP and Ruby: Evolution before Revolution Posted: Apr 18, 2006 9:11 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: PHP and Ruby: Evolution before Revolution
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

It has been a pleasure to use Rails for web applications that are suited to it, especially green field applications.

But not all projects are green fields, and what if you want to be able to use Rails in those?

I am experiencing this scenario right now. A project in production that uses PHP wants to ramp up to the next level and the new features are suited well to Rails.

That being said, we don't have time to stop new features for a few months while we rewrite the application in Rails. It isn't sexy to do a relaunch and say to the company "look, the app runs exactly the same but it is on cool technology!". They don't care :)

Migration via Web Services

A lot of the new projects are suited as Web services. Instead of having Rails be in charge of everything, the PHP front end can talk to Rails to display the functionality. Rails 1.1 is very good at this, and it is easy to write your application to deliver JSON, or XML, or HTML.

Phase One: PHP can include some HTML, or use the XML output. In the future as we get rid of the PHP code we can simply use Rails to deliver the full HTML.

Migration via 'Portal'

The PHP front end can also proxy through to the Rails applications running behind the scenes. This makes the app feel a little like a portal, but basically it is just a proxy. The front end can build the template (header, footer, sidebars) and then call back to the Rails backend to get the main content.

This is where SiteMesh for PHP would be nice :)

Chipping away

As we add new features we can put more and more into the Ruby codebase. The front end system can be replaced, while we leave the admin application still running on the PHP side. After all, the data is all just shared at the DB level.

At a later date we can then go back and migrate the admin app. We can do this at a point when new functionality is requested at the admin level, and can role it in.

It would be much nicer to be working in pure Rails world of course, but it is an interesting experience to ease it into a production environment, and see it eat out PHP from the inside.

Read: PHP and Ruby: Evolution before Revolution

Topic: Debug Sounds Plugin Previous Topic   Next Topic Topic: HTTP Authentication Woes

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use