structured formatin the case ofrelational databases by far the most popular

Structured formatin the case ofrelational databases

This preview shows page 85 - 87 out of 517 pages.

structured format—in the case of relational databases , by far the most popular type, each kind of object is stored in a table whose rows represent object instances and whose columns represent object properties. This organization is a good fit for the structured data that many Web apps manipulate. Interestingly, today’s largest Web apps, such as Facebook, have grown so far beyond the scale for
Image of page 85
which relational databases were designed that they are being forced to look at alternatives to the long-reigning relational database. Self-Check 2.4.1. Explain why cloud computing might have had a lesser impact on SaaS if most SaaS apps didn’t follow the shared-nothing architecture. Cloud computing allows easily adding and removing computers while paying only for what you use, but it is the shared-nothing architecture that makes it straightforward to “absorb” the new computers into a running app and “release” them when no longer needed. Self-Check 2.4.2. In the ____ tier of three-tier SaaS apps, scaling is much more complicated than just adding computers. Persistence tier 2.5 1,000 Feet: Model-View-Controller Architecture So far we’ve said nothing about the structure of the app code in RottenPotatoes. In fact, just as we used the client-server architectural pattern to characterize the “100,000-foot view” of SaaS, we can use an architectural pattern called Model-View-Controller (usually shortened to MVC) to characterize the “1,000-foot view.” An application organized according to MVC consists of three main types of code. Models are concerned with the data manipulated by the application: how to store it, how to operate on it, and how to change it. An MVC app typically has a model for each type of entity manipulated by the app. In our simplified RottenPotatoes app, there is only a Movie model, but we’ll be adding others later. Because models deal with the application’s data, they contain the code that communicates with the storage tier. Views are presented to the user and contain information about the models with which users can interact. The views serve as the interface between the system’s users and its data; for example, in RottenPotatoes you can list movies and add new movies by clicking on links or buttons in the views. There is only one kind of model in Rotten Potatoes, but it is associated with a variety of views: one view lists all the movies, another view shows the details of a particular movie, and yet other views appear when creating new movies or editing existing ones. Finally, controllers mediate the interaction in both directions: when a user interacts with a view (e.g. by clicking something on a Web page), a specific controller action corresponding to that user activity is invoked. Each controller corresponds to one model, and in Rails, each controller action is handled by a particular Ruby method within that controller. The controller can ask the model to retrieve or modify information; depending on the results of doing this, the controller decides what view will be presented next to the user, and supplies that view with any necessary information. Since RottenPotatoes has only
Image of page 86
Image of page 87

You've reached the end of your free preview.

Want to read all 517 pages?

  • Spring '19
  • Dr.Marcos

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors