frameworks galore: a pragmatic review

Post on 02-Jul-2015

609 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Frameworks Galore

A pragmatic review of available frameworks

Now with 20% more framework-y goodness!

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.

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.

How would a framework help me?

• Drop-in functionality.

• Reduced maintenance.

• Faster startup and prototyping.

Downsides to using frameworks?

• Increased complexity.

• Enlarged security profile.

• Unused functionality.

What frameworks are out there?

Finally, the good stuff!

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.

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)

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.

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.

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.

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.

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.

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.

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.

Blueprint CSS

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

• Includes a plugin system.

• Additional support for printing forms

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);

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};

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.

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.

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.

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.

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.

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).

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.

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.

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)

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.

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.

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)

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)

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.

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)

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).

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

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.

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.

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.

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.

Unit Testing

• NUnit (.NET)

• Visual Studio Unit Testing Framework (.NET)

• JUnit (JVM)

• TestNG (JVM)

• PHPUnit (PHP)

• test::unit/minitest (Ruby)

• unittest (Python)

Behavior Testing

• Rspec (Ruby)

• Jasmine.js (Javascript)

• PySpec (Python)

Browser/Automation Testing

• Selenium

• Mocha.js

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

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!

The End

or is it?

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

Questions?

Lee Fent

Email: lee.fent@okstate.edu

Twitter: @lee_fent

top related