Web Frameworkscode4lib SIG Spring Forum     March 16, 2011
SIG Co-convenersJoanna DiPasquale, Columbia University LibrariesKevin Reiss, CUNY Library ServicesYitzchak Schaffer, Touro...
code4libhttp://code4lib.org/about   Grassroots library technology professional... collective   Especially interested in th...
Why frameworks? DRY - dont repeat yourself   within your app   among your apps DRE - dont repeat everybody   in the greate...
DRY / DREChances are your app will require some or all of these:   Pretty URLs ( http://mylocalpl.org/news/basement-floode...
Separation of concerns  Focus on the task at hand - separate out related but  different features  Easier to decouple and r...
<?// posts.php$db = DB::connect( $params );$q = "SELECT * FROM post WHERE title={$_GET[title]}";$result = $db->execute( $q...
<?include header.inc;$db = DB::connect( $params );$q = "SELECT * FROM post WHERE title={$_GET[title]}";$result = $db->exec...
// post_controller.php<?$posts = ORM::table(post)     ->findByTitle( $params[title] );?>// post_view.php<ul> <? foreach ( ...
Why not frameworks? Server resources overhead (especially RAM) Promote ignorance of low-level processes and attendant issu...
Web Frameworks
Upcoming SlideShare
Loading in …5
×

Web Frameworks

446 views
431 views

Published on

An introduction to the basic concepts and advantages of web application frameworks.

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
446
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Web Frameworks

  1. 1. Web Frameworkscode4lib SIG Spring Forum March 16, 2011
  2. 2. SIG Co-convenersJoanna DiPasquale, Columbia University LibrariesKevin Reiss, CUNY Library ServicesYitzchak Schaffer, Touro College Libraries@yitznewton
  3. 3. code4libhttp://code4lib.org/about Grassroots library technology professional... collective Especially interested in the development of open-source software Started in 2003 as email list IRC: #code4lib on chat.freenode.net Annual national conferences (Feb; next year in Seattle) Regional ad hoc meetings (including this SIG) Beer
  4. 4. Why frameworks? DRY - dont repeat yourself within your app among your apps DRE - dont repeat everybody in the greater community Architecture - separation of concerns
  5. 5. DRY / DREChances are your app will require some or all of these: Pretty URLs ( http://mylocalpl.org/news/basement-flooded-again ) Forms and validation Input security Database access → ORM Unit testingSomebody else did that already! Frameworks provide easyways to perform common web tasks.
  6. 6. Separation of concerns Focus on the task at hand - separate out related but different features Easier to decouple and reuse code
  7. 7. <?// posts.php$db = DB::connect( $params );$q = "SELECT * FROM post WHERE title={$_GET[title]}";$result = $db->execute( $q );?><ul> <? while ($row = $db->fetch($result)): ?> <li> <a href="/show.php?id=<? echo $row->id ?>"> <? echo $row->title ?> </a> </li> <? endwhile; ?></ul><? $db->close() ?>
  8. 8. <?include header.inc;$db = DB::connect( $params );$q = "SELECT * FROM post WHERE title={$_GET[title]}";$result = $db->execute( $q );?><ul> <? while ($row = $db->fetch($result)): ?> <li> <a href="/show.php?id=<? echo $row->id ?>"> <? echo $row->title ?> </a> </li> <? endwhile; ?></ul><? $db->close() ?>
  9. 9. // post_controller.php<?$posts = ORM::table(post) ->findByTitle( $params[title] );?>// post_view.php<ul> <? foreach ( $posts as $post ): ?> <li> <? echo link_to( $post->title, post/show?id=.$post->id ) ?> </li> <? endforeach; ?></ul>
  10. 10. Why not frameworks? Server resources overhead (especially RAM) Promote ignorance of low-level processes and attendant issues (SQL injection, cross-site scripting attacks, etc.)

×