SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Symfony vs. Integrating products
  when to use a framework
  Xavier Lacot – Clever Age




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot
Who I am

         
             Symfony developer since end 2005
         
             Several contributions (plugins, docs, patches, etc.)
         
             Manager of the PHP Business Unit of Clever Age
         
             Clever Age - http://clever-age.com/
             
                 Based in Paris, Bordeaux and Lyon, ~70 people
             
                 Technical architecture expertise
             
                 Development,
             
                 Consulting / training / etc.




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                               2
Contents

      
          A (web) developer's life ?

      
          The choice of a technical architecture

      
          A practical sight on CMS and framework's code

         Howto...
          
              Integrate Symfony within other products
          
              A CMS with Symfony in less than one day

         Publication time : cleverMediaLibrary

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                      3
A (web) developer's life
    Symfony Day – 4. Juni 2009
    Clever Age | Xavier Lacot
http://www.flickr.com/photos/nathonline/918128338
                                                                               4
A developer's life

         Web projects cover a large panel
            
                Content management
            
                Social networks
            
                Customer Relation Management
            
                Communication
            
                Collaborative
            
                File sharing
            
                Specific applications

         In almost every web project, a developer will
          loose some hair
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                       5
A developer's life

      
          Wide range of difficulty
            
                5 days of html integration for a small « webpage »
            
                … 1000+ development days using a framework for a social/2.0
                platform
            
                Often, the right solution does not exist !




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                     6
A developer's life


      
          The developer has the choice between a lot
          of tools
            
                Frameworks
            
                Integrated (open source) products
            
                The bad : Integrated (closed-source) products
            
                The worse : closed-source frameworks




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                   7
A practical sight on products and framework's code


      
          What do I mean with « products » ?
            
                CMS, forums, CRM tools, blogs, photo gallery, etc.
            
                Not designed as development platforms, but as usable tools
            
                Usually only available as packages archives (zip, tar.gz)
            
                Not based on a framework




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                      8
A practical sight on products and framework's code


      
          ...and with « frameworks » ?
            
                Not « functionalities-oriented »
            
                Created as a development platform
            
                DIY – do it yourself




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                      9
… for instance, Symfony

  Symfony, a « full options » framework
                                   cli
                                  mvc
                                  ajax
                                  crud
                                 cache
                                events
                                routing
                             +600 plugins
                             performance
                            documentation
                           admin generator
                         internationalization
                       unit and functional tests
                      ORMs (Propel or Doctrine)
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                               10
The choice of a technical architecture
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                        11
The choice of a technical architecture



   Several considerations
         
             Complexity of the project (workload, features,
             scalability)
         
             Development methodology
         
             Is there a lot of personnalisation ?
               
                   Adding functions
               
                   Removing functions
         
             Do plugins/extensions exist, that cover the
             requirements ?



Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                   12
Integrating products


      
          Integrating products is a good idea
          
              It may save time, money, and pressure
          
              It may help building a better application
          
              At least the client will get the product's feature set
          
              Don't always re-invent the wheel !

      
          Perfect solutions for common needs



   … the hell is that client rarely have common needs !
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                13
Integrating products


   Possible options :
         
             Change some code :
             
                 issues with future upgrades
         
             Change code + submit ticket :
             
                 lot more work (contributions needs to be clean)
             
                 Not sure it is accepted
         
             Create extensions when possible
             
                 These products are not designed for developing !
         
             Drop the product and code yourself
             
                 Clearly define the project

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                      14
«CMS are good to make simple websites that are
   mainly meant to be looked at, while frameworks
         are good to make complex websites that are
                             meant to be interacted with »




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                    15
The choice of a technical architecture




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                        16
The choice of a technical architecture


      
          Magento Commerce is a sort of success story
          
              Based on Zend Framework
          
              Overhealmed OS Commerce in 2 years




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                             17
The choice of a technical architecture


      
          Gold rules
          
              Think simple – not a overload of useless functions
          
              Backend must be easy to use
              
                  WYSIWYG editor
              
                  Adapted widgets
          
              Follow standards – never hack up
          
              Documentation !
          
              Open the development : search contributors
          
              Release often

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                18
The choice of a technical architecture


      
          The equation is simple :


                 Time to hack   vs.        Time to build


      
          What do you prefer in your life ?




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                           19
A practical sight on products and framework's code


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                  20
A practical sight on products and framework's code


      
          The quality largely varies
            
                Security
            
                A common design pattern (MVC ?)
            
                Portability (database, etc.)
            
                ORM
            
                Developer tools / Technical documentation
            
                Performance
            
                API
            
                Object-oriented
            
                Standards compliance


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                     21
For instance : Drupal architecture




                                          request


                                        Drupal core

                                              Modules hooks
                             hook()
                                              Theme engine

                                  Theme engine (*.tpl.php)


