Presented by: Ermilo John D. Gialogo, Jr. La Salle Computer Society De La Salle University 06/08/09 Ermilo John D. Gialogo...
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Our objective: TO BE RESPONSIBLE PROGRAMMERS FOR MANKIND.
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Our objective: TO BE ORGANIZED SYSTEMS DEVELOPERS.
<ul><li>INTPROG </li></ul><ul><ul><li>Java Concepts </li></ul></ul><ul><li>DATABAS </li></ul><ul><ul><li>Database Concepts...
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development What you could have done before: “ BASTA GUMANA AYOS NA YAA...
<ul><li>One JSP file  DOES ALL THE HARDWORK </li></ul><ul><ul><li>Stores and retrieves data from database </li></ul></ul><...
<ul><li>Some problems encountered </li></ul><ul><ul><li>Tracking </li></ul></ul><ul><ul><ul><li>“ Hindi ko na maalala kung...
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development What needs to be done: MVC IS THE HACK!
<ul><li>Model-View-Controller </li></ul><ul><ul><li>Separation of  business logic  from  user interface </li></ul></ul><ul...
<ul><li>Three elements </li></ul><ul><ul><li>Model </li></ul></ul><ul><ul><li>View </li></ul></ul><ul><ul><li>Controller <...
<ul><li>Model </li></ul><ul><ul><li>Object representing data </li></ul></ul><ul><ul><li>Talks to the database </li></ul></...
<ul><li>View </li></ul><ul><ul><li>Visualization of model </li></ul></ul><ul><ul><li>What the user sees, where the user in...
<ul><li>Controller </li></ul><ul><ul><li>Facility to change the state of the model </li></ul></ul><ul><ul><li>Interprets w...
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development VIEW CONTROLLER MODEL
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Data to get:  Products
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Retrieving  Products Display:  Products
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Situations on how to use MVC MOAR EXAMPLES
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development GroupID GroupName GroupDesc GroupCreator GroupCrDate 1 Naru...
<ul><li>What will the controller do? </li></ul><ul><li>What will the model do? </li></ul>06/08/09 Ermilo John D. Gialogo, ...
<ul><li>Controller </li></ul><ul><ul><li>Get all user inputs </li></ul></ul><ul><ul><ul><li>Validate if it conforms to sta...
<ul><li>Model </li></ul><ul><ul><li>Initialize the driver </li></ul></ul><ul><ul><li>Prepare the query </li></ul></ul><ul>...
06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Now for the fun part HANDS-ON
Upcoming SlideShare
Loading in …5
×

MVC For Web Development

4,092 views

Published on

Discussion on what a Model View Controller is and what it can do for systems development.

Published in: Education, Technology, Business
1 Comment
1 Like
Statistics
Notes
  • if someone is designing a web site what is the best software to team up with MVC more so for the graphics?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,092
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

