frameworks galore: a pragmatic review

46
Frameworks Galore A pragmatic review of available frameworks Now with 20% more framework-y goodness!

Upload: netc2012

Post on 02-Jul-2015

608 views

Category:

Technology


1 download

DESCRIPTION

A wide and shallow survey of popular frameworks for Javascript, CSS, PHP, Java, Groovy, Ruby, Perl, Python and other web oriented technologies.

TRANSCRIPT

Page 1: Frameworks Galore: A Pragmatic Review

Frameworks Galore

A pragmatic review of available frameworks

Now with 20% more framework-y goodness!

Page 2: Frameworks Galore: A Pragmatic Review

What are frameworks?

• Frameworks are tools or libraries that you can include in your application to take advantage of functionality that you would otherwise need to develop.

Page 3: Frameworks Galore: A Pragmatic Review

When should I use a framework?

• One of the main advantages of a framework is the reduction of developer workload.

• Another approach is to utilize frameworks for their subject expertise.

Page 4: Frameworks Galore: A Pragmatic Review

How would a framework help me?

• Drop-in functionality.

• Reduced maintenance.

• Faster startup and prototyping.

Page 5: Frameworks Galore: A Pragmatic Review

Downsides to using frameworks?

• Increased complexity.

• Enlarged security profile.

• Unused functionality.

Page 6: Frameworks Galore: A Pragmatic Review

What frameworks are out there?

Finally, the good stuff!

Page 7: Frameworks Galore: A Pragmatic Review

Javascript Frameworks

• Historically focused on the client side, but with the advent of technologies such as Node.js and Vert.x this focus is lessening.

• Functionality ranges from DOM manipulation to visual effects.

• Purely client side MVC applications are possible with the functionality available from some frameworks.

Page 8: Frameworks Galore: A Pragmatic Review

jQuery, jQuery UI, jQuery Mobile

• jQuery features DOM element Selection, Events, AJAX interaction, Effects and extendable via Plugins.

• jQuery UI enhances jQuery with Themableappearance, Widgets, Interactions, Utilities and more Effects.

• jQuery Mobile focus jQuery and jQuery UI functionalities on mobile platforms (HTML5)

Page 9: Frameworks Galore: A Pragmatic Review

Modernizr.js

• Used to fill in functionality in browsers that lack HTML5 feature support (IE mostly)

• Checks for a variety of HTML5 and CSS3 features and can load various modules in response to the presence of those capabilities.

• Very helpful for situations where support of older browsers is required but newer features are desired.

Page 10: Frameworks Galore: A Pragmatic Review

Backbone.js + Underscore.js

• Backbone adds modeling, collections, manipulations and event modeling to allow your application to interact with a backend via JSON.

• Underscore provides utility functions for use by Backbone, but can be used without Backbone.

Page 11: Frameworks Galore: A Pragmatic Review

Spine.js + Spine Mobile

• Adds Models, Views, Controllers, Routers, and Events to web applications.

• Spine Mobile aims to match Native applications for mobile users and extends the Spine functionality with a Touch interface and a web interface equivalent of Story Boards for Xcode.

Page 12: Frameworks Galore: A Pragmatic Review

Mustache.js + Handlebars.js

• Mustache (no designation) is a template languages for HTML generation.

• Mustache.js is the javascript processor for Mustache templates.

• Handlebars is a superset of mustache and adds some processing logic (iteration and conditional evaluation) to mustache templates.

Page 13: Frameworks Galore: A Pragmatic Review

CSS Frameworks

• Used to standardize CSS implementations across various browser platforms.

• Implement good practices for layout and typography.

• Allow easier layout by standardizing columns.

• More modern systems allow for designs that respond to the width of the viewport on the browser.

Page 14: Frameworks Galore: A Pragmatic Review

Twitter Bootstrap

• Actually includes JS functionality built on top of jQuery.

• Cohesive appearance of elements.

• Helps overcome lack of a UI/UX designer on the team by providing some basic elements and styles for your information, forms, and layout.

Page 15: Frameworks Galore: A Pragmatic Review

960 Grid System

• Designed to help layout pages of information.

• Designed around a 12, 16 or 24 column approach for a screen width of ~960px.

• Very light weight (~7KB)

• Only concerned with columns, widths and placement.

Page 16: Frameworks Galore: A Pragmatic Review

Blueprint CSS

• A column based system, but expanded to include typography and form elements/interfaces.

• Includes a plugin system.

• Additional support for printing forms

Page 17: Frameworks Galore: A Pragmatic Review

Less CSS

• Actually extends the original CSS with features such as variables, functions, operations, mixins, and conditional responses.

