Intro to Rails Flashcards
MVC(Model, View, Controller):
- The _______ way to create user-interactive applications
- Created in 1979 by Trygve Reenskaug
- The default way to create user-interactive applications
- Created in 1979 by Trygve Reenskaug
What does the model do?
–Keeps track of ____ (session and longer)
–________, often via _________
–Enforces _________
–Keeps track of state (session and longer)
–Persistence, often via database
–Enforces consistency
What does View do?
•View ________ user interface
–Based on data in ______
–May look _______ based on browser, user role, assistive technologies, etc.
•View generates user interface
–Based on data in model
–May look different based on browser, user role, assistive technologies, etc.
What does Controllers do?
•Controllers _______
–Receives______ from ______
–Interacts with _____
•Controllers coordinate
–Receives events from view
–Interacts with model
MVC Picture:
•DB shouldn’t worry about how data are ________
–________ technology can change without affecting any other part of app
–Can add ______ , etc.
•DB shouldn’t worry about how data are displayed
–Display technology can change without affecting any other part of app
–Can add JavaScript, etc.
What is an important concept in MVC?
separation of _______
Important concept: separation of concerns
Business logic in only ___ _____
•Business logic in only one place
Separation of Concerns:
- Code/text only __________ one aspect of app
- Easier to ____, ______, ______, _______
- Rails essentially enforces ___
- Code/text only addresses one aspect of app
- Easier to write, maintain, document, debug
- Rails essentially enforces MVC
Rails concepts: Continuous Integration (CI)?
is a development practice that requires developers to ________ code into a shared _________ several times a day. Each check-in is then verified by an __________ build, allowing teams to detect problems early.
is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
Rails concepts: Extreme programming (XP)
is a software development _________ which is intended to improve software quality and _____________to changing customer requirements.
is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements.
Rails conepts: Kanban
is a ______ to control the ______ chain from a production point of view, and is an ___________ control system. Kanban was developed by Taiichi Ohno, an industrial engineer at Toyota, as a system to improve and maintain a high level of production. Kanban is one method to achieve ___.
is a system to control the logistical chain from a production point of view, and is an inventory control system. Kanban was developed by Taiichi Ohno, an industrial engineer at Toyota, as a system to improve and maintain a high level of production. Kanban is one method to achieve JIT.
Rails concepts: just-in-time (JIT) compilation:
also known as dynamic __________, is _________ done during execution of a program – __ ___ ____ – rather than prior to execution
also known as dynamic translation, is compilation done during execution of a program – at run time – rather than prior to execution.
Rails Concepts: Scrum:
is an ______ and __________ agile software development ____________ for managing product development.
is an iterative and incremental agile software development methodology for managing product development.
Rails concepts: Test-driven development (TDD)
is a software development process that relies on the ________ of a very short development cycle: first the developer ______ an (initially failing) automated test case that defines a desired _________or new _____, then produces the minimum amount of code to pass that test, and finally _______the new code to ________ standards.
is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards.
Rails conventions: Requests are sent to a _______
–Sends request to an action in a _______
•Requests are sent to a router
–Sends request to an action in a controller
Rails conventions: •HTTP requests: ___, ____, ___, ______
HTTP requests: GET, POST, PUT, DELETE
Rails Concepts: Convention over configuration:
–Directory ________ mirrors MVC
–Don’t have to change _____ files much, if at all
•Don’t Repeat Yourself
•Agile
–Directory structure mirrors MVC
–Don’t have to change config files much, if at all
•Don’t Repeat Yourself
•Agile
Model Conventions: OO programming languages are designed around ______
•OO programming languages are designed around objects
Rails conventions: Router usually treats first part of _____ as the controller name:
•Router usually treats first part of path as the controller name
Model Conventions: Databases are designed around ______, ____, and ______
•Databases are designed around tables, rows, and columns
Rails conventions: •If action is _____, calls “create” method for that controller, via naming conventions
•If action is POST, calls “create” method for that controller, via naming conventions
ORM:Classes become ______
Classes become tables
ORM:Values in those objects become _______
Values in those objects become columns
ORM: Objects become ____ in those _____
Objects become rows in those tables
Model Naming Conventions: ______ are singular and table is ___
•Classes are singular and table is pural
Model Conventions: •How can we save objects in a __?
•How can we save objects in a DB?
ORM:
Object-______ ______ (ORM) is a technique (a.k.a. design pattern) of accessing a relational ________ from an ______-_______ language (Java, for example)
Object-relational mapping (ORM) is a technique (a.k.a. design pattern) of accessing a relational database from an object-oriented language (Java, for example)
ORM: Rails has ActiveRecord to do this, and much more
- ___, ______, ____, ______, etc.
•Rails has ActiveRecord to do this, and much more
–Add, delete, find, modify, etc.
ORM: Upside: stay within ____ and _____, no SQL
•Upside: stay within Ruby and Rails, no SQL
Views: Rails has XML ____
•XML builder
ORM Continued:
- Class ______ perform________ operations
- Instance _______ perform ______ operations
- Class methods perform table-level operations
- Instance methods perform row-level operations