KEMBAR78
CakePHP and Open Source - Newcastle University | KEY
Graham Weldon
OPEN
 SOURCE
SOFTWARE



Graham Weldon
2




    Graham Weldon
2   ABOUT ME
               Graham Weldon
               http://grahamweldon.com
               @predominant
               http://github.com/predominant




                                       Graham Weldon
2   ABOUT ME
               Graham Weldon
               http://grahamweldon.com
               @predominant
               http://github.com/predominant

               PHP Developer for 12 years




                                        Graham Weldon
2   ABOUT ME
               Graham Weldon
               http://grahamweldon.com
               @predominant
               http://github.com/predominant

               PHP Developer for 12 years

               Developer Evangelist




                                        Graham Weldon
2   ABOUT ME
               Graham Weldon
               http://grahamweldon.com
               @predominant
               http://github.com/predominant

               PHP Developer for 12 years

               Developer Evangelist

               Open Source contributor




                                         Graham Weldon
2   ABOUT ME
               Graham Weldon
               http://grahamweldon.com
               @predominant
               http://github.com/predominant

               PHP Developer for 12 years

               Developer Evangelist

               Open Source contributor

                 CakePHP
                 CandyCane
                 Sydney PHP User Group
                 HTML5 BoilerPlate
                 ThreeJS
                 LibGit




                                         Graham Weldon
3




    Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies

            3. Worked for local companies




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies

            3. Worked for local companies

            4. During time at Fluid Lino, started
               looking at PHP Frameworks




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies

            3. Worked for local companies

            4. During time at Fluid Lino, started
               looking at PHP Frameworks

            5. Was noticed for contributions




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies

            3. Worked for local companies

            4. During time at Fluid Lino, started
               looking at PHP Frameworks

            5. Was noticed for contributions

            6. Offered position at CakeDC




                                         Graham Weldon
3   BACKGROUND
            1. Studied B. Engineering (Software) at
               Newcastle University

            2. Started working during my degree
               studies

            3. Worked for local companies

            4. During time at Fluid Lino, started
               looking at PHP Frameworks

            5. Was noticed for contributions

            6. Offered position at CakeDC

            7. Offered position in Japan!




                                            Graham Weldon
MVC STRUCTURE
SUMMARY
          CAKEPHP

          DEMO!

          OPEN SOURCE

          Q AND A
Graham Weldon
MVC
 CakePHP



Graham Weldon
Graham Weldon
MVC
Structure




            Graham Weldon
7




    Graham Weldon
7   IMPLEMENTATIONS




                      Graham Weldon
8




    Graham Weldon
8   SOME FRAMEWORKS

           Cake
           PHP             Symfony             Lithium




    Established 2003   Established 2007   Established 2009

    Fat Models         Module oriented    MicroFramework
    Thin Controllers   Package based      Fast routing/
    Logic-less PHP     Twig based Views   dispatch
    Views                   (Less-logic   PHP Views
                       Views)
    (ideally)                             Version 0
                       Version 2
    Version 2




                                                      Graham Weldon
9




    Graham Weldon
9   CASE STUDY
    1. CakePHP is one of the
       largest, most popular
       PHP frameworks
       worldwide




                               Graham Weldon
9   CASE STUDY
    1. CakePHP is one of the
       largest, most popular
       PHP frameworks
       worldwide

    2. Its been established for
       many years with a solid
       growth




                                  Graham Weldon
9   CASE STUDY
    1. CakePHP is one of the
       largest, most popular
       PHP frameworks
       worldwide

    2. Its been established for
       many years with a solid
       growth

    3. In many ways, its ahead
       of its time




                                  Graham Weldon
9   CASE STUDY
    1. CakePHP is one of the
       largest, most popular
       PHP frameworks
       worldwide

    2. Its been established for
       many years with a solid
       growth

    3. In many ways, its ahead
       of its time

    4. I’m a core developer




                                  Graham Weldon
10




     Graham Weldon
