@maorongrong
2018-02-03T03:06:30.000000Z
字数 4438
阅读 625
coursera
说明: 记录 coursera - Web Application 学习笔记
若存在视频无法播放问题,考虑到中国强大的防火墙,有钱就自己弄个VPN,没钱就知乎找一些别人分享的解决方式。我的解决方式如下:
# 在/etc/host 添加如下:
52.84.246.90 d3c33hcgiwev3.cloudfront.net
52.84.246.252 d3c33hcgiwev3.cloudfront.net
52.84.246.144 d3c33hcgiwev3.cloudfront.net
52.84.246.72 d3c33hcgiwev3.cloudfront.net
52.84.246.106 d3c33hcgiwev3.cloudfront.net
52.84.246.135 d3c33hcgiwev3.cloudfront.net
52.84.246.114 d3c33hcgiwev3.cloudfront.net
52.84.246.90 d3c33hcgiwev3.cloudfront.net
52.84.246.227 d3c33hcgiwev3.cloudfront.net
然后, /etc/init.d/networking restart
, okay,everything is fine。愉快的开课吧。
NOTE: 该课程使用ruby on rails 5进行开发,具体的安装以及语言基础学习参考railsapps.github.io/installing-rails.html.
Presentation tier —— the User Interface
User's web browser.
Data tier —— Persistent Storage of data associated with the application
A relational database.
Application (Logic) tier —— retrieves, modifies and/or deletes data in the data tier, and sends result to the presentation tier. Also responsible for processing the data itself
The web server and logic associated with generating dynamic web content.
Presentation Tier is subdivided into:
Data Tier is subdivided into:
Application Tier is subdivided into:
We’ll start by explaining how a web application is used to create a website, it will help explain how Rails works.
You’re running a web browser on your computer (probably to read this article). A web browser combines three kinds of files—HTML, CSS, and JavaScript—to display web pages. A browser obtains the files from a web server. The web server can be remote (connected by the Internet) or on your own computer (when you are doing development).
You might have learned how to create HTML, CSS, and JavaScript files. HTML (HyperText Markup Language) is a convention for creating structured documents that combine content (such as text, images, or video) with generic typographic, layout and design elements (such as headlines and tables). CSS (Cascading Style Sheets) directives apply a specific appearance to typographic, layout and design elements. JavaScript is a programming language supported by all web browsers that is used to manipulate HTML and CSS elements, particularly for implementing interactive features such as tabs and modal windows. You can learn about HTML, CSS, and JavaScript in a typical “Introduction to Web Design” course that teaches how to make “static websites.”
Web servers deliver HTML, CSS, and JavaScript, either from static files that are stored on the server, or from an “application server” that creates files dynamically using a programming language such as Ruby. A software program written in Ruby and organized using Rails conventions is a “web application.” Rails combines the Ruby programming language with HTML, CSS, and JavaScript to create a web application. Rails uses Ruby to dynamically assemble HTML, CSS, and JavaScript files from component files (often adding content from a database).
Why create a web application? A web browser needs only a single HTML file to display a web page (CSS and JavaScript files are optional). However, if you are creating several web pages, you might want to assemble the HTML file from smaller components. For example, you might make a small file that will be included on every page to make a footer (Rails calls these “partials”). Consider another example: If you are displaying content from a database, you might not want the complex programming code that accesses the database mixed into your HTML (programmers call this separation of concerns and it makes for more modular, maintainable programs). Finally, if you are using a web application server such as the one supplied with Rails, you can add features to your website that have been developed and tested by other people so you don’t have to build everything yourself. These are all reasons to create a web application.
Now that you’ve seen how Rails combines the Ruby programming language with HTML, CSS, and JavaScript to create a web application, we can examine Rails more closely.
MVC
= model-view-controller
, 并且 MVC
设计模式被大部分web application frameworks
采用。
!MVC示意图
MVC
设计模型在6-tier web application architecture
充当中间件作用:
!MVC in 6-tier web application architect