A little engineering on Rails Robert W. Hasker. Goals Intro to the Rails framework ▫Basic concepts: MVC, Active Record ▫A bit of Ruby Using Rails to build.

Slides:



Advertisements
Similar presentations
Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
Advertisements

Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails Web development that doesn’t hurt By Mylore, Dung, Lee, Karen and Bryan.
Management Information Systems, Sixth Edition
Ruby on Rails Tutorial Peter Mosca April, Ruby on Rails Tutorial Ruby History Invented 12 years ago in Japan by Yukihiro Matsumoto Spent first 5.
Ruby on Rails by Manik Juneja Ruby On Rails. Ruby on Rails by Manik Juneja Rails is a Web Application development framework. Based on the MVC pattern.
Lecture Microsoft Access and Relational Database Basics.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails a popular web application framework, aimed to increase the speed and ease of web development Ruby on Rails, Tim Zappe.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Business Driven Technology Unit 2 Exploring Business Intelligence Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution.
M1G Introduction to Database Development 1. Databases and Database Design.
Database Design Overview. 2 Database DBMS File Record Field Cardinality Keys Index Pointer Referential Integrity Normalization Data Definition Language.
Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models.
| Lugano, Ruby on Rails.
RUBY ON RAILS Mark Zhang. In this talk  Overview of Ruby on Rails  Core ideas  Show a tiny bit of example code  Touch on several general web development/
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Ruby on Rails Charles Severance Textbook: Build Your own Ruby on Rails Application by Patrick Lenz (ISBN: )
Computing for Bioinformatics Introduction to databases What is a database? Database system components Data types DBMS architectures DBMS systems available.
UC Berkeley Hello Rails. Review: MVC Goal: separate organization of data (model) from UI & presentation (view) by introducing controller –mediates user.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Ruby & rails by Nicholas Belotti. What is ruby Ruby is an object orientated scripting language. In Ruby...everything is an object! Ruby was released in.
Marc Ziss Z Consulting Code Name 'Oryx' Web application scaffolding Easy to dynamically display pages based on the data model of.
Simple Database.
Chapter 6: Foundations of Business Intelligence - Databases and Information Management Dr. Andrew P. Ciganek, Ph.D.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
1 Another group of Patterns Architectural Patterns.
MET280: Computing for Bioinformatics Introduction to databases What is a database? Not a spreadsheet. Data types and uses DBMS (DataBase Management System)
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Databases Topic 4 Text Materials Chapter 3 – Databases and Data Warehouses.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
Object Persistence (Data Base) Design Chapter 13.
MIS 327 Database Management system 1 MIS 327: DBMS Dr. Monther Tarawneh Dr. Monther Tarawneh Week 2: Basic Concepts.
COMU114: Introduction to Database Development 1. Databases and Database Design.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Database Management Systems.  Database management system (DBMS)  Store large collections of data  Organize the data  Becomes a data storage system.
6.1 © 2010 by Prentice Hall 6 Chapter Foundations of Business Intelligence: Databases and Information Management.
MANAGING DATA RESOURCES ~ pertemuan 7 ~ Oleh: Ir. Abdul Hayat, MTI.
Ruby on Rails By S. Christopher Hellriegel. Overview 1. What is Ruby on Rails? 2. What is MVC? 3. Simple example 4. Wow, that was cool!
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
Foundations of Business Intelligence: Databases and Information Management.
Chapter 10 Database Management. Data and Information How are data and information related? p Fig Next processing data stored on disk Step.
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
SEA Side – Extreme Programming 1 SEA Side Software Engineering Annotations Architectural Patterns Professor Sara Stoecklin Director of Software Engineering-
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
Visual Database Creation with MySQL Workbench 도시정보시스템 설계
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Management Information Systems by Prof. Park Kyung-Hye Chapter 7 (8th Week) Databases and Data Warehouses 07.
Cake PHP – OOPS approach for PHP
Ruby on What? A brief introduction to Rails Christopher Hoskin Faculty of History 12th Annual IT Support Staff Conference 21st June 2007, St. Catherine's.
Jim Fawcett CSE686 – Internet Programming Spring 2014
Ruby, Rails, GUIs, and More
CO6025 Advanced Programming
Ruby on Rails by Manik Juneja
What is a Database and Why Use One?
Ruby on Rails by Manik Juneja
MIT GSL 2018 week 3 | thursday Meteor and App Ideation.
PHP and MySQL.
INFO/CSE 100, Spring 2006 Fluency in Information Technology
Databases and the MVC Model
Databases WOW!! A database is a collection of related data.
Presentation transcript:

A little engineering on Rails Robert W. Hasker

Goals Intro to the Rails framework ▫Basic concepts: MVC, Active Record ▫A bit of Ruby Using Rails to build a website Myths and issues

The Rails Framework Basic goal: construct database-backed websites Multi-platform: popular OS’s, database engines Origins: ▫Instiki by David Heinemeier Hansson ▫Basecamp by 37signals ▫Rails: domain-independent core Built on the Ruby language ▫General-purpose language: scripting, applications ▫Dynamically typed, “open” classes

Basic Concept: MVC Issue: how to separate logic from presentation? Classic solution: Model/View/Controller ▫Model: domain-level data ▫View: how the data is presented to the user  Typically want multiple views ▫Controller: logic linking the two Rails ▫Model = tables in a relational database ▫View = web pages ▫Controller = controller

Basic Concepts: Active Record Relational Databases: organize large amounts of data ▫Issue: no easy mapping to object-oriented design Active Record Pattern ▫A design pattern first described by Martin Fowler ▫Object = table row w/ attributes stored as columns ▫Table = collection of objects ▫OOD = database (collection of tables)  Rails: link classes through id fields in tables

Active Record Example Data for a simple voting system: As tables: ▫ create table questions (id int, body text, start datetime, end datetime, primary key(id)); ▫ create table voters (id int, username text, password text, primary key(id)); ▫ create table vote_records (voter_id int, …); Benefit: can add operations as needed - active records

Using rails to build a voting application See

Conclusion Rails: quick OO websites ▫MVC: sound organization ▫ActiveRecord: support good OO designs  Focus on relationships, not queries  Less likely to forget a join, but supports full SQL  Not shown: does support inheritance  Navigation: keep the class diagram close at hand!

Conclusion… Design ▫DRY: don’t repeat yourself ▫Convention, not configuration ▫Relationships are declared explicitly ▫Scaffolding: quick data entry (prototyping only) ▫Great development environment  has full debugging support; separate dev/prod db’s ▫Supports JavaScript/Ajax/etc.  Explore Ajax support next time

Myths & Issues Myth: slow sites, doesn’t scale ▫Supports many web servers ▫Many optimizations probably belong elsewhere ▫Technology improving Myth: only for specific types of projects ▫Source: lots of simple examples out there ▫Can handle big problems ▫Don’t have to involve a database ▫See Issues ▫Active Records: should have Table classes ▫Ruby: run-time type checking requires lots of testing!  But has good built-in testing support! ▫Developers tempted to use all – pick level and stick to it

Resources Online tutorials Classic text: Agile Web Development with Rails Starting points: ▫ ▫Beginning Rails: From Novice to Professional  In library, but based on Rails 1.x ▫Beginning Rails 3  Available soon More detail: The Rails Way