Text of my 90 minutes lecture in Shimane Univ, learning web application through developing lucky-fortune application with Ruby on Rails. Most parts are written in Japanese.
The document discusses using Ruby to create domain-specific languages (DSLs). It provides examples of internal DSLs in Ruby, like Rails routes and migrations, which take declarative, natural language forms. The document encourages writing code in a DSL-like style by using declarative programming, blocks, and methods that represent special concepts. It also discusses how to structure code to express the "nature" or "essence" of a class through modules in a declarative way.
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009Yasuko Ohba
?
This document discusses coding patterns for developing large and complicated Ruby on Rails applications. It recommends expressing business logic in models using object-oriented principles, following DRY, CoC and RESTful principles, and writing code in models' standard flows like find, new/save, find/update, and find/destroy. Filter methods are suggested to avoid duplicating code and improve readability. Moving branching logic based on parameters and other model processing code from controllers to models improves testability and reusability. Choosing natural coding styles for Rails that follow its core principles helps keep code maintainable for other developers. Sharing such pragmatic patterns is important for developing large codebases.