Software Development (CSC 321 2016S) : EBoards

CSC321.01 2016S, Class 04: A Static Site


Overview

Preliminaries

Admin

Upcoming Work

Good Things to Do

Academic

Peer

Other

Questions

Reflections on chapters 1-2, continued

How persistent are the data in our toy application?

There's a database. The data are supposed to persist.

Please explain the data path in the MVC.

See the whiteboard.

What is RESTful programming?

An architecture for designing programs, often used on the World Wide Web, based on someone's Y2K dissertation.

Something of a standard, at least as much as there are standards on the Web.

For the Web, requests are specified by URL plus action (GET, PUT, DELETE)

Client, rather than server, maintains state. (Server may use the state variable that it passes back to the client.)

What is database migration?

A mechanism for updating databases.

E.g., add a new model; change the relationship between different models (e.g., make it clear that we have a one-to-many relationship); delete a model; add a field; delete a field etc.

If someone is running an older version of your database, this gives them the information to bring it up to date.

What is the purpose of rake?

It's a Ruby version of make.

make is a program that keeps track of the steps necessary to build programs and the dependencies between the parts of a program. E.g. foo.c depends on foo.h. foo.o is built from foo.c (using the instructions cc -c -o -lm foo.c). rake does something similar: Using rules, it figures out what steps need to be done.

Tradition on *nix systems is that there are make targets to build an application (make), to test it (make test), to install it (make install), to clean up cruft (make clean), etc. "Cruft" is things like .o files that you probably don't need once you have the application up and running.

Why do we type bundle exec rake ... rather than just rake ...?

bundle uses the version of rake associated with the current project, rather than the default version on your system.

Testing

Take two minutes and chat with your peers: Why do we write (automated) tests?

More reasons

Good programmers write tests before code (and after) and run them regularly.

Starting our primary application

Work on chapter 3 of Hartl!