Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP Software Engineering. Programming Languages Language Features & Paradigms.

Similar presentations


Presentation on theme: "PHP Software Engineering. Programming Languages Language Features & Paradigms."— Presentation transcript:

1 PHP Software Engineering

2 Programming Languages Language Features & Paradigms

3 Paradigms Imperative vs. Declarative Object Oriented Class / Inheritance Prototype based Procedural Programming Languages

4 Typing Static vs. Dynamic Strong vs. Weak Duck Typing Programming Languages

5 Typing Static vs. Dynamic Strong vs. Weak Duck Typing Programming Languages

6 Compiled vs. Scripting Compiled (machine code) c, c++ Compiled (byte-code) Java, C# (.net) Scripting PHP, Ruby, Python, ECMAScript (Java / Action) Programming Languages hhttp://en.wikipedia.org/wiki/Just-in-time_compilationation

7 PHP Scripting Language Virtual Machine: Zend Engine Written in C Multi-paradigm Imperative (procedural) Object-oriented (inheritance) Weak dynamic typing Programming Languages

8 Design Patterns Building Blocks for Software

9 Overview Applications Model 1 Model 2 Programming Patterns Architectural Patterns Design Patterns

10 Model 1 vs. Model 2 Coined in the Java world Model 1 apps are procedural applications Typically built as a series of scripts, original JSP pages Model 2 apps are tiered applications and/or applications that have separation of concerns Design Patterns

11 Programming Patterns Most notable source: Gang of Four Object oriented design patterns Design Patterns

12 Example: Factory Design Patterns / Software Patterns

13 Example: Lazy Loading Design Patterns / Software Patterns

14 Example: Singleton Design Patterns / Software Patterns

15 Example: Composite Design Patterns / Software Patterns

16 Example: Adapter Design Patterns / Software Patterns n

17 Example: Observer Design Patterns / Software Patterns n

18 Programming Patterns Most notable source: Martin Fowler PoEAA: Patterns of Enterprise Application Architecture Design Patterns

19 Non-PoEAA Presentation-abstraction-control Service-oriented architecture (distributed) Mulit/Three-Tier Peer-to-Peer (distributed) Design Patterns / Architectural Patterns

20 PoEAA Logical: Domain Model & Table Module Data: Table Row & Row Data Gateway, ActiveRecord, Data Mapper Other: Repository, Registry, Plugin Model-View-Controller, Front Controller, Two-step View Design Patterns / Architectural Patterns

21 Example: Domain Model del.htmlMo del.html Design Patterns / Architectural Patterns

22 Example: Table Module le.html Design Patterns / Architectural Patterns

23 Example: Table Gateway Design Patterns / Architectural Patterns tml

24 Example: Row Gateway Design Patterns / Architectural Patterns ml

25 Example: Active Record Design Patterns / Architectural Patterns

26 Example: Active Record Design Patterns / Architectural Patterns

27 Example: MVC Design Patterns / Architectural Patterns

28 Example: Registry Design Patterns / Architectural Patterns

29 Software Development Process Best Practices for Building Software

30 Development Process htthttp://en.wikipedia.org/wiki/Revision_control Overview Unit Testing Source Control Coding Standards Continuous Integration Documentation

31 Development Process Unit Testing Why write unit tests? prevent regressions ensure software meets requirements tests help document what the software does XUnit pattern unit testing framework with equivalents in PHP, Java, Ruby, C#, and more XUnit is one of the most popular ways to test code

32 Development Process Source Control Why use source control? Keep track of changes you made Light-weight backup Great for collaboration, even if there is only one of you now Common SCM (Source Code Management) tools Subversion (SVN) widely used, well-supported by tools client-server model, integrates well with Apache Git distributed model, trendy somewhat high learning curve, especially if youre used to SVN or CVS

33 Development Process Coding Standards Why have coding standards?readability for yourself and colleaguesprevents mistakes, syntax errorsPear Coding Standardsdon't write your own standards, its not worth your timePear standards are commonly accepted, and align with other languages as well

34 Development Process Build & Deploy Create a testable and repeatable deployment process Run some functional testsdocument your application Code comments API Docs automate - take the human out of it continuous integration find the right level of process

35 PHP Ecosystem Software & Tools

36 PHP Ecosystem Application Frameworks Application Framework Zend Framework toolkit / glue style: use what you want or use it all CakePHP & CodeIgnitor lightweight MVC frameworks with data models SymfonyMVC, more admin and configuration features

37 PHP Ecosystem Unit Testing Frameworks PHPUnit Most popular, derived from NUnit patternSimpletest phpt

38 PHP Ecosystem IDEs & Editors Editors pattern matched syntax highlighting & code foldingtypically multi- languageespecially good at text & code manipulationIDEsLanguage introspection (code completion)Errors / Warnings / Syntax CheckDebugging capabilities (breakpoints, watches, profiling)

39 PHP Ecosystem IDEs & Editors Eclipse-based IDEsZend Studio (paid) / PDT (open source) great PHP editing and debugging Aptana javascript & css editing & code completion is excellentdebugging with xdebugText Editors Ultraedit on WindowsTextmate on Mac E is Textmate on Windows


Download ppt "PHP Software Engineering. Programming Languages Language Features & Paradigms."

Similar presentations


Ads by Google