Framework software e Zend Framework

28
© All rights reserved. Zend Technologies, Inc. Zend Framework Enrico Zimuel ([email protected]) Senior Software Engineer, Zend Technologies Zend Framework Core Team PHP.TO.START 11 Luglio 2011, Torino

description

L'importanza di utilizzare un framework software per lo sviluppo di applicazioni web professionali. L'ecosistema PHP e Zend Framework.

Transcript of Framework software e Zend Framework

Page 1: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Framework

Enrico Zimuel ([email protected])

Senior Software Engineer, Zend TechnologiesZend Framework Core Team

PHP.TO.START 11 Luglio 2011, Torino

Page 2: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Mi presento

● Software engineer dal 1996 (in PHP dal 1999)

● Ho svolto attività di ricerca presso l'Informatics Institute dell'Università di Amsterdam

● Lavoro come PHP engineer per Zend Technologies nel team di sviluppo dello Zend Framework

● Scrittore e speaker in conferenze internazionali

● Blog sulla programmazione web in PHP: http://www.zimuel.it/blog

● Socio del GrUSP, fondatore del PUG di Torino

Page 3: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Sommario

● Perchè utilizzare un framework software?

● Introduzione a Zend Framework

● Breve storia del progetto

● Caratteristiche del progetto

● La nuova release 2.0

Page 4: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Framework software

Page 5: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Framework software

● Un framework software è un insieme di librerie o classi riutilizzabili per la realizzazione di un sistema software.

● Caratteristiche di un framework:

▶ Riusabilità▶ Standardizzazione▶ Estensibilità▶ Qualità del codice▶ Sicurezza

Page 6: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Vantaggi nell'utilizzo di un framework

● Velocità di sviluppo

▶ Time to market● Standard nella scrittura del codice

▶ Lavoro in team● Qualità del codice

▶ Minor numero di bug▶ Sicurezza

Page 7: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Come scegliere un framework

● Diffusione del framework

● Documentazione

● Supporto

● Licenza d'utilizzo

● Curva di apprendimento

Page 8: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Esempi di framework software

● Java

▶ Spring

▶ Struts

▶ Jboss

● ASP/C#/VB

▶ .NET

● PHP

▶ Cake PHP

▶ CodeIgniter

▶ Symfony

▶ Zend Framework

● Perl

▶ Catalyst

▶ Mojolicious

● Ruby

▶ Ruby on Rails

▶ Padrino

▶ Sinatra

● Python

▶ Django

▶ Pylons

Page 9: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Framework

Page 10: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Framework

● Framework PHP per lo sviluppo di applicazioni web

▶ > 10 milioni di download

▶ > 500 sviluppatori

▶ > 10 milioni hits su Google

● Open source, licenza new BSD

● Sito del progetto: http://framework.zend.com

● © Zend Technologies Ltd.

Page 11: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Technologies

● Zend Technologies Ltd, the PHP Company

● Fondata nel 1999 da Andi Gutmans e Zeev Suraski, gli sviluppatori del PHP 3.0

● Quartier generale nella Silicon Valley a Cupertino (USA)

● Uffici in: Francia, Germania, India, Irlanda, Israele, Italia

● © PHP Engine 2 (l'interprete del PHP)

● Sito: http://www.zend.com

Page 12: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Business con ZF

Page 13: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Alcuni progetti basati su ZF

Page 14: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Breve storia di ZF● Ottobre 2005: Annuncio del progetto

● Marzo 2006: Prima versione (pulic review), 0.1.0

● Luglio 2007: Prima versione stabile 1.0

● Marzo 2008: Prima minor release 1.5.0

▶ Zend_Form, Zend_Layout

● Aprile 2009: 1.8.0

▶ Zend_Tool, Zend_Application

● Agosto 2009: 1.9.0

▶ Supporto PHP 5.3

● Novembre 2010: 1.11.0

▶ Supporto dispositivi mobile tramite Zend_Http_UserAgent

▶ Simple Cloud API tramite Zend_Cloud

Page 15: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Caratteristiche di ZF● Architettura aperta

▶ Facile integrazione in progetti di terze parti

▶ Design del tipo “Use at will”

● Completamente ad oggetti in PHP 5

● Codice testato, Unit test (PHPUnit)

● Utilizzo di design pattern

▶ MVC, Factory, Singleton, etc

● Qualche numero:

▶ ≈ 4000 classi, ≈ 9000 files, ≈ 91 Mb

▶ ≈ 460'000 linee di codice

Page 16: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Model View Controller in ZF

Page 17: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Componenti del progetto ZF 1

Page 18: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Ciclo di sviluppo in ZF

● Proposta di un nuovo componente dalla community

● Ready for review (community)

● Ready for recommendation

● Pending recommendation (revisione da parte del CoreTeam)

● Ok per il Laboratory

● Testing e review

● Ok per il rilascio in release (standard/extras)

Page 19: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Framework 2.0

Page 20: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Zend Framework 2.0● Nuova major release

▶ Ci ha permesso di non dover tener conto della retro-compatibilità

▶ Prerequisiti: PHP 5.3 e superiore

● Attenzione posta su:▶ Consistenza▶ Performance▶ Documentazione▶ Produttività utente

Page 21: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Primi passi verso ZF 2.0

● Conversione del codice da prefissi gestiti a mano (es. “Zend_Foo”) ai namespace nativi di PHP 5.3

● Refactoring delle Eccezioni

● Cambio di ZF per essere solo autoload

● Miglioramento e standardizzazione del sistema di plugin

Page 22: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

ZF 2.0 (dev3)

● Il 14 giugno 2011 è stata rilasciata la versione dev3 di Zend Framework 2.0

● Tra le funzionalità già implementate:

▶ Refactoring di Zend\Tool e CodeGenerator

▶ Migrazione e refactoring dei servizi LiveDocx ▶ EventManager ▶ Dependency Injection

● Maggiori info: http://bit.ly/lptIpN

Page 23: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

ZF2 in una slide

● Miglioramenti:

▶ Namespace (supporto nativo di PHP)▶ Exception▶ Autoloading▶ MVC▶ Plugin▶ Documentazione▶ Performance

● Nuove funzionalità:

▶ Event Manager▶ Dependency Injection / Service Locator▶ Supporto di nuovi servizi cloud▶ Molto altro ancora...

Page 24: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Rilascio di ZF2

● Versione beta

▶ metà ottobre 2011● Release stabile a fine anno

Page 25: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Come contribuire al progetto

● Sito ufficiale

▶ http://framework.zend.com● ZF2 wiki:

▶ http://bit.ly/zf2wiki● zf-contributors mailing list:

[email protected]● IRC:

▶ #zftalk.dev su Freenode

Page 26: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Risorse● Official repo ZF1:

▶ http://framework.zend.com/svn/framework/

● Git guide ZF2:

▶ http://bit.ly/zf2gitguide● GitHub ZF2:

▶ http://github.com/zendframework/zf2● Official repo ZF2:

▶ git://git.zendframework.com/zf.git▶ http://git.zendframework.com/

Page 27: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Domande?

Page 28: Framework software e Zend Framework

© All rights reserved. Zend Technologies, Inc.

Grazie!

Maggiori informazioni:http://www.zend.comhttp://framework.zend.com/