55
Copyright © 2007, Zend Technologies Inc. ‘Zend Framework QuickStart’ Ed Kietlinski Solutions Consultant [email protected] GETTING STARTED WITH ZEND FRAMEWORK for i5 Internet – Working Your I5 CANCELED

Zend Framework Getting Started For I5

  • Upload
    zendcon

  • View
    6.963

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

‘Zend Framework QuickStart’

Ed Kietlinski

Solutions Consultant

[email protected]

GETTING STARTED WITH ZEND FRAMEWORK for i5

Internet – Working Your I5 CANCELED

Page 2: Zend Framework Getting Started For I5

Zend Framework 1.5 Latest Features | 2

ZEND FRAMEWORK AGENDA

• I’m Not Larry Bolhuis and Yes PHP is very secure

• Some History - Why Zend Framework?

• Intro to MVC (Model-View-Controller) design pattern

• Let’s look at what it can do for you

• Web Services code!

• Major features & benefits for the new ZF 1.6 release

• Questions?

Page 3: Zend Framework Getting Started For I5

Zend Framework—In a nutshell

The leading open-source PHP framework has a flexible architecture that lets you easily build modern web applications

and web services

Zend Framework 1.5 Latest Features

Page 4: Zend Framework Getting Started For I5

| 4

ZEND FRAMEWORK ADVANTAGES

• Best Practices—As an exemplar ZF is best practice.

• Productive—reuse code quickly and often.

• Simple & Easy—just like PHP, ZF is easy to adopt.

• Extensible & Flexible—customize & add your value.

• High Quality—rigorously tested + built-in tests to use.

• Friendly License—new BSD = reuse code however you like; Apache-like CLA = safety for corporations.

• Modern—web services, syndication, AJAX, search, +

Zend Framework 1.5 Latest Features

Page 5: Zend Framework Getting Started For I5

Zend Framework 1.5 Latest Features | 5

PHP Ecosystem

Page 6: Zend Framework Getting Started For I5

| 6

ZEND FRAMEWORK FACTS

• 7 Million Downloads• 500+ registered contributors inc Large enterprises • 140,000 lines of PHP code• 87,000 words of documentation

translated into 5 major languages Over 520 code examples

• 60+ ZF based OpenSource based on SourceForge

Zend Framework 1.5 Latest Features

Page 7: Zend Framework Getting Started For I5

| 7

10 Things Every Developer Should Know about Zend Framework

1. Use-at-will architecture2. Enterprise level development framework3. Object Oriented, and not ashamed of it4. Web Services are first-class citizens5. It’s backed by Zend as well as Community6. Ajax is not an afterthought7. Only pure PHP implementation of Lucene8. A huge community that is just an email away9. Identity 2.010. Documentation up the wazoo ☺☺☺☺

And just in case you forget one of those. . .

• Hosting will not be a problem

Zend Framework 1.5 Latest Features

Page 8: Zend Framework Getting Started For I5

Zend Framework 1.5 Latest Features | 8

I5/OS Power Platform Specifics

• Zend Framework works the same

• Brings the world of MVC to the RPG community

• Can use with i5 Toolkit and 5250 API, etc.

• PDO for DB2 in beta (See 1.6 RC2) in 1.7

� can use PHP/i5 TOOLKIT instead to DB2

� PDO DB2 adapter preview version available.

• Use PACE Apache port 8000, .htacess critical to ZF

Page 9: Zend Framework Getting Started For I5

Zend Framework Contributor Process

Page 10: Zend Framework Getting Started For I5

| 10

ZEND FRAMEWORK – COMPONENTS

Zend Framework 1.5 Latest Features

Page 11: Zend Framework Getting Started For I5

ZF + i5 TOOLKIT + 5250 Bridge API

• SBS

+i5 Toolkit

5250 API

Page 12: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

Zend Framework Examples

Page 13: Zend Framework Getting Started For I5

Open Source http://magentocommerce.com

Page 14: Zend Framework Getting Started For I5

Others:

| 14

SELECTED ZEND FRAMEWORK USERS

Zend Framework 1.5 Latest Features

Page 15: Zend Framework Getting Started For I5

i5 Specific Example – Beverage Distributor

• #1 Wine and Spirits wholesaler in NJ

• Application – Web based customer care system.

• Problem – Originally a .NET app that was middleware between backend DB2 and frontEndWeb app.

� Issues with Syncing between FE and BE, data mismatches

� Finger pointing when problems, different owners at each layer

� Hard to extend and no onsite expertise

Page 16: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

MODEL-VIEW-CONTROLLER

DESIGN PATTERN

Page 17: Zend Framework Getting Started For I5

What is the MVC component?

• The heart of ZF web applications

� Best practice for application workflow

� Design pattern that dates back to

Smalltalk, circa 1979

• Model: data providerView: user interfaceController: request processor

• Simple solution in most applications

� Sensible defaults are built in

� Flexible and extensible

� Supports advanced applications

MODELVIEW

CONTROLLER

Page 18: Zend Framework Getting Started For I5

|16 apr 2008 | 18

M

Access/Business