Symfony Day – 4. Juni 2009
                                         response
Clever Age | Xavier Lacot                                                      22
For instance : some Drupal facts


         
             Forms validation … w00t
if (!empty($form_values['departing']) && ( $departing < $date )) {
  form_set_error('departing', t('The departing date isn't valid.'));
}

         
             We love documentation...

function node_form_submit($form_id, $form_values) {
  global $user;
  ...
         
             … and also SQL queries !
   db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
   db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);

         
             ~70 000 lines of PHP code, ~75 files only...
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                              23
A practical sight on products and framework's code
      
          Overall criticism :
          
              Poorly (well, not) OO
          
              No MVC, Modules are a mess
          
              No native developer tool, core code is not
              commented
          
              No ORM. The « database layer » main usage is to
              map « drupal_query() » to db specific functions
          
              Forms management is archaiq
          
              Writing modules might turn into a nightmare – 5000
              lines+ of code in a single file, etc.

          
              From a purely technical point of view :      #FAIL
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                    24
A practical sight on products and framework's code

      
          Positive points:
          
              It works out of the box
          
              If there are very few customizations to do, then it is
              the prfect solution (no development at all)
          
              There is a huge community
              
                  Lots of contributions
              
                  /! mot of them are unusable !!!
          
              The « client effect » always works




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                       25
So how to take profit out of both ?


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                      26
How to integrate Symfony with other products


      
          Consider the following context
            
                Very large company
            
                Non-technical people
            
                High content management requirements
            
                A big part of the site is a custom development
            
                We do not have a lot of days




                             ...a common situation

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                   27
How to integrate Symfony with other products


      
          Facts:
          
              Not possible to develop everything
          
              Using the CMS as the development tool won't help

         => let's integrate Symfony ! Several ways:
          
              Include-based integration
          
              Several Apache mountpoints
          
              XMPP-based communication




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                               28
How to integrate Symfony with other products




                                                          Module A

                                                          Module B
                                  Symfony
                                                            ...

                                                       “cms” module




                             databases               Drupal install


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                    29
How to integrate Symfony with other products


      
          routing.yml, last rule :
drupal:
  url:   /:uri
  param: { module: cms, action: drupal }
  requirements: { uri: ^(.)*$ }

         Cms module / executeDrupal() :
public function executeDrupal(sfWebRequest $request)
{
  ob_start('drupal');
  include(sfConfig::get('sf_root_dir').'/lib/drupal/index.php');
  $this->return = ob_get_flush();
}



Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                              30
How to integrate Symfony with other products


      
          Second solution, XMPP calls for db
          synchronisation (huge work, but w00t):




                                 XMPP server
Drupal install                                                Symfony
                                  (Openfire)




                                Uses pubSub as data format
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                              31
The one-development-day Symfony CMS


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                      32
A minimal CMS


      
          What is a minimal CMS ?
          
              Backend
              
                  Users management,
              
                  Possibility to create pages at certain urls
              
                  Posibiliy to put content in these pages
              
                  Media management
          
              Frontend
              
                  Ability to display informations




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                  33
A minimal CMS


       
           Backend components
           
               sfDoctrineGuardPlugin
           
               cleverMediaLibraryPlugin
           
               some tables for the model:
content:
  id:
  displayed_author:           varchar(150)
  title:                      varchar(255)
  body:                       longvarchar
  created_at:                 timestamp
  created_by:                 { type: integer, foreignTable: sf_guard_user, foreignReference: id }
  publication_status:         varchar(20)
  published_at:               timestamp
  published_by:               { type: integer, foreignTable: sf_guard_user, foreignReference: id }
  updated_at:                 timestamp
  updated_by:                 { type: integer, foreignTable: sf_guard_user, foreignReference: id }
  meta_description:           longvarchar
  meta_keywords:              longvarchar

 Symfony Day – 4. Juni 2009
 Clever Age | Xavier Lacot                                                                           34
A minimal CMS : frontend highlights


      
          « catch-all » routing rule in routing.yml

   # for html pages
   cms:
     url:   /:uri.html
     param: { module: cms, action: view }
     requirements: { uri: ^(.)*$ }

   # for all other defined url
   cms_garbage:
     url:   /:uri
     param: { module: cms, action: view }
     requirements: { uri: ^(.)*$ }




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                           35
Publication time : cleverMediaLibraryPlugin


Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                              36
Objectifs


         
             An enterprise solution for managing media
         
             Supports a large number of file formats
             
                 Images, videos
             
                 Documents
             
                 etc.
         
             Storage abstraction
         
             Media management API
         
             Metadata support
         
             Search (tags + index), credentials
         
             Performance
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                       37
Formats de fichiers supportés

         
             Images, whatever the type (jpg, gif, png, etc.)
             
                 Several adapters are available:
                 
                     Imagemagick tools
                 
                     GD
         
             PDF documents
         
             Office documents
             
                 OpenOffice
             
                 MS Office
             
                 Uses PUNO (PHP ↔ OpenOffice UNO bridge) – not stable
         
             Videos
             
                 Ffmpeg / imagemagick
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                38
Schema

                                        GD        ImageMagick    PUNO ...
                             adapters             handler
                                      Adapter                   Adapter

                                         Image      PDF          Office ...
                             handlers
                                        handler   handler       handler



     Model classes                          cleverMedia



                File storage abstraction - cleverFilesystemPlugin

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                39
File storage abstraction
                                                   cleverFileSystemPlugin (1/3)

         
             Adapters set
             
                 Disk
             
                 FTP
             
                 S3
             
                 … contributions are welcome !
         
             The API is classical
             
                 Statistics: exists / getSize / isDir / isFile
             
                 Directories operations: mkDir / listDir /
             
                 File operations: write / unlink / rename / read / copy



Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                     40
File storage abstraction
                                      cleverFileSystemPlugin (2/3)

         
             File system creation


                $fs = cleverFilesystem::getInstance(array(
                    'type'      => 'disk',
                    'root'      => '/path/to/root',
                    'cache_dir' => '/tmp'
                ));

                // filesystem operations
                $content = $fs->listDir('');
                $content = $fs->listDir('path/to/directory');



Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                        41
File storage abstraction
                                       cleverFileSystemPlugin (3/3)


             $fs = cleverFilesystem::getInstance('ftp_michel');

              app:
                cleverFilesystemPlugin:
                   filesystems:
                     ftp_michel:
                       cache_dir:     /tmp
                       type:          ftp
                       host:          localhost
                       username:      michel
                       password:      p4ssw0rd
                       Port:          21
                       root:          ftpserv

               ftp://michel:p4ssw0rd@localhost:21/ftpserv/
Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                         42
API usage


 // retrieve a folder
 $parent =
 ccMediaFolderPeer::retrieveByPath('meetings/cologne');

 // Create a folder
 $folder = new ccMediaFolder();
 $fields = array(
    'name'       => 'Symfony Day Cologne',
    'created_by' => $this->getUser()->getUserId(),
    'updated_by' => $this->getUser()->getUserId()
    'parent'     => $parent
 );
 $folder->update($fields);
 $folder->save();

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                 43
API usage

 // retrieve a folder
 $parent =
 ccMediaFolderPeer::retrieveByPath('meetings/cologne');

 // Create a file
 $image = new ccMedia();
 $fields = array(
    'cc_media_folder' => $folder,
    'source'          => 'http://lacot.org/image.png',
    'filename'        => 'new_filename.png',
    'updated_by'      => $this->getUser()->getUserId(),
    'created_by'      => $this->getUser()->getUserId()
 );
 $image->update($fields);
 $image->save();

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                 44
tasks




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot       45
Questions

                             Xavier Lacot <xavier@lacot.org>
                                    http://lacot.org/




Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                      46
Contact us


                             Clever Age :   37, boulevard des Capucines
                                            75002 Paris, France

                              Agencies :    Lyon, Bordeaux

                                 Phone :    +33 1 53 34 66 10

                                   Web :    http://www.clever-age.com/

        Commercial contact :                commercial@clever-age.com

             Technical contact :            technique@clever-age.com

Symfony Day – 4. Juni 2009
Clever Age | Xavier Lacot                                                 47

Mais conteúdo relacionado

Mais procurados

Netbeans
NetbeansNetbeans
Netbeans
acosdt
 
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
Xamarin
 
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
Fabien Potencier
 
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
Fabien Potencier
 

Mais procurados (20)

engage 2014 - JavaBlast
engage 2014 - JavaBlastengage 2014 - JavaBlast
engage 2014 - JavaBlast
 
Getting Started with Node.js
Getting Started with Node.jsGetting Started with Node.js
Getting Started with Node.js
 
slide to delete
slide to deleteslide to delete
slide to delete
 
Virgo Project Creation Review
Virgo Project Creation ReviewVirgo Project Creation Review
Virgo Project Creation Review
 
Eclipse Vs Netbeans
Eclipse Vs NetbeansEclipse Vs Netbeans
Eclipse Vs Netbeans
 
Netbeans
NetbeansNetbeans
Netbeans
 
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
GitHub halp app - Minimizing platform-specific code with MVVM - Justin Spahr-...
 
Robust collaboration services with OSGi - Satya Maheshwari
Robust collaboration services with OSGi - Satya MaheshwariRobust collaboration services with OSGi - Satya Maheshwari
Robust collaboration services with OSGi - Satya Maheshwari
 
PHP, Cloud And Microsoft Symfony Live 2010
PHP,  Cloud And  Microsoft    Symfony  Live 2010PHP,  Cloud And  Microsoft    Symfony  Live 2010
PHP, Cloud And Microsoft Symfony Live 2010
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
 
Html5, Native and Platform based Mobile Applications
Html5, Native and Platform based Mobile ApplicationsHtml5, Native and Platform based Mobile Applications
Html5, Native and Platform based Mobile Applications
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?
 
AD114 - Don't be afraid of curly brackets reloaded - even more JavaScript for...
AD114 - Don't be afraid of curly brackets reloaded - even more JavaScript for...AD114 - Don't be afraid of curly brackets reloaded - even more JavaScript for...
AD114 - Don't be afraid of curly brackets reloaded - even more JavaScript for...
 
JavaFX vs AJAX vs Flex
JavaFX vs AJAX vs FlexJavaFX vs AJAX vs Flex
JavaFX vs AJAX vs Flex
 
Embedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse applicationEmbedding Web UIs in your Eclipse application
Embedding Web UIs in your Eclipse application
 
3978 Why is Java so different... A Session for Cobol/PLI/Assembler Developers
3978   Why is Java so different... A Session for Cobol/PLI/Assembler Developers3978   Why is Java so different... A Session for Cobol/PLI/Assembler Developers
3978 Why is Java so different... A Session for Cobol/PLI/Assembler Developers
 
FreshAir2008
FreshAir2008FreshAir2008
FreshAir2008
 
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 

Destaque

Keynote d'ouverture - Forum PHP 2012
Keynote d'ouverture - Forum PHP 2012Keynote d'ouverture - Forum PHP 2012
Keynote d'ouverture - Forum PHP 2012
Xavier Lacot
 

Destaque (7)

Keynote d'ouverture - Forum PHP 2012
Keynote d'ouverture - Forum PHP 2012Keynote d'ouverture - Forum PHP 2012
Keynote d'ouverture - Forum PHP 2012
 
Keynote de clôture - PHP Tour 2011
Keynote de clôture - PHP Tour 2011Keynote de clôture - PHP Tour 2011
Keynote de clôture - PHP Tour 2011
 
Domain Driven Development applied
Domain Driven Development appliedDomain Driven Development applied
Domain Driven Development applied
 
Abstracting databases access in Titanium Mobile
Abstracting databases access in Titanium MobileAbstracting databases access in Titanium Mobile
Abstracting databases access in Titanium Mobile
 
Introduction to Akamon software arquitecture for MPWAR
Introduction to Akamon software arquitecture for MPWARIntroduction to Akamon software arquitecture for MPWAR
Introduction to Akamon software arquitecture for MPWAR
 
Forum PHP 2010 - Les frameworks, essentiels dans-l-ecosysteme-php-xavier-laco...
Forum PHP 2010 - Les frameworks, essentiels dans-l-ecosysteme-php-xavier-laco...Forum PHP 2010 - Les frameworks, essentiels dans-l-ecosysteme-php-xavier-laco...
Forum PHP 2010 - Les frameworks, essentiels dans-l-ecosysteme-php-xavier-laco...
 
Symfony2 components to the rescue of your PHP projects
Symfony2 components to the rescue of your PHP projectsSymfony2 components to the rescue of your PHP projects
Symfony2 components to the rescue of your PHP projects
 

Semelhante a Symfony Day 2009 - Symfony vs Integrating products

symfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Frameworksymfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Framework
Fabien Potencier
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
Rubymotion inspect 2014_review
Rubymotion inspect 2014_reviewRubymotion inspect 2014_review
Rubymotion inspect 2014_review
Bob Firestone
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
Ajax Experience 2009
 
Screencasting in the cloud
Screencasting in the cloudScreencasting in the cloud
Screencasting in the cloud
Caroline Conlon
 

Semelhante a Symfony Day 2009 - Symfony vs Integrating products (20)

symfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Frameworksymfony: Open-Source Enterprise Framework
symfony: Open-Source Enterprise Framework
 
Domino X Pages 8.5
Domino X Pages 8.5Domino X Pages 8.5
Domino X Pages 8.5
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
 
Tales of Suckage and Awesomeness (Full Frontal 2012)
Tales of Suckage and Awesomeness (Full Frontal 2012)Tales of Suckage and Awesomeness (Full Frontal 2012)
Tales of Suckage and Awesomeness (Full Frontal 2012)
 
Hithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxyHithhiker guide to eclipse presentation frameworks galaxy
Hithhiker guide to eclipse presentation frameworks galaxy
 
MinneWebCon 2009 CodeMorphic Hybrid iPhone App Presentation
MinneWebCon 2009 CodeMorphic Hybrid iPhone App PresentationMinneWebCon 2009 CodeMorphic Hybrid iPhone App Presentation
MinneWebCon 2009 CodeMorphic Hybrid iPhone App Presentation
 
iPhone Development For .Net Dev
iPhone Development For .Net DeviPhone Development For .Net Dev
iPhone Development For .Net Dev
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Rubymotion inspect 2014_review
Rubymotion inspect 2014_reviewRubymotion inspect 2014_review
Rubymotion inspect 2014_review
 
Introduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual StudioIntroduction to Cross Platform Development with Xamarin/ Visual Studio
Introduction to Cross Platform Development with Xamarin/ Visual Studio
 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
 
Electronic Publishing 2.0: Reimagining the Publication and Preservation of E ...
Electronic Publishing 2.0: Reimagining the Publication and Preservation of E ...Electronic Publishing 2.0: Reimagining the Publication and Preservation of E ...
Electronic Publishing 2.0: Reimagining the Publication and Preservation of E ...
 
iPhone Web Development
iPhone Web DevelopmentiPhone Web Development
iPhone Web Development
 
Squeak
SqueakSqueak
Squeak
 
Design for Hackers
Design for HackersDesign for Hackers
Design for Hackers
 
20 Practical tips for a successful internationalisation project
20 Practical tips for a successful internationalisation project20 Practical tips for a successful internationalisation project
20 Practical tips for a successful internationalisation project
 
EMC World 2016 - cnaITL.01 Adopting An Open Source Strategy
EMC World 2016 - cnaITL.01 Adopting An Open Source StrategyEMC World 2016 - cnaITL.01 Adopting An Open Source Strategy
EMC World 2016 - cnaITL.01 Adopting An Open Source Strategy
 
Screencasting in the cloud
Screencasting in the cloudScreencasting in the cloud
Screencasting in the cloud
 
Introduction to Buildpacks.io Presentation
Introduction to Buildpacks.io PresentationIntroduction to Buildpacks.io Presentation
Introduction to Buildpacks.io Presentation
 
Distributing Information Online
Distributing Information OnlineDistributing Information Online
Distributing Information Online
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Symfony Day 2009 - Symfony vs Integrating products

  • 1. Symfony vs. Integrating products when to use a framework Xavier Lacot – Clever Age Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot
  • 2. Who I am  Symfony developer since end 2005  Several contributions (plugins, docs, patches, etc.)  Manager of the PHP Business Unit of Clever Age  Clever Age - http://clever-age.com/  Based in Paris, Bordeaux and Lyon, ~70 people  Technical architecture expertise  Development,  Consulting / training / etc. Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 2
  • 3. Contents  A (web) developer's life ?  The choice of a technical architecture  A practical sight on CMS and framework's code  Howto...  Integrate Symfony within other products  A CMS with Symfony in less than one day  Publication time : cleverMediaLibrary Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 3
  • 4. A (web) developer's life Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot http://www.flickr.com/photos/nathonline/918128338 4
  • 5. A developer's life  Web projects cover a large panel  Content management  Social networks  Customer Relation Management  Communication  Collaborative  File sharing  Specific applications  In almost every web project, a developer will loose some hair Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 5
  • 6. A developer's life  Wide range of difficulty  5 days of html integration for a small « webpage »  … 1000+ development days using a framework for a social/2.0 platform  Often, the right solution does not exist ! Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 6
  • 7. A developer's life  The developer has the choice between a lot of tools  Frameworks  Integrated (open source) products  The bad : Integrated (closed-source) products  The worse : closed-source frameworks Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 7
  • 8. A practical sight on products and framework's code  What do I mean with « products » ?  CMS, forums, CRM tools, blogs, photo gallery, etc.  Not designed as development platforms, but as usable tools  Usually only available as packages archives (zip, tar.gz)  Not based on a framework Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 8
  • 9. A practical sight on products and framework's code  ...and with « frameworks » ?  Not « functionalities-oriented »  Created as a development platform  DIY – do it yourself Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 9
  • 10. … for instance, Symfony Symfony, a « full options » framework cli mvc ajax crud cache events routing +600 plugins performance documentation admin generator internationalization unit and functional tests ORMs (Propel or Doctrine) Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 10
  • 11. The choice of a technical architecture Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 11
  • 12. The choice of a technical architecture Several considerations  Complexity of the project (workload, features, scalability)  Development methodology  Is there a lot of personnalisation ?  Adding functions  Removing functions  Do plugins/extensions exist, that cover the requirements ? Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 12
  • 13. Integrating products  Integrating products is a good idea  It may save time, money, and pressure  It may help building a better application  At least the client will get the product's feature set  Don't always re-invent the wheel !  Perfect solutions for common needs … the hell is that client rarely have common needs ! Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 13
  • 14. Integrating products Possible options :  Change some code :  issues with future upgrades  Change code + submit ticket :  lot more work (contributions needs to be clean)  Not sure it is accepted  Create extensions when possible  These products are not designed for developing !  Drop the product and code yourself  Clearly define the project Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 14
  • 15. «CMS are good to make simple websites that are mainly meant to be looked at, while frameworks are good to make complex websites that are meant to be interacted with » Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 15
  • 16. The choice of a technical architecture Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 16
  • 17. The choice of a technical architecture  Magento Commerce is a sort of success story  Based on Zend Framework  Overhealmed OS Commerce in 2 years Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 17
  • 18. The choice of a technical architecture  Gold rules  Think simple – not a overload of useless functions  Backend must be easy to use  WYSIWYG editor  Adapted widgets  Follow standards – never hack up  Documentation !  Open the development : search contributors  Release often Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 18
  • 19. The choice of a technical architecture  The equation is simple : Time to hack vs. Time to build  What do you prefer in your life ? Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 19
  • 20. A practical sight on products and framework's code Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 20
  • 21. A practical sight on products and framework's code  The quality largely varies  Security  A common design pattern (MVC ?)  Portability (database, etc.)  ORM  Developer tools / Technical documentation  Performance  API  Object-oriented  Standards compliance Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 21
  • 22. For instance : Drupal architecture request Drupal core Modules hooks hook() Theme engine Theme engine (*.tpl.php) Symfony Day – 4. Juni 2009 response Clever Age | Xavier Lacot 22
  • 23. For instance : some Drupal facts  Forms validation … w00t if (!empty($form_values['departing']) && ( $departing < $date )) { form_set_error('departing', t('The departing date isn't valid.')); }  We love documentation... function node_form_submit($form_id, $form_values) { global $user; ...  … and also SQL queries ! db_query('DELETE FROM {node} WHERE nid = %d', $node->nid); db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);  ~70 000 lines of PHP code, ~75 files only... Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 23
  • 24. A practical sight on products and framework's code  Overall criticism :  Poorly (well, not) OO  No MVC, Modules are a mess  No native developer tool, core code is not commented  No ORM. The « database layer » main usage is to map « drupal_query() » to db specific functions  Forms management is archaiq  Writing modules might turn into a nightmare – 5000 lines+ of code in a single file, etc.  From a purely technical point of view : #FAIL Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 24
  • 25. A practical sight on products and framework's code  Positive points:  It works out of the box  If there are very few customizations to do, then it is the prfect solution (no development at all)  There is a huge community  Lots of contributions  /! mot of them are unusable !!!  The « client effect » always works Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 25
  • 26. So how to take profit out of both ? Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 26
  • 27. How to integrate Symfony with other products  Consider the following context  Very large company  Non-technical people  High content management requirements  A big part of the site is a custom development  We do not have a lot of days ...a common situation Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 27
  • 28. How to integrate Symfony with other products  Facts:  Not possible to develop everything  Using the CMS as the development tool won't help  => let's integrate Symfony ! Several ways:  Include-based integration  Several Apache mountpoints  XMPP-based communication Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 28
  • 29. How to integrate Symfony with other products Module A Module B Symfony ... “cms” module databases Drupal install Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 29
  • 30. How to integrate Symfony with other products  routing.yml, last rule : drupal: url: /:uri param: { module: cms, action: drupal } requirements: { uri: ^(.)*$ }  Cms module / executeDrupal() : public function executeDrupal(sfWebRequest $request) { ob_start('drupal'); include(sfConfig::get('sf_root_dir').'/lib/drupal/index.php'); $this->return = ob_get_flush(); } Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 30
  • 31. How to integrate Symfony with other products  Second solution, XMPP calls for db synchronisation (huge work, but w00t): XMPP server Drupal install Symfony (Openfire) Uses pubSub as data format Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 31
  • 32. The one-development-day Symfony CMS Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 32
  • 33. A minimal CMS  What is a minimal CMS ?  Backend  Users management,  Possibility to create pages at certain urls  Posibiliy to put content in these pages  Media management  Frontend  Ability to display informations Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 33
  • 34. A minimal CMS  Backend components  sfDoctrineGuardPlugin  cleverMediaLibraryPlugin  some tables for the model: content: id: displayed_author: varchar(150) title: varchar(255) body: longvarchar created_at: timestamp created_by: { type: integer, foreignTable: sf_guard_user, foreignReference: id } publication_status: varchar(20) published_at: timestamp published_by: { type: integer, foreignTable: sf_guard_user, foreignReference: id } updated_at: timestamp updated_by: { type: integer, foreignTable: sf_guard_user, foreignReference: id } meta_description: longvarchar meta_keywords: longvarchar Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 34
  • 35. A minimal CMS : frontend highlights  « catch-all » routing rule in routing.yml # for html pages cms: url: /:uri.html param: { module: cms, action: view } requirements: { uri: ^(.)*$ } # for all other defined url cms_garbage: url: /:uri param: { module: cms, action: view } requirements: { uri: ^(.)*$ } Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 35
  • 36. Publication time : cleverMediaLibraryPlugin Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 36
  • 37. Objectifs  An enterprise solution for managing media  Supports a large number of file formats  Images, videos  Documents  etc.  Storage abstraction  Media management API  Metadata support  Search (tags + index), credentials  Performance Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 37
  • 38. Formats de fichiers supportés  Images, whatever the type (jpg, gif, png, etc.)  Several adapters are available:  Imagemagick tools  GD  PDF documents  Office documents  OpenOffice  MS Office  Uses PUNO (PHP ↔ OpenOffice UNO bridge) – not stable  Videos  Ffmpeg / imagemagick Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 38
  • 39. Schema GD ImageMagick PUNO ... adapters handler Adapter Adapter Image PDF Office ... handlers handler handler handler Model classes cleverMedia File storage abstraction - cleverFilesystemPlugin Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 39
  • 40. File storage abstraction cleverFileSystemPlugin (1/3)  Adapters set  Disk  FTP  S3  … contributions are welcome !  The API is classical  Statistics: exists / getSize / isDir / isFile  Directories operations: mkDir / listDir /  File operations: write / unlink / rename / read / copy Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 40
  • 41. File storage abstraction cleverFileSystemPlugin (2/3)  File system creation $fs = cleverFilesystem::getInstance(array( 'type' => 'disk', 'root' => '/path/to/root', 'cache_dir' => '/tmp' )); // filesystem operations $content = $fs->listDir(''); $content = $fs->listDir('path/to/directory'); Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 41
  • 42. File storage abstraction cleverFileSystemPlugin (3/3) $fs = cleverFilesystem::getInstance('ftp_michel'); app: cleverFilesystemPlugin: filesystems: ftp_michel: cache_dir: /tmp type: ftp host: localhost username: michel password: p4ssw0rd Port: 21 root: ftpserv ftp://michel:p4ssw0rd@localhost:21/ftpserv/ Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 42
  • 43. API usage // retrieve a folder $parent = ccMediaFolderPeer::retrieveByPath('meetings/cologne'); // Create a folder $folder = new ccMediaFolder(); $fields = array( 'name' => 'Symfony Day Cologne', 'created_by' => $this->getUser()->getUserId(), 'updated_by' => $this->getUser()->getUserId() 'parent' => $parent ); $folder->update($fields); $folder->save(); Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 43
  • 44. API usage // retrieve a folder $parent = ccMediaFolderPeer::retrieveByPath('meetings/cologne'); // Create a file $image = new ccMedia(); $fields = array( 'cc_media_folder' => $folder, 'source' => 'http://lacot.org/image.png', 'filename' => 'new_filename.png', 'updated_by' => $this->getUser()->getUserId(), 'created_by' => $this->getUser()->getUserId() ); $image->update($fields); $image->save(); Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 44
  • 45. tasks Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 45
  • 46. Questions Xavier Lacot <xavier@lacot.org> http://lacot.org/ Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 46
  • 47. Contact us Clever Age : 37, boulevard des Capucines 75002 Paris, France Agencies : Lyon, Bordeaux Phone : +33 1 53 34 66 10 Web : http://www.clever-age.com/ Commercial contact : commercial@clever-age.com Technical contact : technique@clever-age.com Symfony Day – 4. Juni 2009 Clever Age | Xavier Lacot 47