• Available as a javascript library to add interpretation to your webpages.

• Can also be used to preprocess your .less files into .css files for inclusion in your application.

• Responsive? Gotcha covered!

width: 100%*(140/620);

Page 18: Frameworks Galore: A Pragmatic Review

SASS CSS

• Another preprocessor style framework for CSS.

• Adds functionality for variables, nesting, mixins, and selector inheritence.

• Used by Rails 3.1+

• Also supports math inline, so:

font: #{$font-size}/#{$line-height};

Page 19: Frameworks Galore: A Pragmatic Review

Data Frameworks

• Serve to isolate your application logic from the persistence layer beneath.

• Allows your application to run against various database management systems without convoluted configurations.

• Provides a façade covering over the specific idiosyncrasies for the DBMS.

Page 20: Frameworks Galore: A Pragmatic Review

SQLAlchemy

• Two main components: Core and ORM

• Core: Generates DDL and abstracts the SQL commands.

• ORM: Allows more abstraction, allowing you to delegate persistence to the SQLAlchemy engine.

• Mature, High Performance framework

• Database Reflection/Type Introspection

• Allows hand-written SQL to be injected if needed.

Page 21: Frameworks Galore: A Pragmatic Review

DBIx::Class

• Speeds development, data abstraction and improves portability for your application.

• Allows you to represent your business rules through OO code and generate boilerplate code for CRUD operations.

• Available modules to inspect your database, and automatically create classes for all the tables in your schema.

Page 22: Frameworks Galore: A Pragmatic Review

Hibernate/nHibernate

• Originally a Java technology, but a .NET version is available too.

• Multiple configuration pathways, XML or JPA/Annotations

• Swappable connection pooling and caching techniques.

• Very flexible representations of relationships of objects to the database.

• HQL for Queries and Criteria elements.

Page 23: Frameworks Galore: A Pragmatic Review

ADO.NET Entity Framework

• Three operational modes: Code First, Model First and Database First.

• Code First is typically used when you’ve already developed code based objects and generally requires some minor adjustments to the base object to enable linkages to the child/parent objects themselves.

• Model First is typically used in new projects and excels at allowing a developer to rapidly work up the data model and interactions between the various modeled entities.

• Database First can be used to create strongly typed classes from an existing database. This can help with mapping new applications to old data sources or “web enabling” old applications.

Page 24: Frameworks Galore: A Pragmatic Review

MyBATIS

• Supports Java and .NET

• While Hibernate/nHibernate do many things for you automatically, MyBatis takes the other approach of asking you to dictate what code results in what DB interactions (mapping).

• Still uses a Unit of Work operational style (openSession() and closeSession() calls are expected).

Page 25: Frameworks Galore: A Pragmatic Review

Miso.Dataset

• A javascript library that allows dataset operations on the client side.

• Functions include filtering, grouping, aggregate calculations and other common manipulations that are typically performed at the DB layer.

• Can import data from json or other formats via AJAX calls.

Page 26: Frameworks Galore: A Pragmatic Review

Web Frameworks

• Generally provide some functionality to abstract away the details.

• Often used in conjunction with a Data Abstraction Framework and possibly a Javascript framework and/or CSS framework.

Page 27: Frameworks Galore: A Pragmatic Review

CodeIgniter

• A MVC based PHP system with a separation of your application code vs. system code.

• Well documented.

• Provides DB Access, Templates, Validation, Session Management, and more.

• Modular allowing additional libraries and helper functions.

• Integrates well with other static content frameworks (CSS and Javascript)

Page 28: Frameworks Galore: A Pragmatic Review

CakePHP

• Another PHP MVC system with excellent documentation.

• Many built in features for XSS, CSRF, and input validations.

• Components to help with email, cookie, security, session, and request handling.

• Requires minimal (if any) setup on the server.

Page 29: Frameworks Galore: A Pragmatic Review

Spring MVC

• Excellent (excessive?) separation of concerns.

• Available to a wide range of Java based application servers.

• Flexible configuration and management.

• Able to import or take advantage of an incredible number of Java based libraries.

Page 30: Frameworks Galore: A Pragmatic Review

Stripes

• Attempts to simplify creation of Java based MVC web applications.

• Auto-discovery of ActionBeans (convention over configuration)

• Flexible routing configuration (you want to masquerade as a collection of .html files, no problem)

• Requires Java 5 (because it uses Annotations and Generics)

Page 31: Frameworks Galore: A Pragmatic Review

JVM->Groovy->Grails

• Based on the Groovy scripting language (runs on the JVM Platform)

