Best Way to Plan Your Web Application

When contacted by potential clients, we are often presented with diverse  information including  links to competitors' sites, prototypes, feature lists, or wireframes, while other clients may come to us with just an idea.  However, presenting details of your vision clearly in writing will lead to a better web application. This will also enable professionals to more accurately estimate  the time and costs necessary to implement your ideas.

So how can you best identify the features and functionality you need when looking to build a new web application? Let's consider the three main formats for doing this: Wireframes, Feature Lists and User Stories.

Read the rest of this post »

Filed under  //  Scrum   agile   development   project management  
Comment (1)
Posted by Laura Ford 

Rails 3 default cookie domain for subdomains

In Rails 3 the way you set your default cookie domain to allow your session to be shared across subdomains has changed. In Rails 2.3.5 you would add the following to your application.rb :



config.action_dispatch.session = {:domain =>".mydomain.com"}


In Rails 3 there is now a session_store.rb initialiser, in there you can configure your default domain like so:



Rails.application.config.session_store :cookie_store,
                                  :key => '_app_session',
                                  :domain => '.mydomain.com'


 

Filed under  //  development   ruby on rails  
Comments (5)
Posted by Matthew Ford 

SVG Images and Animations on the Web with Raphaël

Last week I gave a talk at Google OSJam on Raphaël (a javascript SVG library), the library that makes it easy to draw and animate vector graphics on a browser.

SVG is one of the many methods of drawing images on the web. Some of the other technologies include Flash, Canvas and now WebGL.

The reason we used Raphael in some of our projects is that we needed to bind events to the shapes we drew. For example, we had to create an interactive gantt chart that displayed a form via Ajax when you clicked on a task. This functionality in Raphael is made possible by the fact that SVG paths are DOM elements, although it does mean you don't get the performance of pixel manipulation as you would with canvas. Raphael also renders VML when on IE, so in theory your graphics should be cross-browser compatible.

I gave a demo of an animated clock that I'd made a few hours beforehand with Raphael and the jquery.jclock library. The clock will eventually be apart of a Panic inspired dashboard we are building to increase visibility across all of our projects.

The clock itself is quite simple: I modified the jclock library to trigger a 'tick' event, which we later used to animate the SVG clock for the hand rotation. Since the talk, I have also developed an alternate style for the clock, but the original code and examples can be found here (the library is creatively called jquery.svgclock.js):

http://github.com/bitzesty/hud

Svgclocks


Brought to you by Bit Zesty - a 'crack' team of Ruby on Rails web developers

Filed under  //  development   javascript   open source   presentation   svg  
Comments (0)
Posted by Matthew Ford 

What is Ruby on Rails and Why Should I Use it for Web Applications?

A few potential clients have asked us why we choose to use Ruby on Rails to develop web applications instead of all the other web frameworks and languages. There are many reasons for our decision, but before I embark on a discussion of the advantages (and disadvantages) of Ruby on Rails, I should first explain what Ruby on Rails actually is.

Ruby on Rails
Rails is a development tool which gives web developers a framework, providing structure for all the code they write. The Rails framework helps developers to build websites and applications, because it abstracts and simplifies common repetitive tasks.

Rails is written in Ruby, the programming language which is also used alongside Rails. Ruby is to Rails as PHP is to Symfony and Zend, or as Python is to Django. The appeal of Ruby to developers lies in the elegance and directness of the language.

A key principle of Ruby on Rails development (henceforth 'Rails') is 'Convention over Configuration' (CoC). This means that the programmer only has to write new code for the areas in which their application deviates from the standard. 

Another characteristic of Rails is the emphasis on RESTful application design. REST (Representational State Transfer) is a style of software architecture based around the client-server relationship. It encourages a logical structure within applications, which means they can easily be opened up as an API (Application Programming Interface).

Agile web development is also advocated within the Rails community. This is a particular method of structuring the development process and ensuring that effective communication occurs between the developers and the client.

During its short existence, Ruby on Rails has gained a large and enthusiastic following. This is largely due to the way it excels at enabling the rapid development of dynamic web applications.

I will now consider the main arguments for and against Rails.

Read the rest of this post »

Filed under  //  development   ruby on rails  
Comment (1)
Posted by Matthew Ford 

MongoDB with MongoMapper and Ruby on Rails

I'm sure we've all heard the pros & cons of the NoSQL movement so these will not be covered here. I've been experimenting with a number of alternatives to RDBMS for a while such as CouchDB, TokyoCabinet, Redis and recently MongoDB.

MongoDB (from "humongous") is a scalable, high-performance, open source, schema-free, document-oriented database. Written in C++, MongoDB features:

MongoDB bridges the gap between key-value stores (which are fast and highly scalable) and traditional RDBMS (which provide structured schemas and powerful queries).

- from the MongoDB site.

