dpc2007 zend framework (gaylord aulke)

34
Zend Framework PHP Powers the Web Gaylord Aulke Director Prof. Services, DACH Zend Technologies, Germany

Upload: dpc

Post on 01-Jul-2015

1.812 views

Category:

Business


3 download

DESCRIPTION

Dutch PHP Conference 2007

TRANSCRIPT

Page 1: DPC2007 Zend Framework (Gaylord Aulke)

Zend Framework

PHP Powers the Web

Gaylord Aulke

Director Prof. Services, DACH

Zend Technologies, Germany

Page 2: DPC2007 Zend Framework (Gaylord Aulke)

Frameworks in other Areas

Playmobil LEGO Fischer-Technik

Page 3: DPC2007 Zend Framework (Gaylord Aulke)

PHP Frameworks

Quelle: http://www.coldscripts.com/PHP/Scripts/Development/Frameworks/

Page 4: DPC2007 Zend Framework (Gaylord Aulke)

Why Yet Another Framework?

• Keep PHP competitive among other technologies

including .NET , Spring, Ruby-on-Rails, etc.

• No framework today supports Extreme Simplicity

• Provide “clean” IP to enable commercial use

• Structured development process will lead to uniform and

high-quality code base

• Take full advantage of PHP 5

Page 5: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 5

PHP Collaboration Project

SOA,Web Services,

etc.

SOA,Web Services,

etc.

Open

Source

Open

Source

CommunityCommunity

PHP

Language

PHP

Language

Open

IDE

Open

IDE

Best

Practices

Best

Practices

PHP

Framework

PHP

Framework

Page 6: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 6

Zend Framework

Zend Framework provides a high-quality open-source framework for developing Web Applications and Web Services.

By following the PHP spirit, the Zend Framework delivers easy-to-use and powerful functionality, focusing on the challenges of building robust, secure and modern Web applications.

Page 7: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 7

Framework Principles

• Keep it “extremely simple” – stick to 20%/80% rule and compensate by:� Extensibility

� Use-at-will architecture

� Configuration-less

• Cherry pick best-of-breed ideas

• Showcase current trends in Web development (Web Services, Ajax, Search, Syndication, …)

• Document development with use-cases

• Only high quality and necessary components

• Friendly license (BSD license)� Contributors agree to contributor’s license agreement

Page 8: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 8

• High-quality PHP 5 open-source framework

• Easy-to-use, powerful functionality, focusing on the best practices of robust, secure and modern Web applications.

• Follows principle of “extreme simplicity,” which makes it easy to learn and easy to use for programmers

• Developed by members of the PHP community, led by a team at Zend

• Open-source process, hosted at framework.zend.com under the business-friendly BSD license

• Corporate contributions:

Page 9: DPC2007 Zend Framework (Gaylord Aulke)

More facts…

• PHP 5 class library

• Free, open source, BSD license (like PHP)

• 140,000 lines of code

• Emphasis on quality: 60%+ unit test coverage

• Solutions are “extremely simple” – solving the 80% usage case, and allowing for extensibility

• Bundled with Zend Core & Zend Studio

• http://framework.zend.com/

Page 10: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 10

Large contributing community (approx. 160)

Page 11: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 11

Zend Framework on Google’s Web site

Page 12: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 12

IBM runs on Zend Framework

• QEDWiki built on Zend Framework

• IBM contributing to Zend Framework (Ajax,

Search, DB2, etc…)

• Shipping with Zend Core for IBM and Zend Core

for i5/OS

Page 13: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 13

Zend Framework 1.0

• Release Candidate in May, release planned for June

• Lining up customers/partners for press incl. IBM, Google, Varien

• Components designed by small teams

• Proposals written and reviewed before coding

• All code starts from scratch

• Real Life Tests

Page 14: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 14

Zend Framework Components

Page 15: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 15

Coding Standards

B.2. PHP File Formatting

B.2.1. General

B.2.2. Indentation

B.2.3. Maximum Line

Length

B.2.4. Line Termination