10   MVC STRUCTURE



     MODEL                       VIEW
     Data                    Output




              CONTROLLER
               Control




                           Graham Weldon
11




     Graham Weldon
11   3 STEPS TO SUCCESS


     STEP 1                                                               STEP 3
     Define Database                                          Customise Code


                                       STEP 2
                                  Generate Code




        MODELS                 VIEWS            BUSINESS
                                                 LOGIC     SECURITY      OTHERS

                 CONTROLLERS




                                                                      Graham Weldon
Graham Weldon
Let’s Build
Something!




              Graham Weldon
13




     Graham Weldon
13   3 STEPS TO SUCCESS


     STEP 1                                                               STEP 3
     Define Database                                          Customise Code


                                       STEP 2
                                  Generate Code




        MODELS                 VIEWS            BUSINESS
                                                 LOGIC     SECURITY      OTHERS

                 CONTROLLERS




                                                                      Graham Weldon
14




     Graham Weldon
14   DATABASE DESIGN




     USERS                   TAGS




                POSTS




                        Graham Weldon
15




     Graham Weldon
15   DATABASE DESIGN

                  JOIN
                 TABLE



                              TAGS




     USERS




                POSTS




                         Graham Weldon
16




     Graham Weldon
16   DATABASE




                Graham Weldon
17




     Graham Weldon
17   CODE GENERATION




                       Graham Weldon
18




     Graham Weldon
18   WHAT HAVE WE GOT?

         MODELS


         CONTROLLERS


         VIEWS


                         Graham Weldon
Graham Weldon
at thelook
 Lets code




             Graham Weldon
Graham Weldon
But... What
Does it do?




              Graham Weldon
Graham Weldon
What did I
just learn?




              Graham Weldon
22




     Graham Weldon
22   CAKEPHP’S MVC

         FAT MODELS


         THIN CONTROLLERS


         PLAIN PHP VIEWS


                            Graham Weldon
23




     Graham Weldon
23   WHAT ELSE?

          80% GENERATED


          20% EFFORT


          100% AWESOME


                          Graham Weldon
Graham Weldon
OPEN
  Source



Graham Weldon
25




     Graham Weldon
25   HISTORY

         1950-
         1970                 1970-
                              1982                    1983



     Sharing software    Developing             Richard Stallman
     for free was        software               founds the Free
     necessary to        becomes more           Software
     ensure that         and more               Foundation to
     hardware            expensive to           change the way
     purchased was put   achieve.               software is built,
     to good use.        Companies close        distributed and
     Without a free      their software and     shared.
     interchange of      retain tight control   To create software
     software and        over their digital     freedom for all.
     ideas, hardware     “investments”.
     would not have      This leads to less


                                                         Graham Weldon
26




     Graham Weldon
26   HISTORY

          1998                 2010                 2013



     “Open Source”       Open source          Anything is
     term is coined at   hardware             possible
     a FSF strategy      becomes
     meeting to avoid    mainstream,
     confusion with      bringing technical
     Netscape’s          advancements to
     impending           users and a
     navigator source    sharing of ideas.
     release.




                                                       Graham Weldon
27




     Graham Weldon
27   PERCEPTION




        How “Enterprise” businesses view developers




                                                  Graham Weldon
28




     Graham Weldon
28   PERCEPTION




        How “Enterprise” businesses view open source
                         developers




                                                   Graham Weldon
29




     Graham Weldon
29   PERCEPTION




                  Graham Weldon
30




     Graham Weldon
30   PERCEPTION




                  Graham Weldon
31




     Graham Weldon
31   COMPARISON

          Business            Freelance              Open
                                                    Source




     Working for a       Working for         Free at last? Yes!
     company where       yourself, right?    Freedom in
     you have a boss,    Wrong, you’re       various software
     maybe a project     working for your    licenses allows
     manager, or         clients, and they   you to use, modify
     otherwise, orders   dictate what        and release
     coming from         happens for the     software however
     management.         most part.          you like.




                                                       Graham Weldon
