Introduction to Ruby, MVC, and the Rails Framework Professor Larry - - PowerPoint PPT Presentation

introduction to ruby mvc and the rails framework
SMART_READER_LITE
LIVE PREVIEW

Introduction to Ruby, MVC, and the Rails Framework Professor Larry - - PowerPoint PPT Presentation

Introduction to Ruby, MVC, and the Rails Framework Professor Larry Heimann Application Design & Development Information Systems Program Philosophy of Ruby For me, the purpose of life is, at least partly, to have joy. Programmers often


slide-1
SLIDE 1

Introduction to Ruby, MVC, and the Rails Framework

Professor Larry Heimann Application Design & Development Information Systems Program

slide-2
SLIDE 2

Philosophy of Ruby

“For me, the purpose of life is, at least partly, to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, so Ruby is designed to make programmers happy.”

— Yukihiro Matsumoto

slide-3
SLIDE 3

Three Principles

  • 1. Conciseness—Writing code in Ruby should involve the minimum amount of

commands necessary. Code should be terse but also understandable.

  • 2. Consistency—Ruby coding should follow common conventions that make

coding intuitive and unambiguous.

  • 3. Flexibility—There is no one right way. You should be able to pick the best

approach for your needs and be able to even modify the base classes if necessary. These three together lead to an important concept in Ruby — the principle of least surprise.

slide-4
SLIDE 4

Comic of the Day...

slide-5
SLIDE 5

The Ruby Way

slide-6
SLIDE 6

Everything is an object

Looking at Strings, we see:

slide-7
SLIDE 7

Revising the String class

slide-8
SLIDE 8

Destructive and Predicate methods

slide-9
SLIDE 9

Architecting Software

  • Needs to be:
  • understandable
  • extensible
  • Many different architecture patterns exist
  • Model-View-Controller (MVC) one of the most popular
slide-10
SLIDE 10

MVC is like ...

slide-11
SLIDE 11

Model: Taking Care of Business

slide-12
SLIDE 12

View: Looking Good

slide-13
SLIDE 13

View: Partials

slide-14
SLIDE 14

Controller: Holding It All Together

slide-15
SLIDE 15

Controllers: Too Fat To Be Useful

slide-16
SLIDE 16

Controllers: Variations

slide-17
SLIDE 17

Controller: Traffic Cop

slide-18
SLIDE 18

MVC as used in Rails



       

        

 

slide-19
SLIDE 19

Class Exercise To know the Model-View-Controller, you must be the Models, Views and Controllers...