• Started as a port of Ruby on Rails, so it inherits many of the foundational concepts of Rails

• Includes a Groovy based ORM, which provides a façade over Hibernate.

• Simplifies development and has interop with Java based classes (JAR)

Page 32: Frameworks Galore: A Pragmatic Review

ASP.NET Web Forms

• Tons of Support, tutorials and other educational materials on the internet.

• Well constructed and fairly complete attempt to introduce a stateful mindset to web applications.

• Can get heavy handed with view state and sometimes page life cycle becomes a mystery.

• Many helper utilities and a very good IDE.

Page 33: Frameworks Galore: A Pragmatic Review

ASP.NET MVC

• Catching up to the MVC/lighter web applications process.

• Several versions released in rapid fire.

• Supports multiple templating/view engines.

• Benefits from much of the .NET ecosphere and can take advantage of my of the features from Web Forms (but not viewstate based controls)

Page 34: Frameworks Galore: A Pragmatic Review

Ruby on Rails

• Takes advantage of strong Ruby ecosphere.

• Opinionated software can help reduce the number of technology concerns for application development.

• Strongly supports testing.

• Many innovations that have been ruthlessly copied by others (such as Grails and many other web application frameworks).

Page 35: Frameworks Galore: A Pragmatic Review

Sinatra

• Very slim feature set, but very versatile.

• Well suited for exposing API end points without incurring overhead.

• Integrates with rack middleware (e.g. for sessions and auth functionality)

• Very flexible template resolution:

require 'rdiscount'

get('/') { markdown :index } #returns index.markdown

Page 36: Frameworks Galore: A Pragmatic Review

Catalyst

• Perl based MVC framework

• Swappable ORM layers (DBIx::Class, DBI, or many other persistence layers)

• Template processing via several optional engines

• Many included plugins for Form Validation, Request Handling, Session Management, and I18N.

Page 37: Frameworks Galore: A Pragmatic Review

Django

• Python based MVC Framework – Detail oriented yet quick to get results.

• Provides it’s own internal ORM along with several classes to help query and sift data.

• Calls views controllers and controllers views, or is it the other way around?

• “Pluggable” features form sub-functionality of a larger application or project.

Page 38: Frameworks Galore: A Pragmatic Review

Flask

• A “micro” framework that offers much basic functionality without dictating backend options.

• Managed Cookies, Flash Messages, Templates, File Uploads and many other handy items are implemented.

• Can be very handy for small API endpoints, but might not be a great fit for a larger application.

Page 39: Frameworks Galore: A Pragmatic Review

Testing Frameworks

• Serve to provide a suite of functions to enhance or establish tests for your code base.

• Several flavors from unit testing (testing specific small pieces of code) to integration testing (testing functionality of disparate systems) to usability testing.

• Often tied to the programming language used in a web application framework or other coding environment.

Page 40: Frameworks Galore: A Pragmatic Review

Unit Testing

• NUnit (.NET)

• Visual Studio Unit Testing Framework (.NET)

• JUnit (JVM)

• TestNG (JVM)

• PHPUnit (PHP)

• test::unit/minitest (Ruby)

• unittest (Python)

Page 41: Frameworks Galore: A Pragmatic Review

Behavior Testing

• Rspec (Ruby)

• Jasmine.js (Javascript)

• PySpec (Python)

Page 42: Frameworks Galore: A Pragmatic Review

Browser/Automation Testing

• Selenium

• Mocha.js

Page 43: Frameworks Galore: A Pragmatic Review

Obligatory Incendiary Slide

(Results from https://github.com/seedifferently/the-great-web-framework-shootout)

Framework Requests/Second

Flask 0.7.2 1191

Sinatra 1.2.6 982

Pyramid 1.2 555

CodeIgniter 2.0.3 542

Djanog 1.3.1 465

Rails 3.1 463

CakePHP 1.3.11 193

Page 44: Frameworks Galore: A Pragmatic Review

JVM + Ruby = JRubyJRuby + JBoss AS = TorqueBox

• Implement Ruby, Rails or Sinatra Applications on top of JBoss AS. Which brings to the table InfiniSpan, JDBC, JBoss Clustering and JBossScheduling features.

• Natively run WAR/EAR packaged systems side-by-side (from other jvm based systems).

BONUS SLIDEAchievement: Perseverance Unlocked!

Page 45: Frameworks Galore: A Pragmatic Review

The End

or is it?

The comic faces and language logos used in this presentation are the property of their respective owners.

Page 46: Frameworks Galore: A Pragmatic Review

Questions?

Lee Fent

Email: [email protected]

Twitter: @lee_fent