Logic

C

Presentation

logic

RPG Model View Controller (MVC)

VIEW

V

RPG/Application

(Subroutine)

5250 Screen

(DDS)

RPG/Applicationflow

(Mainline)

Page 19: Zend Framework Getting Started For I5

|16 apr 2008 | 19

M

Access/Business

Logic

C

Presentation

logic

VIEW

V

Option 3: Zend 5250 Bridge

RPG/Application

Subroutine

RPG/Applicationflow

• Reuse Legacy application with new PHP GUI

5250 API request

XML

.

Populates Screen values with inputtedinformation using:<?phpset_include_path('/usr/local/Zend/5250/API/');require_once('Zend/5250.php');$bridge = new Zend_5250();$response = $bridge->connect();$bridge->setInputField('0','user');$bridge->setInputField('1','password');// press ENTER $response = $bridge->submit();$bridge->disconnect();?>

Page 20: Zend Framework Getting Started For I5

|16 apr 2008 | 20

M

Access/Business

Logic

C

Presentation

logic

VIEW

VBrowser web

Option 2: Restructure

• Develop new web services infrastructure

• Develop new GUI

RPG/Application

Subroutine

• Separate business logic from presentation

WEB 2.0 ?PHP + Toolkit

Page 21: Zend Framework Getting Started For I5

|16 apr 2008 | 21

M

Access/Business

Logic

C

Presentation

logic

VIEW

VBrowser web

NEW LIFE:PHP FUNCTION

Option 1: Rewrite

• Develop new presentation logic • Develop new GUI

• Develop new business logic

WEB 2.0 ?

PHP

Page 22: Zend Framework Getting Started For I5

|16 apr 2008 | 22

Options with Zend/PHP

• REWRITE

• Develop new GUI• Develop new presentation logic• Develop new business logic

• RESTRUCTURE• Separate business logic from presentation

logic• Develop new web services infrastructure

• REFACE w 5250 BRIDGE• Reuse legacy applications with new PHP

GUI from 5250 screen

.

Page 23: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

ZF= Developer Best Practices

Page 24: Zend Framework Getting Started For I5

4 ways ZF encourages best practices

1. Object-oriented programming

2. Testing3. Documentation

4. Extremely simple

• Most classes are reusable and extensible, allowing you to write less code

• User-defined extensions, plugins, and adapters implement interfaces and should be well-designed classes (i.e.Widgets)

• Uses many other design patterns

Page 25: Zend Framework Getting Started For I5

4 ways ZF encourages best practices

1. Object-oriented programming

2. Testing3. Documentation

4. Extremely simple

• MVC Request and Response can be simulated

• Built-in testability for Controllers

• Extensive collection of PHPUnit test suites serves as useful example

Page 26: Zend Framework Getting Started For I5

4 ways ZF encourages best practices

1. Object-oriented programming

2. Testing3. Documentation

4. Extremely simple

• Framework development process requires complete manual coverage for every component

• Framework coding standards include complete API docblocks to support reference documentation and development tools

• Examples and use cases a requirement for each component

Page 27: Zend Framework Getting Started For I5

4 ways ZF encourages best practices

1. Object-oriented programming

2. Testing3. Documentation

4. Extremely simple

• Simple interfaces are better for:

� Usability

� Extensibility

� Testability

� Maintainability

• Avoid “AntiPatterns”� Functional decomposition

� Spaghetti code

� http://www.antipatterns.com/

Page 28: Zend Framework Getting Started For I5

3 tools ZF offers to improve application security

1. Zend_Filter_Input2. Zend_Auth3. Zend_View

• Processes values of form fields

• Declares rules for filtering and validating input data

• Serves as a “cage” for data; only valid data come out

• Provides method for escaping values, to make them safer for HTML output

Page 29: Zend Framework Getting Started For I5

3 tools ZF offers to improve application security

1. Zend_Filter_Input2. Zend_Auth3. Zend_View

• Abstract interface to login credential storage

• Provides adapters for several directory solutions

� LDAP

� File

� Database table

� others

• Write your own custom directory adapters

*SBS

Page 30: Zend Framework Getting Started For I5

3 tools ZF offers to improve application security

1. Zend_Filter_Input2. Zend_Auth3. Zend_View

• Provides a method to format PHP objects more safely for HTML:

<?= $this->escape($this->var); ?>

*SBS

Page 31: Zend Framework Getting Started For I5

5 ways ZF helps to avoid reinventing the wheel

1. Zend_Acl2. Zend_Feed3. Zend_Log4. Zend_Cache5. Zend_Config

• Manages application roles, resources and privileges

• Roles and Resources may be user-defined classes

• Supports rule inheritance

• Supports conditional application of rules

Page 32: Zend Framework Getting Started For I5

5 ways ZF helps to avoid reinventing the wheel

1. Zend_Acl2. Zend_Feed3. Zend_Log4. Zend_Cache5. Zend_Config

• Consume RSS feed in a single line of PHP code

• Discover feed links automatically

• Imports feeds from multiple sources

• Provides feed building and posting operations

Page 33: Zend Framework Getting Started For I5

