Title: Web Application Framework with MVC
1Web Application Framework with MVC
2Outline
- Framework
- Web Application Framework
- MVC ???????
- ????????????? MVC
- ?????????????????? MVC
- ???????? Web App. Framework
- ??????????? Web App. Framework
- Ruby On Rails ???????
- Ruby On Rails with MVC
- ??????????? Ruby On Rails
- Flow MVC ??? Ruby On Rails
3Framework
- ???????????????????????? Software
???????????????????????? ?????????? - ???????????? program, code library, scripting
language ???? Software ????????????????????? - Software ???????????????????????????
?????????????????????????????????????
4Web Application Framework
- ???????????? Sofeware ????????????????? Web
Application ????????????????????? - ??????????????????????????????????????????????????
??????? ???? ???????????????????(Database Access)
,???????? template ????????????? session ???????
5MVC (Model-View-Controller) ???????
- ?????????????????????? (software architecture)
?????????????????????????? 3 ????????? ??????
data model, user interface, and control logic
???????? 3 ???????????????????????? - ????????????????????? MVC ????????????????????????
??? framework ?????????????????????????????
????????????????????????? ??? programmer
???????????? concept ??? MVC
6????????????? MVC
Model ????????????????????????? database
????????????????-??? ??????????????????????
View ??????????????????????? Web browser
??????????????? HTML ???????????????????????
Model ??????????????
Controller ?????????????????????????????????
????????? Web browser (user action)
?????????????? Model ???? View ??????????
7?????????????????? MVC
????????? controller ????????????????????????????
web browser (user)
?????????? query ?????? ??? DB. Controller
??????????? Model ????????????????
Model ?????????????? ???????? view
????????????????? web browser ????????
8???????? Web Application Framework with MVC
9??????????? Web Application Framework with MVC
10Ruby On Rails ???????
- Ruby ???????
- ???????? script object oriented???????????????????
?????????? (interpreter) ????????? Perl,
Python,Java - ????????????? Syntax ??????? ?????? ??????????
- Ruby On Rails ???????
- ?????????????? web application framework
???????????????? Ruby - ????????? MVC architecture
11Ruby On Rails with MVC
- ??????????????????? Ruby On Rails ????????
Concept ??? MVC ?????? - Model
- ?????????????? Active Record ?????????????????????
? Database - ?????????????????????????????????????? Object ???
Database ?????? ???????????????????????????????
SQL command - ??????????????????????????????????????????
???????????????? - Handles validation(??????????????????),
association(????????????????????????????),
transactions, and more
12Ruby On Rails with MVC
- View
- ????????????????????????? web browser
- ??????????????????? HTML(.rhtml), ???????? script
??? ruby ????? PHP,JSP,ASP - ??????????????????????? controller
- ?? component ???????????? (Reusable)
13Ruby On Rails with MVC
- Controller
- ??????????????????????????????????????????????????
? ??? Web browser - ????????????????????????????????????????????????
- ?????????????? Database(?????????) ???? Model
?????????????????????? View - ???????????????????????????? ??????????
14??????????? Ruby On Rails
15Flow MVC ??? Ruby On Rails
2
http//127.0.0.13000/store/index
1
store_controller.rb
3
def indexend
11
8
Controllers
Layouts
10
7
4
- CSS- JS- Image- XML
Product.rb
9
Database
5
- SQL- Validation- Association- Callback
Database.yml
Table products
6
Models (Active Records)
16?????????????
- www.rubyonrails.org
- http//www.onlamp.com/pub/a/onlamp/2005/01/20...
- http//www.isriya.com/node/908
- http//www.catalystframework.org/
- http//en.wikipedia.org/wiki/Framework
- http//en.wikipedia.org/wiki/List_of_web_applicati
on_frameworks - http//www.phpit.net/article/ten-different-php-fra
meworks - http//wiki.nectec.or.th/giti/Knowledge/RubyOnRail
s