MVC For Web Development

  1. 1. Presented by: Ermilo John D. Gialogo, Jr. La Salle Computer Society De La Salle University 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  2. 2. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Our objective: TO BE RESPONSIBLE PROGRAMMERS FOR MANKIND.
  3. 3. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Our objective: TO BE ORGANIZED SYSTEMS DEVELOPERS.
  4. 4. <ul><li>INTPROG </li></ul><ul><ul><li>Java Concepts </li></ul></ul><ul><li>DATABAS </li></ul><ul><ul><li>Database Concepts </li></ul></ul><ul><li>DEVWEB </li></ul><ul><ul><li>HTML/Web Concepts </li></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  5. 5. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development What you could have done before: “ BASTA GUMANA AYOS NA YAAAN!” >:D
  6. 6. <ul><li>One JSP file DOES ALL THE HARDWORK </li></ul><ul><ul><li>Stores and retrieves data from database </li></ul></ul><ul><ul><li>Layouts the display of data </li></ul></ul><ul><ul><li>Checks the input from the user </li></ul></ul><ul><ul><li>Does this, does that, etc. etc. </li></ul></ul><ul><li>Sa karinderya, si manang ay nagluluto habang nags-serve habang kumukuha ng bayad. </li></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  7. 7. <ul><li>Some problems encountered </li></ul><ul><ul><li>Tracking </li></ul></ul><ul><ul><ul><li>“ Hindi ko na maalala kung saan ko nilagay yung function ng adding users!” </li></ul></ul></ul><ul><ul><ul><li>“ OM*G ang hirap naman i-debug!” </li></ul></ul></ul><ul><ul><li>Changes in implementation </li></ul></ul><ul><ul><ul><li>“ Ayoko na galawin yan kasi may Java codes na yan! Mamaya masira ko pa ‘tong MP natin!” </li></ul></ul></ul><ul><ul><ul><li>“ Kaso iisa-isahin ko pa yung mga JSP files kasi may hindi tayo napansin sa project specs!” </li></ul></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  8. 8. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development What needs to be done: MVC IS THE HACK!
  9. 9. <ul><li>Model-View-Controller </li></ul><ul><ul><li>Separation of business logic from user interface </li></ul></ul><ul><ul><li>Changes in one will not affect the other. </li></ul></ul><ul><li>Sa fastfood , may cashier, may waiter at may cook. </li></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  10. 10. <ul><li>Three elements </li></ul><ul><ul><li>Model </li></ul></ul><ul><ul><li>View </li></ul></ul><ul><ul><li>Controller </li></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  11. 11. <ul><li>Model </li></ul><ul><ul><li>Object representing data </li></ul></ul><ul><ul><li>Talks to the database </li></ul></ul><ul><ul><ul><li>Store </li></ul></ul></ul><ul><ul><ul><li>Retrieve </li></ul></ul></ul><ul><ul><ul><li>Validate </li></ul></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  12. 12. <ul><li>View </li></ul><ul><ul><li>Visualization of model </li></ul></ul><ul><ul><li>What the user sees, where the user interacts </li></ul></ul><ul><ul><ul><li>Display </li></ul></ul></ul><ul><ul><ul><li>Receive input </li></ul></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  13. 13. <ul><li>Controller </li></ul><ul><ul><li>Facility to change the state of the model </li></ul></ul><ul><ul><li>Interprets what the user wants, delegates what the model will do </li></ul></ul><ul><ul><ul><li>Process input </li></ul></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  14. 14. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development VIEW CONTROLLER MODEL
  15. 15. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Data to get: Products
  16. 16. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Retrieving Products Display: Products
  17. 17. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  18. 18. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Situations on how to use MVC MOAR EXAMPLES
  19. 19. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development GroupID GroupName GroupDesc GroupCreator GroupCrDate 1 Naruto Sasuke is gay! toriavalon 1/25/2009 2 SOCCOMP09 Miss K’s class Kiranbudhrani 1/7/2009
  20. 20. <ul><li>What will the controller do? </li></ul><ul><li>What will the model do? </li></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  21. 21. <ul><li>Controller </li></ul><ul><ul><li>Get all user inputs </li></ul></ul><ul><ul><ul><li>Validate if it conforms to standards (character limit, etc) </li></ul></ul></ul><ul><ul><ul><ul><li>If not, give “Error in input” view </li></ul></ul></ul></ul><ul><ul><li>Get current user’s username </li></ul></ul><ul><ul><li>Get system’s date </li></ul></ul><ul><ul><li>Pass all parameters to Model </li></ul></ul><ul><ul><li>Wait for Model to give status </li></ul></ul><ul><ul><ul><li>Give “Success” or “Error” view </li></ul></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  22. 22. <ul><li>Model </li></ul><ul><ul><li>Initialize the driver </li></ul></ul><ul><ul><li>Prepare the query </li></ul></ul><ul><ul><ul><li>Must be Prepared Statements </li></ul></ul></ul><ul><ul><li>Run the query </li></ul></ul><ul><ul><li>Tell controller on what happened after running the query </li></ul></ul>06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development
  23. 23. 06/08/09 Ermilo John D. Gialogo, Jr. ● MVC for Web Development Now for the fun part HANDS-ON

×