5 ways ZF helps to avoid reinventing the wheel

1. Zend_Acl2. Zend_Feed3. Zend_Log4. Zend_Cache5. Zend_Config

• Support advanced yet easy logging operations in your application

• Inspired by log4j

• Supports user-defined log formatting and writing

Page 34: Zend Framework Getting Started For I5

5 ways ZF helps to avoid reinventing the wheel

1. Zend_Acl2. Zend_Feed3. Zend_Log4. Zend_Cache5. Zend_Config

• Provides an interface to access persisted data

• Supports tagging, manipulating, iterating, and removing subsets

• Supports multiple cache storage backends(file, database, memcached, etc.)

*SBS

Page 35: Zend Framework Getting Started For I5

5 ways ZF helps to avoid reinventing the wheel

1. Zend_Acl2. Zend_Feed3. Zend_Log4. Zend_Cache5. Zend_Config

• Simplifies usage of configuration data for applications

• Provides a property-driven OO interface for accessing data hierarchy

• Supports multiple storage formats (.INI files, XML)

• Supports inheritance of configuration sections

• Optional; Zend Framework is configuration-less

Page 36: Zend Framework Getting Started For I5

A SOAP SERVER

• Zend_Soap_Server class is intended to simplify Web Services server part development.

• It’s OO wrapper around SOAP PHP extension SoapServer class which gives a flexible way to operate SOAP Server object.

• Two operational modes: WSDL and non-WSDL.

Page 37: Zend Framework Getting Started For I5

SOAP – Server example

Page 38: Zend Framework Getting Started For I5

SOAP - Client

• Zend_Soap_Client class is intended to simplify Web Services client part development.

• Two operational modes: WSDL and non-WSDL.

• Base for specific clients development (e.g. Zend_Soap_Client_DotNet is under development now).

Page 39: Zend Framework Getting Started For I5

SOAP Client - Example

Page 40: Zend Framework Getting Started For I5

Zend Framework Technology Partnerships | 40

CURRENT APIs & WEB SERVICES

“We have created a StrikeIron API in Zend Framework

because of its Web services consumption capabilities

and the momentum it is experiencing as a platform for

developing Web applications. This makes it extremely

easy for PHP developers to access multiple StrikeIron

services in a consistent way, greatly extending the

capabilities of Web apps that utilize Zend Framework.”

— Bob Brauer, CEO

StrikeIron

Web Services we

include as a part of

Zend Framework:

simpy del.icio.us

Our TechnologyPartners:

MVC

Int.Data

Web Services

BASE

Page 41: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

THE DEVELOPER’S FRAMEWORK

THINGS YOU SHOULD KNOW

Page 42: Zend Framework Getting Started For I5

New Features in 1.6

• Dojo 1.1.1 Framework integration in ZF

� JSON-RPC Server (a rewrite)

� Dojo.data Envelopes

� Dijit integration with Zend_Form & Zend_View

� Can custom build once project done to save bandwidth/space

• Better SOAP services (ie WSDL generator)

• Unit Test for Controllers (Zend_Test_PHPUnit_ControllerTestCase)

• Tooling Project (the CLI Tools)

• Paginator Component

• Zend_Session has new DB option

• Media View Helpers (Flash, QuickTime, Object, and Page)

Page 43: Zend Framework Getting Started For I5

Dojo Demo Example and Code online

Page 44: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

THE DEVELOPER’S FRAMEWORK

Tips on how to get Started

Page 45: Zend Framework Getting Started For I5

Zend Studio ZF Project will save lots of setup time

Page 46: Zend Framework Getting Started For I5

http://Framework.Zend.com

Page 47: Zend Framework Getting Started For I5

ZF+ZP for Development and Ops

Page 48: Zend Framework Getting Started For I5

Zend Framework Demos

• Demos� Feeds

� Gdata

• Blogger.php

• Calendar.php

• Gapps.php

• Gbase.php

• Spreadsheet� Mail

� Pdf

� Lucene Search

� WebServices

• Amazon

• Flickr

• UPC lookup

• Yahoo

Page 49: Zend Framework Getting Started For I5

Zend Framework Reference Guide (in PDF too)

Page 50: Zend Framework Getting Started For I5

Zend Framework 1.5 Latest Features | 50

ZEND FRAMEWORK BOOKS

Non-English

language books in

Japanese,

German,

Portuguese:

Page 51: Zend Framework Getting Started For I5

Zend Developer Zone on Zend.com

Page 52: Zend Framework Getting Started For I5

Zend Framework Support

Page 53: Zend Framework Getting Started For I5

Zend Framework Webinars

Page 54: Zend Framework Getting Started For I5

Zend Smart Start Program = Training + Mentoring

• Help customers rapidly adopt PHP for their application needs

• Get an Proof of Concept, that addresses a customer’s real business problem, up and running in 30 calendar days

• Bridge the learning gap between RPG and PHP

• Provide a foundation for leveraging PHP applications to address business objectives

SBS

Page 55: Zend Framework Getting Started For I5

Copyright © 2007, Zend Technologies Inc.

Q & A