32




     Graham Weldon
32   CORPORATE LIFE




     BUSINESS                                DEVELOP
     ANALYSIS
     Assess needs                       Build out the
     and costings                           solution,
                                      minimum time,
                                          maximum
                                              output
                    PROJECT DEFINED
                    What we need
                    to build and
                      achieve




                                           Graham Weldon
33




     Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.




                                           Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.

               2. This makes complete sense.




                                           Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.

               2. This makes complete sense.

               3. If something doesn’t directly
                  improve the bottom line, its unlikely
                  to be approved




                                            Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.

               2. This makes complete sense.

               3. If something doesn’t directly
                  improve the bottom line, its unlikely
                  to be approved

               4. Development is controlled




                                            Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.

               2. This makes complete sense.

               3. If something doesn’t directly
                  improve the bottom line, its unlikely
                  to be approved

               4. Development is controlled

               5. Development comes from corporate
                  goals and needs




                                            Graham Weldon
33   CORPORATE LIFE
               1. Businesses are profit driven.

               2. This makes complete sense.

               3. If something doesn’t directly
                  improve the bottom line, its unlikely
                  to be approved

               4. Development is controlled

               5. Development comes from corporate
                  goals and needs

               6. Not much freedom (Usually)




                                            Graham Weldon
34




     Graham Weldon
34   OPEN SOURCE




                   Graham Weldon
35




     Graham Weldon
35   OPEN SOURCE

         COMMUNITY


         FLEXIBILITY


         NEW TECHNOLOGY


                          Graham Weldon
Graham Weldon
Innovation
is driven by
 frustration




               Graham Weldon
37




     Graham Weldon
37    FRUSTRATION IS KEY

     100
                               Truly great software is
                               developed at or after the
      75                       point where a need is not
                               fulfilled well enough, that
                               a develop goes out and
      50                       builds the correct solution
                               on their own.

      25                       This results in software
                               that has purpose,
                               meaning and a true useful
       0                       application in the world.
           1   2   3   4   5




                                               Graham Weldon
38




     Graham Weldon
38   WHY OPEN SOURCE?
     1. It get you exposure in
        the global developer
        community




                                 Graham Weldon
38   WHY OPEN SOURCE?
     1. It get you exposure in
        the global developer
        community

     2. Other people may
        need / want your
        solution. (Help others)




                                  Graham Weldon
38   WHY OPEN SOURCE?
     1. It get you exposure in
        the global developer
        community

     2. Other people may
        need / want your
        solution. (Help others)

     3. Others may find issues
        or improvements, and
        contribute those back




                                  Graham Weldon
38   WHY OPEN SOURCE?
     1. It get you exposure in
        the global developer
        community

     2. Other people may
        need / want your
        solution. (Help others)

     3. Others may find issues
        or improvements, and
        contribute those back

     4. It helps make you a
        better developer




                                  Graham Weldon
39




     Graham Weldon
39   MANAGEMENT
             1. All projects are different.




                                              Graham Weldon
39   MANAGEMENT
             1. All projects are different.

             2. Based on what works best for the
                community and users




                                              Graham Weldon
39   MANAGEMENT
             1. All projects are different.

             2. Based on what works best for the
                community and users

             3. Generally a “meritocracy”




                                              Graham Weldon
39   MANAGEMENT
             1. All projects are different.

             2. Based on what works best for the
                community and users

             3. Generally a “meritocracy”

             4. ... unless there is corporate backing




                                              Graham Weldon
40



     responsibilities are objectively
     assigned to individuals based upon
     their "merits", namely intelligence,
     credentials, and education, determined
     through evaluations or examinations.




                                        Graham Weldon
40   MERITOCRACY?


       responsibilities are objectively
       assigned to individuals based upon
       their "merits", namely intelligence,
       credentials, and education, determined
       through evaluations or examinations.




                                          Graham Weldon
41




     Graham Weldon
