Date post: | 29-Nov-2014 |
Category: |
Entertainment & Humor |
Upload: | sqabd |
View: | 916 times |
Download: | 0 times |
Convention over
Configuration
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
So what is it?
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
We use it all the time, in our everyday life, and in software development!
Here goes the boring definition:“Convention over Configuration is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.”
We use it all the time!
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
Each of us have conventions e.g. where we keep DVDs, morning chores, habits (good or bad)!
We have conventions for where we place our files in our hard disks! Conventions help us to
be more productive in our daily lives!
We also use it when
developing software! Ahsanul Bari // Ahsan (http://ahsanity.com)
Trippert Labs , Inc.
Each of us have conventions when in comes to naming files, functions, classes
Conventions for how we add comments
Where we place models, controllers and views
How and when we add events to DOM
And many more ...
If everyone already knows
and uses it, then whats my point?
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
We can use the idea of 'Conventions' to
reduce the amount of configuration files:
Convention over Configuration
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
With configuration files, it takes time to get a project running, each
time, everytime!
Many software development platforms and frameworks have tones of configuration files!!!
With the complexity of an application the size and number of
those files grows as well.
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
Instead
<hibernate-mapping><class name="User" table="users"> <id name="ID" column="id" type="string"> <generator class="assigned"></generator> </id> <property name="password" column="password" type="string" /></class></hibernate-mapping>
CREATE TABLE users ( id VARCHAR(20) NOT NULL, password VARCHAR(20), PRIMARY KEY(id));
Convention: all model classes will be singular, and will have plural table names
Configuration
Convention
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
Faster development
Good things!!!!
Promotes uniformity
Easier to maintain software
No huge configuration files
Structured Code Base
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
Requires familiarity
Bad Things!!!!
Larger framework
Hard to refactor existing frameworks to adopt a new convention
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
A few frameworks that uses CoC
Ruby on Rails
CakePHP
GrailsJBoss Seam
And many more
So it is really that useful? Thats for you to find out
and decide.
Ahsanul Bari // Ahsan (http://ahsanity.com)Trippert Labs , Inc.
I like it, so here I am , talking about it! :D