posted by
Stefano
4 days
ago
Often we must work on various Django applications, each one dependent on different set of libraries.
For examples, we are working on a Django 1.1 project and and we need to start a new one with the latest version of the framework.
The best solution is to keep the various environments separate, in order to ensure [...]
posted by
Claudio
8 days
ago
Migrations, in my opinion, are one of the best things in Rails since these allow the creation and populating the database using ruby code without having to worry about which type of db run below.
That said, even writing the migration is better to follow some best practices.
1. DB Index
The first practice I strongly recommend is [...]
posted by
Claudio
22 days
ago
In today’s post I will show some optimization we can do for models. I’ll focus on how to put methods inside the right model and delegation to get a better code.
1. Put method in the right model
In our example, suppose we want to represent the animal world by creating a model Kind that represents [...]
posted by
Stefano
about 1 month
ago
Today’s post discusses the first of the behavioral pattern shown by the GoF, the chain of responsibility.
This pattern expects a series of commands to be executed and a set of objects capable to handle them.
Each of these “handler” objects can send the command to the next handler in the chain if it is not able [...]
posted by
Claudio
about 1 month
ago
Continuing our analysis of the Rails Best Practices today we’ll see two other tricks to make more readable method of the controller.
1. Methods within model
Suppose we have the classic user registry defined in such a way that an admin user can enable or disable other users.
The deactivate method inside user Controller may be defined as [...]