The reason I've settled on MongoDB is (for me) it's been the most useful, more so than straight KV stores such as Redis and Tokyo. Technically CouchDB is very similar to MongoDB being a document store too, however MongoDB seems to 'gel better' (that's a technical term).

To be able to use this MongoDB goodness in my Rails app, I'm making use of the MongoMapper gem as it's the most popular one (github forks and watchers metric). There are other ORMs which you can use with MongoDB, Mongoid seems like a good alternative and the rest are documented here: http://www.mongodb.org/display/DOCS/Ruby+Language+Center.

Installation

Download and run mongod http://www.mongodb.org/display/DOCS/Downloads

Install the gems:

Configure your environment, and remove AR:

Add a config file for your database:

And add an initializer to setup MongoMapper and friends:

Getting stuff done

Now I know what you might be thinking, 'oh no not another ORM all my favorite gems won't work!', that is not the case! (*in some cases)

Usage

These Models are stripped down but you get the idea. Let say you're using Devise, then your User model could look like this:

And if that user had comments the model could look like:

These are just to help kick-start your app development, for more complete examples see the open source apps and http://www.mongodb.org/display/DOCS/MongoDB+Data+Modeling+and+Rails :

Open Source Ruby Applications using MongoDB (and MongoMapper)

NewsMonger - A simple social news application demonstrating MongoDB and Rails


Oupsnow - A bugtracker in Rails/MongoMapper
http://github.com/shingara/oupsnow/

Watchtower - An example app built with Sinatra, Mustache and MongoDB
http://github.com/kneath/watchtower/

Shapado - stackoverflow like question and answer site: 
http://gitorious.org/shapado/shapado

mmmblog - a blogging engine by the same guys as Shapado (http://blog.ricodigo.com/)
http://gitorious.org/mmmblog

More at http://wiki.github.com/jnunemaker/mongomapper/projects-using-mongomapper

Pro Tips

  • MongoMapper uses a fork of the validatable gem - which has some differences with AR validations
  • Denormalization is needed to reduce round-trips to the DB
  • Change how you think of your data models - this is closer to an object store
  • The finders have nifty options checkout http://wiki.github.com/jnunemaker/mongomapper/whats-new (0.5.7)
  • Don't be afraid to drop down and use to the Ruby MongoDB driver directly http://www.mongodb.org/display/DOCS/Ruby+Tutorial
  • Keep an eye out on the github commit feed as it's a bit of a moving target still

Summary
No migrations (yes!), storing arrays and hashes as attribute keys (sweet), and inplace updates (ftw). We're not going to use MongoDB to build transactional systems any time soon, but for the majority of web applications it's a perfect fit.


Bit Zesty - Ruby on Rails Development (and MongoDB) UK

Filed under  //  development   mongodb   nosql   ruby on rails  
Comments (10)
Posted by Matthew Ford 

Web Development Terminology

While we are not big fans of technical jargon here at Bit Zesty, in some cases it is more helpful to use the correct term rather than rolling out a long and convoluted description of the thing in question each time. We use a few specific terms again and again throughout our site, so I have picked these out and expanded on them below to help new visitors understand what we do.

 

Web Application (webapp)

A web application is computer software which is accessible through the Internet. Social networks, e-commerce sites and wikis are all examples of web applications.

  • Web applications enable you to deliver and update software without having to distribute and install it.  This makes it easier to reach new users as well as allowing you to maintain the software to a standard which keeps existing users happy.
  • One big advantage of web applications is that they are not dependant on the user’s operating system. This means that you can cover a wider market without having to make changes to your software or release different versions.

Ruby on Rails (RoR)

Ruby on Rails is a framework for creating web applications using the Ruby programming language.

  • We choose to use Ruby on Rails because it enables us to build applications more rapidly than on other frameworks, which means that the client receives more features at a lower cost.
  • Another positive is that it encourages good development practices, resulting in higher quality code. This ensures your application is extendable and scalable.
  • By providing excellent support for automated testing, it allows for robust code, which reduces the amount of maintenance required.

Agile Development

Agile is a development methodology which embraces collaboration with customers, face-to-face communication, self-organizing teams, frequent delivery, and the ability to respond to changing requirements.

  • Agile enables you to re-prioritise or even introduce new features at any point. This allows us to react to changes in your business and thus ensure that application is tailored exactly to your needs.

Test Driven Development (TDD)

Test Driven Development is a technique wherein automated tests are created before the program code. This forces code to be written and improved upon until it passes the test.

  • Test Driven Development helps to eliminate the majority of bugs, ensuring you get software that is robust and properly functioning.

This list is by no means complete and I intend to keep updating it, particularly when we add new terminology to our website.

 

Bit Zesty is a Ruby on Rails Company in London

Filed under  //  agile   development   ruby on rails  
Comment (1)
Posted by Laura Ford