jacopo beschi: yet another web guy

Posts Archive

SOLID Design principles and Php: Single responsability

Created at: Jan/23/2014 jacopo beschi

Hello guys, this is the first article (of 5) About SOLID design principles. Solid design principles was written by Uncle Bob Martin with the objective to help building quality code. But how can you say that you have written good code? You could say: when the code works its good code, but in fact that's not; in fact the biggest quality of software are that it's easy to replicate and easy to modify.

Read on

Active Record Design pattern

Created at: Jan/15/2014 jacopo beschi

Hello folks, in this article i'll briefly explain the Active record design pattern. Active record is one of the data access pattern which helps you to map your domain model (Object) into Relational Database. Basically with active record, every istance of your class correspond to one row in a table of the database (one to one relationship). The active record basic usage consist in extending the abstract active record class from your model class. With this pattern the biggest advantage it's simplicity, in fact this pattern is used in many ORM, for example Laravel ORM Eloquent, Yii ORM, FuelPHP ORM or Ruby on Rails ORM. I'll show you how that works with a simple example.

Read on

laravel form handling with event-driven code

Created at: Jan/07/2014 jacopo beschi

Hello guys, how many times you have created a form that has to handle many complicated tasks? If the answer is "many" i have one way for handling that in a very fashioned way based on events using laravel framework 4+. The proof of concept in OOP is the "Chain of responsabiity" design pattern. Imagine now that when we process a form we want to execute a list of action consequently, in the case one of them would fail we will return an error, otherwise we return a success message.

Read on

Php class table inheritance

Created at: Jan/07/2014 jacopo beschi

In the previous article i talked about Single table inheritance which is one of the four ways to map inheritance into RDBMS (Relational Database Management System). As stated in the other article this pattern comes from Marwin fowler PoEAA Book. In this one we talk about Class table inheritance. Class table inheritance is an approach that consist in creating a table for each class in the object-model.

Read on

jacopobeschi.com is out!

Created at: Jan/06/2014 jacopo beschi

Welcome, my friend. This post is here to tell you that jacopobeschi.com is out! Be aware: you will find some cool articles every week, so dont forget to to keep yourself updated anytime a new article pops out!

Read on