41   TOOLS / SERVICES


       Github    Source
                 Forge      Codeplex




       Travis
         CI     BitBucket      ...




                                Graham Weldon
Graham Weldon
THANK
  you

www.YourName.com
              Graham Weldon

CakePHP and Open Source - Newcastle University

  • 1.
  • 2.
  • 3.
    2 Graham Weldon
  • 4.
    2 ABOUT ME Graham Weldon http://grahamweldon.com @predominant http://github.com/predominant Graham Weldon
  • 5.
    2 ABOUT ME Graham Weldon http://grahamweldon.com @predominant http://github.com/predominant PHP Developer for 12 years Graham Weldon
  • 6.
    2 ABOUT ME Graham Weldon http://grahamweldon.com @predominant http://github.com/predominant PHP Developer for 12 years Developer Evangelist Graham Weldon
  • 7.
    2 ABOUT ME Graham Weldon http://grahamweldon.com @predominant http://github.com/predominant PHP Developer for 12 years Developer Evangelist Open Source contributor Graham Weldon
  • 8.
    2 ABOUT ME Graham Weldon http://grahamweldon.com @predominant http://github.com/predominant PHP Developer for 12 years Developer Evangelist Open Source contributor CakePHP CandyCane Sydney PHP User Group HTML5 BoilerPlate ThreeJS LibGit Graham Weldon
  • 9.
    3 Graham Weldon
  • 10.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University Graham Weldon
  • 11.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies Graham Weldon
  • 12.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies 3. Worked for local companies Graham Weldon
  • 13.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies 3. Worked for local companies 4. During time at Fluid Lino, started looking at PHP Frameworks Graham Weldon
  • 14.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies 3. Worked for local companies 4. During time at Fluid Lino, started looking at PHP Frameworks 5. Was noticed for contributions Graham Weldon
  • 15.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies 3. Worked for local companies 4. During time at Fluid Lino, started looking at PHP Frameworks 5. Was noticed for contributions 6. Offered position at CakeDC Graham Weldon
  • 16.
    3 BACKGROUND 1. Studied B. Engineering (Software) at Newcastle University 2. Started working during my degree studies 3. Worked for local companies 4. During time at Fluid Lino, started looking at PHP Frameworks 5. Was noticed for contributions 6. Offered position at CakeDC 7. Offered position in Japan! Graham Weldon
  • 18.
    MVC STRUCTURE SUMMARY CAKEPHP DEMO! OPEN SOURCE Q AND A
  • 19.
  • 20.
  • 21.
  • 22.
    MVC Structure Graham Weldon
  • 23.
    7 Graham Weldon
  • 24.
    7 IMPLEMENTATIONS Graham Weldon
  • 25.
    8 Graham Weldon
  • 26.
    8 SOME FRAMEWORKS Cake PHP Symfony Lithium Established 2003 Established 2007 Established 2009 Fat Models Module oriented MicroFramework Thin Controllers Package based Fast routing/ Logic-less PHP Twig based Views dispatch Views (Less-logic PHP Views Views) (ideally) Version 0 Version 2 Version 2 Graham Weldon
  • 27.
    9 Graham Weldon
  • 28.
    9 CASE STUDY 1. CakePHP is one of the largest, most popular PHP frameworks worldwide Graham Weldon
  • 29.
    9 CASE STUDY 1. CakePHP is one of the largest, most popular PHP frameworks worldwide 2. Its been established for many years with a solid growth Graham Weldon
  • 30.
    9 CASE STUDY 1. CakePHP is one of the largest, most popular PHP frameworks worldwide 2. Its been established for many years with a solid growth 3. In many ways, its ahead of its time Graham Weldon
  • 31.
    9 CASE STUDY 1. CakePHP is one of the largest, most popular PHP frameworks worldwide 2. Its been established for many years with a solid growth 3. In many ways, its ahead of its time 4. I’m a core developer Graham Weldon
  • 32.
    10 Graham Weldon
  • 33.
    10 MVC STRUCTURE MODEL VIEW Data Output CONTROLLER Control Graham Weldon
  • 34.
    11 Graham Weldon
  • 35.
    11 3 STEPS TO SUCCESS STEP 1 STEP 3 Define Database Customise Code STEP 2 Generate Code MODELS VIEWS BUSINESS LOGIC SECURITY OTHERS CONTROLLERS Graham Weldon
  • 36.
  • 37.
  • 38.
    13 Graham Weldon
  • 39.
    13 3 STEPS TO SUCCESS STEP 1 STEP 3 Define Database Customise Code STEP 2 Generate Code MODELS VIEWS BUSINESS LOGIC SECURITY OTHERS CONTROLLERS Graham Weldon
  • 40.
    14 Graham Weldon
  • 41.
    14 DATABASE DESIGN USERS TAGS POSTS Graham Weldon
  • 42.
    15 Graham Weldon
  • 43.
    15 DATABASE DESIGN JOIN TABLE TAGS USERS POSTS Graham Weldon
  • 44.
    16 Graham Weldon
  • 45.
    16 DATABASE Graham Weldon
  • 46.
    17 Graham Weldon
  • 47.
    17 CODE GENERATION Graham Weldon
  • 48.
    18 Graham Weldon
  • 49.
    18 WHAT HAVE WE GOT? MODELS CONTROLLERS VIEWS Graham Weldon
  • 50.
  • 51.
    at thelook Letscode Graham Weldon
  • 52.
  • 53.
    But... What Does itdo? Graham Weldon
  • 54.
  • 55.
    What did I justlearn? Graham Weldon
  • 56.
    22 Graham Weldon
  • 57.
    22 CAKEPHP’S MVC FAT MODELS THIN CONTROLLERS PLAIN PHP VIEWS Graham Weldon
  • 58.
    23 Graham Weldon
  • 59.
    23 WHAT ELSE? 80% GENERATED 20% EFFORT 100% AWESOME Graham Weldon
  • 60.
  • 61.
  • 62.
    25 Graham Weldon
  • 63.
    25 HISTORY 1950- 1970 1970- 1982 1983 Sharing software Developing Richard Stallman for free was software founds the Free necessary to becomes more Software ensure that and more Foundation to hardware expensive to change the way purchased was put achieve. software is built, to good use. Companies close distributed and Without a free their software and shared. interchange of retain tight control To create software software and over their digital freedom for all. ideas, hardware “investments”. would not have This leads to less Graham Weldon
  • 64.
    26 Graham Weldon
  • 65.
    26 HISTORY 1998 2010 2013 “Open Source” Open source Anything is term is coined at hardware possible a FSF strategy becomes meeting to avoid mainstream, confusion with bringing technical Netscape’s advancements to impending users and a navigator source sharing of ideas. release. Graham Weldon
  • 66.
    27 Graham Weldon
  • 67.
    27 PERCEPTION How “Enterprise” businesses view developers Graham Weldon
  • 68.
    28 Graham Weldon
  • 69.
    28 PERCEPTION How “Enterprise” businesses view open source developers Graham Weldon
  • 70.
    29 Graham Weldon
  • 71.
    29 PERCEPTION Graham Weldon
  • 72.
    30 Graham Weldon
  • 73.
    30 PERCEPTION Graham Weldon
  • 74.
    31 Graham Weldon
  • 75.
    31 COMPARISON Business Freelance Open Source Working for a Working for Free at last? Yes! company where yourself, right? Freedom in you have a boss, Wrong, you’re various software maybe a project working for your licenses allows manager, or clients, and they you to use, modify otherwise, orders dictate what and release coming from happens for the software however management. most part. you like. Graham Weldon
  • 76.
    32 Graham Weldon
  • 77.
    32 CORPORATE LIFE BUSINESS DEVELOP ANALYSIS Assess needs Build out the and costings solution, minimum time, maximum output PROJECT DEFINED What we need to build and achieve Graham Weldon
  • 78.
    33 Graham Weldon
  • 79.
    33 CORPORATE LIFE 1. Businesses are profit driven. Graham Weldon
  • 80.
    33 CORPORATE LIFE 1. Businesses are profit driven. 2. This makes complete sense. Graham Weldon
  • 81.
    33 CORPORATE LIFE 1. Businesses are profit driven. 2. This makes complete sense. 3. If something doesn’t directly improve the bottom line, its unlikely to be approved Graham Weldon
  • 82.
    33 CORPORATE LIFE 1. Businesses are profit driven. 2. This makes complete sense. 3. If something doesn’t directly improve the bottom line, its unlikely to be approved 4. Development is controlled Graham Weldon
  • 83.
    33 CORPORATE LIFE 1. Businesses are profit driven. 2. This makes complete sense. 3. If something doesn’t directly improve the bottom line, its unlikely to be approved 4. Development is controlled 5. Development comes from corporate goals and needs Graham Weldon
  • 84.
    33 CORPORATE LIFE 1. Businesses are profit driven. 2. This makes complete sense. 3. If something doesn’t directly improve the bottom line, its unlikely to be approved 4. Development is controlled 5. Development comes from corporate goals and needs 6. Not much freedom (Usually) Graham Weldon
  • 85.
    34 Graham Weldon
  • 86.
    34 OPEN SOURCE Graham Weldon
  • 87.
    35 Graham Weldon
  • 88.
    35 OPEN SOURCE COMMUNITY FLEXIBILITY NEW TECHNOLOGY Graham Weldon
  • 89.
  • 90.
    Innovation is driven by frustration Graham Weldon
  • 91.
    37 Graham Weldon
  • 92.
    37 FRUSTRATION IS KEY 100 Truly great software is developed at or after the 75 point where a need is not fulfilled well enough, that a develop goes out and 50 builds the correct solution on their own. 25 This results in software that has purpose, meaning and a true useful 0 application in the world. 1 2 3 4 5 Graham Weldon
  • 93.
    38 Graham Weldon
  • 94.
    38 WHY OPEN SOURCE? 1. It get you exposure in the global developer community Graham Weldon
  • 95.
    38 WHY OPEN SOURCE? 1. It get you exposure in the global developer community 2. Other people may need / want your solution. (Help others) Graham Weldon
  • 96.
    38 WHY OPEN SOURCE? 1. It get you exposure in the global developer community 2. Other people may need / want your solution. (Help others) 3. Others may find issues or improvements, and contribute those back Graham Weldon
  • 97.
    38 WHY OPEN SOURCE? 1. It get you exposure in the global developer community 2. Other people may need / want your solution. (Help others) 3. Others may find issues or improvements, and contribute those back 4. It helps make you a better developer Graham Weldon
  • 98.
    39 Graham Weldon
  • 99.
    39 MANAGEMENT 1. All projects are different. Graham Weldon
  • 100.
    39 MANAGEMENT 1. All projects are different. 2. Based on what works best for the community and users Graham Weldon
  • 101.
    39 MANAGEMENT 1. All projects are different. 2. Based on what works best for the community and users 3. Generally a “meritocracy” Graham Weldon
  • 102.
    39 MANAGEMENT 1. All projects are different. 2. Based on what works best for the community and users 3. Generally a “meritocracy” 4. ... unless there is corporate backing Graham Weldon
  • 103.
    40 responsibilities are objectively assigned to individuals based upon their "merits", namely intelligence, credentials, and education, determined through evaluations or examinations. Graham Weldon
  • 104.
    40 MERITOCRACY? responsibilities are objectively assigned to individuals based upon their "merits", namely intelligence, credentials, and education, determined through evaluations or examinations. Graham Weldon
  • 105.
    41 Graham Weldon
  • 106.
    41 TOOLS / SERVICES Github Source Forge Codeplex Travis CI BitBucket ... Graham Weldon
  • 107.
  • 108.

Editor's Notes