1 / 28

Web App Frameworks

Web App Frameworks. aka The Luke and Josh Variety Hour. servlets are terrible. Way too many System.out.println ’s Tightly coupled Umm... sessions The ultimate DIY. web frameworks are cool. Fewer System.out.println ’s Hide the gross stuff (sessions...) Lots of free stuff

gene
Download Presentation

Web App Frameworks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web App Frameworks aka The Luke and Josh Variety Hour

  2. servlets are terrible • Way too many System.out.println’s • Tightly coupled • Umm... sessions • The ultimate DIY

  3. web frameworks are cool • Fewer System.out.println’s • Hide the gross stuff (sessions...) • Lots of free stuff • Steep learning curve :(

  4. the basics • Model (the stuff) • View (the pretty face) • Controller (the middleman)

  5. model (the stuff) • Persistent data • Trucks, POs, etc.

  6. controller (the middleman) • Pull data / I can has trucks? • Push data / save the truck’s state

  7. view (the pretty face) • Show the trucks • Edit the trucks

  8. Seam It’s pretty cool I guess

  9. seam model • Model = Java object + annotations • Truck.java

  10. seam controller • Controller = Java object + annotations • YardController.java

  11. seam view • View = XHTML • trucks.xhtml

  12. Ruby on Rails Why it is Always the Right Answer

  13. rails • “Web development that doesn’t hurt.” • Based very strongly on the Ruby scripting language • Heavily Object-Oriented • Dynamic type • Basically, it’s scripting for the web. • Well-developed programming paradigm • Huge community support and documentation

  14. paradigm • RESTful design • REpresentativeState Transfer • Designs data control into the four natural states of HTTP communication • Not specific to Rails, just the adopted paradigm • States: The CRUD Model UD • CRUD • POST • Create • GET • Read • PUT • Update/Create • DELETE • Delete • HTTP • CRUD • POST • Create • GET • Read • PUT • Update/Create • DELETE • Delete • HTTP • CRUD • POST • Create • GET • Read • PUT • Update/Create • DELETE • Delete

  15. paradigm • Reasons for RESTful design • Clean, meaningful organization • Organized by action • Concise way of sending data • Improves consistency and data integrity • Simplified interface design • Three components • View data • Create new entry • Edit existing entry

  16. design • How It Looks: an MVC example • The Model, Part I

  17. design • The Model, Part II

  18. design • The Views

  19. design • The Views: Partials

  20. design • The Views: New

  21. design • The Controller: Part 1

  22. design • The Controller: Part 2

  23. why rails is better • Single-Source Solution… mostly • Install Ruby and RoR and you’re ready to start. • The total MVC solution is wrapped up in Rails, no need for: • JBoss framework • Seam • Hibernate • JSF • Richfaces • This includes JavaScript/AJAX functionality. All Ruby code which is rendered to HTML/Javascript later.

  24. why rails is better • Integration across platform much smoother, all Ruby/Rails code, no need for other layers. • Because of this, it’s faster. • More control over finer details of: • Server environment • Development or Production • Database setup – lots of options • Optimization – lots of opportunities for this • Large number of plugins • Can get a bit over-the-top if not careful.

  25. downfalls • Still gaining adoption on a large scale • Very strict definitions (namely database naming conventions) • A bad thing? • Optimization is not automatic, programmer needs to do a lot to optimize • Takes smart programming to gain in efficiency • A bad thing? • Not as many sweet built-in GUI features

  26. Last Word Use Ruby on Rails... it’s amazing

  27. Questions?

  28. references • http://www.seamframework.org/Documentation/GettingStarted • http://livedemo.exadel.com/richfaces-demo/richfaces/message.jsf?s=glassX • http://www.infoq.com/articles/jboss-seam • http://rubyonrails.org/ - Ruby on Rails site • http://www.railsbrain.com/ - Rails documentation • http://railscasts.com/ - Rails Tutorials via Screencast • http://railsforum.com/- Rails help / discussion forum

More Related