Springer Publishing Ruby on Rails for PHP and Java Developers (2007).pdf

(31316 KB) Pobierz
938078288.003.png
Deepak Vohra
Ruby on Rails
for PHP and
Java Developers
With 202 Figures and 32 Tables
123
938078288.004.png 938078288.005.png
Deepak Vohra
dvohra09@yahoo.com
Library of Congress Control Number: 2007929957
ISBN
978-3-540-73144-3 Springer Berlin Heidelberg New York
This work is subject to copyright. All rights are reserved, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilm or in any other way, and storage in data
banks. Duplication of this publication or parts thereof is permitted only under the provisions
of the German Copyright Law of September 9, 1965, in its current version, and permission
for use must always be obtained from Springer. Violations are liable for prosecution under
the German Copyright Law.
Springer is a part of Springer Science+Business Media
springer.com
© Springer-Verlag Berlin Heidelberg 2007
The use of general descriptive names, registered names, trademarks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from
the relevant protective laws and regulations and therefore free for general use.
Typesetting: by the Author
Production: LE-T E X Jelonek, Schmidt & Vöckler GbR, Leipzig
Cover design: KünkelLopka Werbeagentur, Heidelberg
Printed on acid-free paper
45/3180/YL - 5 4 3210
938078288.006.png 938078288.001.png
Preface
Ruby 1 is an open source programming language that was released in 1995.
Ruby is ranked 10 th in the TIOBE Programming Community index 2 . Ruby
on Rails 3 is an open source web framework that was released in 2004.
Ruby on Rails is being widely adopted because of its simplicity,
maintainability and development speed. Computerworld 4 lists Ruby on
Rails as the one of the top 5 technologies for 2007.
Motivation for this Book
Ruby is often compared with PHP, which is the most commonly used
scripting language, and with Java, which is the most commonly used
programming language. In the trends graph of TIOBE index you might
notice that since the middle of 2006 Ruby shows an increase in usage
while PHP and Java show a decrease in usage. OReilly Radar 5 has noted
the trend towards an increased usage of Ruby on Rails. Statistics aside,
Ruby on Rails has some advantages over PHP, which are discussed below.
1. Ruby on Rails is more object-oriented than PHP, thus providing all
the inherent advantages of an object-oriented language such as
simplicity, modularity, modifiability, extensibility, maintainability
and re-usability.
2. Ruby on Rails is web framework whereas PHP is only a scripting
language.
1 Ruby-http://www.ruby-lang.org/en/
2 TIOBE Index-http://www.tiobe.com/tpci.htm
3 Ruby on Rails-http://www.rubyonrails.org/
4 ComputerWorld-
http://computerworld.com/action/article.do?command=viewArticleBasic
&articleId=9011969
5 OReilly Radar-
http://radar.oreilly.com/archives/2006/08/programming_language_trends_1.html
VI Preface
3. Ruby on Rails includes a web server for development, whereas a web
server has to be installed for PHP.
4. Ruby on Rails implements the Model-View-Controller (MVC)
architecture, whereas the MVC architecture has to be implemented
externally in PHP.
5. Ruby on Rails framework provides the Create-Read-Update-Delete
(CRUD) functionality, PHP doesn’t.
While Java has advantages over Ruby on Rails in scalability, security,
transaction management and availability of development tools, Ruby on
Rails has advantages over Java in simplicity, development speed, and
maintainability. Ruby on Rails provides a tightly coupled web framework
consisting of a persistence framework, a web application framework, and
a Web Services framework. The J2EE application framework is not as
seamless as Ruby on Rails and requires much more configuration. Ruby on
Rails also has the advantage of being dynamically typed, while Java is
statically typed.
While a number of books have been published on Ruby on Rails, none
of the books compare Ruby on Rails with PHP and very few compare
Ruby on Rails with Java.
Who Should Read this Book?
A comparison with PHP and Java is included in most chapters where
relevant. But, you don’t have to be a PHP or Java developer to read the
book. You may be using another scripting language or Ruby on Rails may
be the first scripting language based web framework you are learning
about. If you have used Ajax you would be familiar with the requirement
for a server-side tier, which may be PHP-based, Java-based , or .NET-
based. Ruby on Rails supports Ajax and according to an Ajaxian.com
survey 6 14% of Ajax developers use Rails as the Ajax platform. If you
have been using PHP or Java class libraries to develop PDF and Excel
reports, Ruby on Rails provides Ruby gems for generating PDF and Excel
reports. If you are a web developer and often use PHP or Java to
create/read/update/delete database entries, Ruby on Rails provides a built-
in support for CRUD. If you have been using Java Naming and Directory
Interface (JNDI) or a PHP class library to implement directory services
6 Ajaxian.com Survey- http://ajaxian.com/archives/ajaxiancom-2006-survey-
results
938078288.002.png
 
Zgłoś jeśli naruszono regulamin