B.3. Naming Conventions

B.3.1. Classes

B.3.2. Interfaces

B.3.3. Filenames

B.3.4. Functions and

Methods

B.3.5. Variables

B.3.6. Constants

B.4. Coding Style

B.4.1. PHP Code Demarcation

B.4.2. Strings

B.4.3. Arrays

B.4.4. Classes

B.4.5. Functions and Methods

B.4.6. Control Statements

B.4.7. Inline Documentation

Page 16: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 16

Standard Directory Stucture

Page 17: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 17

URL Rewriting

• “Pretty URLs”

• First element: Controller-Name

• Second element: Action-Name

• Followed by Key/Value Pairs with Parameters

http://www.myserver.com/event/detail/id/10

Controller: EventController

Action: detailAction

Parameter: id=10

Page 18: DPC2007 Zend Framework (Gaylord Aulke)

Model / View / Controller

Index.php

*.phtml

Page 19: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 19

Bootstrap File: index.php

• Handles all (dynamic) requests

• Sets up environment and calls controller

Page 20: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 20

ActionController: IndexController.php

Page 21: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 21

Model: HRModel.php

Page 22: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 22

View Script: Index.phtml

Page 23: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 23

MVC Advantages

• User Interaction Handling isolated in the Controller Actions

• Layout isolated in the View Scripts

• Business Logic Encapsulated by the Model

• This gives clear separation of responsibilities of the different classes

• Extensions might structure the business logic

better

• Template engine can be integrated into view

• Example: ZGS Classes

Page 24: DPC2007 Zend Framework (Gaylord Aulke)

DB-Adapter: Query

Page 25: DPC2007 Zend Framework (Gaylord Aulke)

DB-Table

Page 26: DPC2007 Zend Framework (Gaylord Aulke)

DB-Table: insert

Page 27: DPC2007 Zend Framework (Gaylord Aulke)

DB-Table: update

Page 28: DPC2007 Zend Framework (Gaylord Aulke)

Code: Feed

• SOA & Web Services:

� Zend Framework has a large focus on Web Services

•Zend_Feed, Zend_Service_*

Page 29: DPC2007 Zend Framework (Gaylord Aulke)

Webservice Clients

Page 30: DPC2007 Zend Framework (Gaylord Aulke)

19-Jun-07 | Page 30

Future Plans

• Provide additional features for PDF generation and support of the latest PDF standard

• Enhance AJAX & forms support toward graduation from the incubator

• Provide plug-ins for Controller architecture.

• Build a higher-level abstraction on top of

Zend_Search_Lucene (i.e., Zend_Search) that will

allow for a pluggable interface to other search solutions

• Enhance the MIME module to also support decomposing existing MIME messages

Page 31: DPC2007 Zend Framework (Gaylord Aulke)

Currently ongoing Ajax-related work

• Zend_Json

� Part of Zend Framework

� Works both with fast ext/json and pure PHP-based implementation (automatically chooses best)

� Can decode to PHP array or object

� Can work with primitive types

• Zend_Xml2Json

� Enables XML-to-JSON conversion at the middleware server layer

� Delivers simplicity to the front-end developer

� To be contributed by IBM Research based on paper on DeveloperWorks:

• http://www-128.ibm.com/developerworks/xml/library/x-xml2jsonphp/

Page 32: DPC2007 Zend Framework (Gaylord Aulke)

Zend Component Model

What?

Tooling for building AJAX applications

How?

Building blocks model – a-la VB/ASP/JSF

Why?

RAD in PHP spirit – simplicity + power

Page 33: DPC2007 Zend Framework (Gaylord Aulke)

What are components?

• PHP+JS+CSS+Images client/server side bundle

• Self-describing components – can be used with

any tool

• Visual RAD

� design time view – no data required

� production view - reflects actual data

• Vi-compatibility – no additional configurations or

declarative syntax files, only PHP and CSS/JS on client side

• Extensibility – new components, extending existing components

Page 34: DPC2007 Zend Framework (Gaylord Aulke)

Z End