Rails for Java Developers

Free Download

Authors:

Series: Pragmatic programmers., Facets of Ruby series

ISBN: 9780977616695, 097761669X

Size: 2 MB (2107851 bytes)

Pages: 323/323

File format:

Language:

Publishing Year:

Category:

Stuart Halloway, Justin Gehtland9780977616695, 097761669X

Many Java developers are now looking at Ruby, and the Ruby on Rails web framework. If you are one of them, this book is your guide. Written by experienced developers who love both Java and Ruby, this book will show you, via detailed comparisons and commentary, how to translate your hard-earned Java knowledge and skills into the world of Ruby and Rails.If you are a Java programmer, you shouldn’t have to start at the very beginning! You already have deep experience with the design issues that inspired Rails, and can use this background to quickly learn Ruby and Rails. But Ruby looks a lot different from Java, and some of those differences support powerful abstractions that Java lacks. We’ll be your guides to this new, but not strange, territory.In each chapter, we build a series of parallel examples to demonstrate some facet of web development. Because the Rails examples sit next to Java examples, you can start this book in the middle, or anywhere else you want. You can use the Java version of the code, plus the analysis, to quickly grok what the Rails version is doing. We have carefully cross-referenced and indexed the book to facilitate jumping around as you need to.Thanks to your background in Java, this one short book can cover a half-dozen books’ worth of ideas:# Programming Ruby# Building MVC (Model/View/Controller) Applications# Unit and Functional Testing# Security# Project Automation# Configuration# Web Services

Table of contents :
Contents……Page 7
Foreword……Page 11
Preface……Page 13
Setting Up Ruby and Rails……Page 20
Rails App in Fifteen Minutes……Page 21
The Rails Development Cycle……Page 25
Finding Information in Online Documentation……Page 28
Editors and IDEs……Page 29
Running the Samples……Page 30
Rails Environments……Page 32
How Rails Connects to Databases……Page 35
Rails Support Scripts……Page 36
Primitive Types……Page 38
Strings……Page 41
Objects and Methods……Page 44
Collections and Iteration……Page 46
Control Flow……Page 51
Defining Classes……Page 57
Identity and Equality……Page 63
Inheritance……Page 65
Controlling Access with Access Specifiers……Page 66
Raising and Handling Exceptions……Page 69
Extending Core Classes……Page 72
Mutable and Immutable Objects……Page 74
Packages and Namespaces……Page 76
Deploying Code……Page 79
Delegation……Page 83
Polymorphism and Interfaces……Page 85
Duck Typing……Page 89
Mixins……Page 90
Functions……Page 92
Accessing Data with ActiveRecord……Page 96
Getting Connected……Page 97
Managing Schema Versions with Migrations……Page 100
Mapping Data to Classes……Page 103
Create, Read, Update, and Delete: Access Patterns……Page 105
Validating Data Values……Page 113
Lifecycle Callbacks……Page 116
Associations and Inheritance……Page 119
Transactions, Concurrency, and Performance……Page 125
Conserving Resources with Connection Pooling……Page 131
Resources……Page 132
Coordinating Activities with ActionController……Page 133
Routing Basics: From URL to Controller+Method……Page 134
List and Show Actions: The R in CRUD……Page 136
Create, Update, and Delete Actions……Page 140
Tracking User State with Sessions……Page 144
Managing Cross-Cutting Concerns with Filters and Verify……Page 147
Routing in Depth……Page 150
Logging, Debugging, and Benchmarking……Page 153
Resources……Page 166
Rendering Output with ActionView……Page 167
Creating Basic .rhtml Files……Page 168
Minimizing View Code with View Helpers……Page 169
Writing Custom Helpers……Page 170
Reuse with Layouts and Partials……Page 172
Building HTML Forms……Page 174
Building HTML with Markaby……Page 178
Caching Pages, Actions, and Fragments……Page 180
Creating Dynamic Pages with Ajax……Page 183
Rendering JavaScript with RJS……Page 191
Black-Box Testing with Selenium……Page 192
Conclusions……Page 196
Resources……Page 197
Testing……Page 198
Getting Started with Test::Unit……Page 199
Rails Testing Conventions……Page 206
Rails Extensions to Test::Unit……Page 212
Integration Testing……Page 216
Rails Testing Examples……Page 218
Measuring Code Coverage with rcov……Page 222
Testing Interactions with Mock Objects……Page 225
Reducing Dependencies with Stub Objects……Page 229
Advanced Considerations……Page 230
Resources……Page 231
Automating the Development Process……Page 233
Rake Basics……Page 234
Setting Rake Options: It’s Just Ruby……Page 236
Custom Rake Tasks: It’s Just Ruby……Page 237
Using Rake in Rails Applications……Page 240
Continuous Integration with Cerberus……Page 243
Resources……Page 245
Creating and Invoking Web Services……Page 247
RESTful Web Services……Page 248
SOAP Web Services……Page 255
YAML and XML Compared……Page 261
JSON and Rails……Page 265
XML Parsing……Page 266
Ruby XML Output……Page 273
Creating XML with Builder……Page 276
Curing Your Data Headache……Page 278
Resources……Page 280
Authentication with the acts_as_authenticated Plugin……Page 282
Authorization with the Authorization Plugin……Page 285
Testing Authentication and Authorization……Page 289
Preventing the Top-Ten Web Security Flaws……Page 293
Resources……Page 301
Java to Ruby Dictionary……Page 303
Bibliography……Page 306
Structure of a Rails Project……Page 307
A……Page 309
C……Page 311
F……Page 313
I……Page 314
L……Page 315
N……Page 316
R……Page 317
S……Page 319
U……Page 321
W……Page 322
Z……Page 323

Reviews

There are no reviews yet.

Be the first to review “Rails for Java Developers”
Shopping Cart
Scroll to Top