SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
S      f  2
                                &
                             R R3
                        Fr    f r   r

Monday, June 20, 2011
A      r C
                        S r P
                         A b r B rr à

Monday, June 20, 2011
Brescia - 24 settembre 2011




Monday, June 20, 2011
Why this speech?
             W        p  ?
               Agenda
                A
           Join the f***ing
          J      f***       f
               cooonf
Monday, June 20, 2011
come utente anonimo voglio poter vedere
   l'elenco delle conferenze ordinate per data
   decrescente
   come ua e ur voglio poter vedere l'elenco delle
   presentazioni di una conferenza ordinate in data
   crescente
   come ua e ur voglio porer vedere il dettaglio di
   una presenzatione
   come ua voglio potermi registrare
   come ur voglio poter aderire ad una conferenza
   come ur voglio poter commentare una
   conferenza
   come ur voglio poter commentare una
   presentazione
Monday, June 20, 2011
http://joinconf.heroku.com   https://github.com/cirpo/joinconf
                                  https://github.com/sandropaganoti/joinconf
                                            only Firefox 4 and Chrome 10+


Monday, June 20, 2011
R R3
                        • Thank you Trygve Reenskaug
                        • Thank you Matz
                        • Thank you DHH




Monday, June 20, 2011
R b                            R                Ar               r
                                            rack stack
                                             middleware 1
         web server                                ...
                                             middleware N
                                                                     View
 response               request
                                  run Joinconf::Application.routes


                                            ActionController
                                            MiddlewareStack          Model

                                    Controller.new.process(action)




Monday, June 20, 2011
S        f      2
                        •   Thank you RoR
                        •   Thank you Fabien
                        •   Thank you Doctrine
                        •   Thank you Spring
                        •   Thank you Cocoa




Monday, June 20, 2011
S            f         2 Ar                r
                                DI       View

     request                    Kernel       Event Dispatcher
                 response


                            Bundle*
                                         Model




Monday, June 20, 2011
S
                        • Rack
                        • Event Driven




Monday, June 20, 2011
<services>
                            <service id="fos_user.controller.user"
                             class="%fos_user.controller.user.class%">
                                <call method="setContainer">
                                    <argument type="service" id="service_container" />
                                </call>
                                <tag name="security.secure_service" />
                            </service>
                            <service id="fos_user.controller.security"
                             class="%fos_user.controller.security.class%">
                                <call method="setContainer">
                                    <argument type="service" id="service_container" />
                                </call>
                            </service>
                        </services>




Monday, June 20, 2011
services:
             ideato.joinconf.admin.talk:
               class: IdeatoDunlopBundleAdminNewsAdmin
               tags:
                 - { name: sonata.admin, manager_type: orm, group: Donlup News, label: News }
               arguments: [null, IdeatoDunlopBundleEntityNews,
           IdeatoDunlopBundle:NewsAdmin]




Monday, June 20, 2011
namespace IdeatoJoinConfBundleDataFixtruesORM;

        use DoctrineCommonDataFixturesFixtureInterface;
        use SymfonyComponentDependencyInjectionContainerInterface;
        use SymfonyComponentDependencyInjectionContainerAwareInterface;

        class UserFixtures implements FixtureInterface, ContainerAwareInterface {

              private $container;

              public function setContainer(ContainerInterface $container = null) {
                  $this->container = $container;
              }

              public function load($manager) {

                    $creator = $this->container->get('fos_user.user_creator');
                    $creator->create("Ideato", "Ideato", "alessandro.cinelli@gmail.com", false, true);
                    $creator->create("odracci", "odracci", "odracci@gmail.com", false, true);
                    $creator->create("alberto.barrila", "suka", "alberto.barilla@gmail.com", false, true);
                    $creator->create("sandro.paganotti", "suka", "sandro.paganotti@gmail.com", false,
        true);




Monday, June 20, 2011
S       f
                        e.g.: SymfonyComponentHttpKernel
                                 Stack
                        onCoreRequest
                        onCoreException
                        onCoreView
                        onCoreController
                        onCoreResponse



Monday, June 20, 2011
R
                            always tell your mama
                        before you go off somewhere!




Monday, June 20, 2011
R
                        resources :conferences do
                          resources :comments
                          resources :sessions do
                            resources :comments
                          end
                          resources :attendees
                        end




Monday, June 20, 2011
Symfony
       _welcome:
           pattern: /
           defaults: { _controller: 'IdeatoJoinConfBundle:Homepage:index' }

       conference:
           pattern:   /conference/{slug}
           defaults: { _controller: 'IdeatoJoinConfBundle:Blog:show', slug: 1 }
           requirements:
               page: d+




Monday, June 20, 2011
M           r
                        • Routes to Rack and Engines
                        • Bundles




Monday, June 20, 2011
C          r          r
                        class ConferencesController < ApplicationController
                            def index
                                @conferences = Conference.all
                                respond_with @conferences
                            end
                            def show
                                @conference = Conference.find(params[:id])
                            end
                        end




Monday, June 20, 2011
C      r    r
                        • Function
                        • Object method
                        • Closure




Monday, June 20, 2011
C             r            r
                namespace IdeatoJoinConfBundleController;

                use IdeatoJoinConfBundleEntityConference;
                use SymfonyBundleFrameworkBundleControllerController;

                class HomepageController extends Controller {

                    public function indexAction()
                    {
                      $conference_repository = $this->get('doctrine.orm.entity_manager')
                                      ->getRepository('IdeatoJoinConfBundle:Conference');

                        $conferences = $conference_repository
                                        ->retrieveConferencesByAscendingOrder();

                        return $this->render
                (              ('IdeatoJoinConfBundle:Default:index.html.twig',
                                 array('conferences' => $conferences));




Monday, June 20, 2011
M
                        • Doctrine 2
                        • POPO
                        • DataMapper
                        • ODM




Monday, June 20, 2011
M
       namespace IdeatoJoinConfBundleEntity;

       /**
        * @orm:Entity(repositoryClass="IdeatoJoinConfBundleRepositories
       ConferenceRepository")
        */
       class Conference {

               /**
                * @orm:Id
                * @orm:Column(type="integer")
                * @orm:GeneratedValue(strategy="AUTO")
                */
               private $id;
               /**
                * @orm:Column(type="string", length="255")
                */
               private $title;
               /**
                * @orm:Column(type="datetime")
                */
               private $date;


Monday, June 20, 2011
M
     namespace IdeatpJoinConfBundleEntity;

     /**
      * @orm:Entity(repositoryClass="CirpoJoinConfBundleRepositories
     SessionRepository")
      */
     class Talk {

              /**
               * @orm:Id
               * @orm:Column(type="integer")
               * @orm:GeneratedValue(strategy="AUTO")
               */
              private $id;
              /**
               * @orm:Column(type="string", length="255")
               */
              private $title;
              /**
               * @ORMOneToMany(targetEntity="User", mappedBy="talk")
               */
              private $speakers;

Monday, June 20, 2011
M
                        class Conference < ActiveRecord::Base
                          validates :name, :start, :end, :users_max,
                                    :location, :presence => true
                          default_scope :order => "start DESC"

                          has_many :sessions
                          has_many :attendees
                          has_many :comments, :as => :commentable

                        end




Monday, June 20, 2011
M
                        • ActiveModel
                        • Arel
                        • ActiveResource




Monday, June 20, 2011
V w
                        • Twig
                        • Plain PHP
                        • Assetic




Monday, June 20, 2011
{% if loop.index is not divisibleby(3) %}



                         View
        {{ post.published_at|date("m/d/Y") }}

        {{ "I like %this% and %that%."|replace({'%this
        %': foo, '%that%': "bar"}) }}

        {{ var.foo|default('foo item on var is not
        defined') }}
        {{ var is even }}
        {{ var is odd }}
        {% if foo.attribute is sameas(false) %}
        {% for i in range(0, 3) %}



Monday, June 20, 2011
V w
                        <section id="conferences">
                          <h1><%= I18n.t(:conference_list)%></h1>
                          <%= render @conferences %>
                        </section>

                        <article class="conference">
                          <header>
                            <h1><%= conference.name %></h1>
                            <dl>
                              <!-- some stuff -->
                            </dl>
                          </header>
                          <p><%= conference.description %></p>
                          <footer>
                            <menu>
                              <li><%= link_to I18n.t(:view_the_sessions ),
                                   conference_sessions_path(conference)%></li>
                              <!-- other links -->
                            </menu>
                          </footer>
                        </article>


Monday, June 20, 2011
V w
                        • ERb
                        • HTML 5
                        • CoffeScript
                        • SASS




Monday, June 20, 2011
T

Monday, June 20, 2011
Monday, June 20, 2011
Any Questions ????


Monday, June 20, 2011
S         ,
                            f r

                                                   alessandro.cinelli@gmail.com /@cirpo
                                      sandro.paganotti@wavegroup.it /@sandropaganotti
                                          alberto.barrila@wavegroup.it /@albertobarrila




Monday, June 20, 2011

Weitere ähnliche Inhalte

Ähnlich wie Symfony2 and Ror3 friends for an hour

So, you think you know widgets.
So, you think you know widgets.So, you think you know widgets.
So, you think you know widgets.danielericlee
 
Rendering Views in JavaScript - "The New Web Architecture"
Rendering Views in JavaScript - "The New Web Architecture"Rendering Views in JavaScript - "The New Web Architecture"
Rendering Views in JavaScript - "The New Web Architecture"Jonathan Julian
 
In the land of the blind the squinter rules
In the land of the blind the squinter rulesIn the land of the blind the squinter rules
In the land of the blind the squinter ruleswremes
 
Intro drupal security
Intro drupal securityIntro drupal security
Intro drupal securityknaddison
 
世界標準ウェブツール WordPress と そのコミュニティーの魅力
世界標準ウェブツール  WordPress と そのコミュニティーの魅力世界標準ウェブツール  WordPress と そのコミュニティーの魅力
世界標準ウェブツール WordPress と そのコミュニティーの魅力Naoko Takano
 
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
Graduating to Jenkins CI for Ruby(-on-Rails) TeamsGraduating to Jenkins CI for Ruby(-on-Rails) Teams
Graduating to Jenkins CI for Ruby(-on-Rails) TeamsDaniel Doubrovkine
 
Volto: Plone Conference 2018
Volto: Plone Conference 2018Volto: Plone Conference 2018
Volto: Plone Conference 2018Rob Gietema
 
Seattle OpenStack Meetup
Seattle OpenStack MeetupSeattle OpenStack Meetup
Seattle OpenStack MeetupMatt Ray
 
Making feature specs fun again
Making feature specs fun againMaking feature specs fun again
Making feature specs fun againPhillip Oertel
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developersGarann Means
 
The Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebThe Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebJeff Carouth
 
Behavior Driven Development and Wordpress Plugins
Behavior Driven Development and Wordpress PluginsBehavior Driven Development and Wordpress Plugins
Behavior Driven Development and Wordpress Pluginsdjcp
 
Let's begin Behavior Driven Development using RSpec
Let's begin Behavior Driven Development using RSpecLet's begin Behavior Driven Development using RSpec
Let's begin Behavior Driven Development using RSpecKenta Murata
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMashleypuls
 
Advanced #6 clean architecture
Advanced #6  clean architectureAdvanced #6  clean architecture
Advanced #6 clean architectureVitali Pekelis
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterHaehnchen
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forwardeug3n_cojocaru
 
12 hours to rate a rails application
12 hours to rate a rails application12 hours to rate a rails application
12 hours to rate a rails applicationehuard
 

Ähnlich wie Symfony2 and Ror3 friends for an hour (19)

So, you think you know widgets.
So, you think you know widgets.So, you think you know widgets.
So, you think you know widgets.
 
Rendering Views in JavaScript - "The New Web Architecture"
Rendering Views in JavaScript - "The New Web Architecture"Rendering Views in JavaScript - "The New Web Architecture"
Rendering Views in JavaScript - "The New Web Architecture"
 
In the land of the blind the squinter rules
In the land of the blind the squinter rulesIn the land of the blind the squinter rules
In the land of the blind the squinter rules
 
Intro drupal security
Intro drupal securityIntro drupal security
Intro drupal security
 
世界標準ウェブツール WordPress と そのコミュニティーの魅力
世界標準ウェブツール  WordPress と そのコミュニティーの魅力世界標準ウェブツール  WordPress と そのコミュニティーの魅力
世界標準ウェブツール WordPress と そのコミュニティーの魅力
 
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
Graduating to Jenkins CI for Ruby(-on-Rails) TeamsGraduating to Jenkins CI for Ruby(-on-Rails) Teams
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
 
Volto: Plone Conference 2018
Volto: Plone Conference 2018Volto: Plone Conference 2018
Volto: Plone Conference 2018
 
Seattle OpenStack Meetup
Seattle OpenStack MeetupSeattle OpenStack Meetup
Seattle OpenStack Meetup
 
Making feature specs fun again
Making feature specs fun againMaking feature specs fun again
Making feature specs fun again
 
node.js for front-end developers
node.js for front-end developersnode.js for front-end developers
node.js for front-end developers
 
The Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebThe Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile Web
 
Behavior Driven Development and Wordpress Plugins
Behavior Driven Development and Wordpress PluginsBehavior Driven Development and Wordpress Plugins
Behavior Driven Development and Wordpress Plugins
 
Let's begin Behavior Driven Development using RSpec
Let's begin Behavior Driven Development using RSpecLet's begin Behavior Driven Development using RSpec
Let's begin Behavior Driven Development using RSpec
 
Bytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASMBytecode manipulation with Javassist and ASM
Bytecode manipulation with Javassist and ASM
 
Advanced #6 clean architecture
Advanced #6  clean architectureAdvanced #6  clean architecture
Advanced #6 clean architecture
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
Anarchist guide to titanium ui
Anarchist guide to titanium uiAnarchist guide to titanium ui
Anarchist guide to titanium ui
 
12 hours to rate a rails application
12 hours to rate a rails application12 hours to rate a rails application
12 hours to rate a rails application
 

Mehr von Alessandro Cinelli (cirpo)

PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolAlessandro Cinelli (cirpo)
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageAlessandro Cinelli (cirpo)
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolAlessandro Cinelli (cirpo)
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolAlessandro Cinelli (cirpo)
 
Don't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisDon't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisAlessandro Cinelli (cirpo)
 
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...Alessandro Cinelli (cirpo)
 

Mehr von Alessandro Cinelli (cirpo) (12)

Dear JavaScript
Dear JavaScriptDear JavaScript
Dear JavaScript
 
The evolution of asynchronous JavaScript
The evolution of asynchronous JavaScriptThe evolution of asynchronous JavaScript
The evolution of asynchronous JavaScript
 
The journey to become a solid developer
The journey to become a solid developer The journey to become a solid developer
The journey to become a solid developer
 
The evolution of asynchronous javascript
The evolution of asynchronous javascriptThe evolution of asynchronous javascript
The evolution of asynchronous javascript
 
PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the fool
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the fool
 
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
 
Don't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apisDon't screw it up: how to build durable web apis
Don't screw it up: how to build durable web apis
 
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...
AgileTour Brescia - Metodi Agili: lavorare in modo sostenibile e vincente in ...
 
Presentazione framework Symfony
Presentazione framework Symfony Presentazione framework Symfony
Presentazione framework Symfony
 

Kürzlich hochgeladen

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...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 MenDelhi Call girls
 
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...Neo4j
 
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 educationjfdjdjcjdnsjd
 
[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.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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 Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Kürzlich hochgeladen (20)

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...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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...
 
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
 
[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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Symfony2 and Ror3 friends for an hour

  • 1. S f 2 & R R3 Fr f r r Monday, June 20, 2011
  • 2. A r C S r P A b r B rr à Monday, June 20, 2011
  • 3. Brescia - 24 settembre 2011 Monday, June 20, 2011
  • 4. Why this speech? W p ? Agenda A Join the f***ing J f*** f cooonf Monday, June 20, 2011
  • 5. come utente anonimo voglio poter vedere l'elenco delle conferenze ordinate per data decrescente come ua e ur voglio poter vedere l'elenco delle presentazioni di una conferenza ordinate in data crescente come ua e ur voglio porer vedere il dettaglio di una presenzatione come ua voglio potermi registrare come ur voglio poter aderire ad una conferenza come ur voglio poter commentare una conferenza come ur voglio poter commentare una presentazione Monday, June 20, 2011
  • 6. http://joinconf.heroku.com https://github.com/cirpo/joinconf https://github.com/sandropaganoti/joinconf only Firefox 4 and Chrome 10+ Monday, June 20, 2011
  • 7. R R3 • Thank you Trygve Reenskaug • Thank you Matz • Thank you DHH Monday, June 20, 2011
  • 8. R b R Ar r rack stack middleware 1 web server ... middleware N View response request run Joinconf::Application.routes ActionController MiddlewareStack Model Controller.new.process(action) Monday, June 20, 2011
  • 9. S f 2 • Thank you RoR • Thank you Fabien • Thank you Doctrine • Thank you Spring • Thank you Cocoa Monday, June 20, 2011
  • 10. S f 2 Ar r DI View request Kernel Event Dispatcher response Bundle* Model Monday, June 20, 2011
  • 11. S • Rack • Event Driven Monday, June 20, 2011
  • 12. <services> <service id="fos_user.controller.user" class="%fos_user.controller.user.class%"> <call method="setContainer"> <argument type="service" id="service_container" /> </call> <tag name="security.secure_service" /> </service> <service id="fos_user.controller.security" class="%fos_user.controller.security.class%"> <call method="setContainer"> <argument type="service" id="service_container" /> </call> </service> </services> Monday, June 20, 2011
  • 13. services: ideato.joinconf.admin.talk: class: IdeatoDunlopBundleAdminNewsAdmin tags: - { name: sonata.admin, manager_type: orm, group: Donlup News, label: News } arguments: [null, IdeatoDunlopBundleEntityNews, IdeatoDunlopBundle:NewsAdmin] Monday, June 20, 2011
  • 14. namespace IdeatoJoinConfBundleDataFixtruesORM; use DoctrineCommonDataFixturesFixtureInterface; use SymfonyComponentDependencyInjectionContainerInterface; use SymfonyComponentDependencyInjectionContainerAwareInterface; class UserFixtures implements FixtureInterface, ContainerAwareInterface { private $container; public function setContainer(ContainerInterface $container = null) { $this->container = $container; } public function load($manager) { $creator = $this->container->get('fos_user.user_creator'); $creator->create("Ideato", "Ideato", "alessandro.cinelli@gmail.com", false, true); $creator->create("odracci", "odracci", "odracci@gmail.com", false, true); $creator->create("alberto.barrila", "suka", "alberto.barilla@gmail.com", false, true); $creator->create("sandro.paganotti", "suka", "sandro.paganotti@gmail.com", false, true); Monday, June 20, 2011
  • 15. S f e.g.: SymfonyComponentHttpKernel Stack onCoreRequest onCoreException onCoreView onCoreController onCoreResponse Monday, June 20, 2011
  • 16. R always tell your mama before you go off somewhere! Monday, June 20, 2011
  • 17. R resources :conferences do resources :comments resources :sessions do resources :comments end resources :attendees end Monday, June 20, 2011
  • 18. Symfony _welcome: pattern: / defaults: { _controller: 'IdeatoJoinConfBundle:Homepage:index' } conference: pattern: /conference/{slug} defaults: { _controller: 'IdeatoJoinConfBundle:Blog:show', slug: 1 } requirements: page: d+ Monday, June 20, 2011
  • 19. M r • Routes to Rack and Engines • Bundles Monday, June 20, 2011
  • 20. C r r class ConferencesController < ApplicationController def index @conferences = Conference.all respond_with @conferences end def show @conference = Conference.find(params[:id]) end end Monday, June 20, 2011
  • 21. C r r • Function • Object method • Closure Monday, June 20, 2011
  • 22. C r r namespace IdeatoJoinConfBundleController; use IdeatoJoinConfBundleEntityConference; use SymfonyBundleFrameworkBundleControllerController; class HomepageController extends Controller { public function indexAction() { $conference_repository = $this->get('doctrine.orm.entity_manager') ->getRepository('IdeatoJoinConfBundle:Conference'); $conferences = $conference_repository ->retrieveConferencesByAscendingOrder(); return $this->render ( ('IdeatoJoinConfBundle:Default:index.html.twig', array('conferences' => $conferences)); Monday, June 20, 2011
  • 23. M • Doctrine 2 • POPO • DataMapper • ODM Monday, June 20, 2011
  • 24. M namespace IdeatoJoinConfBundleEntity; /** * @orm:Entity(repositoryClass="IdeatoJoinConfBundleRepositories ConferenceRepository") */ class Conference { /** * @orm:Id * @orm:Column(type="integer") * @orm:GeneratedValue(strategy="AUTO") */ private $id; /** * @orm:Column(type="string", length="255") */ private $title; /** * @orm:Column(type="datetime") */ private $date; Monday, June 20, 2011
  • 25. M namespace IdeatpJoinConfBundleEntity; /** * @orm:Entity(repositoryClass="CirpoJoinConfBundleRepositories SessionRepository") */ class Talk { /** * @orm:Id * @orm:Column(type="integer") * @orm:GeneratedValue(strategy="AUTO") */ private $id; /** * @orm:Column(type="string", length="255") */ private $title; /** * @ORMOneToMany(targetEntity="User", mappedBy="talk") */ private $speakers; Monday, June 20, 2011
  • 26. M class Conference < ActiveRecord::Base validates :name, :start, :end, :users_max, :location, :presence => true default_scope :order => "start DESC" has_many :sessions has_many :attendees has_many :comments, :as => :commentable end Monday, June 20, 2011
  • 27. M • ActiveModel • Arel • ActiveResource Monday, June 20, 2011
  • 28. V w • Twig • Plain PHP • Assetic Monday, June 20, 2011
  • 29. {% if loop.index is not divisibleby(3) %} View {{ post.published_at|date("m/d/Y") }} {{ "I like %this% and %that%."|replace({'%this %': foo, '%that%': "bar"}) }} {{ var.foo|default('foo item on var is not defined') }} {{ var is even }} {{ var is odd }} {% if foo.attribute is sameas(false) %} {% for i in range(0, 3) %} Monday, June 20, 2011
  • 30. V w <section id="conferences"> <h1><%= I18n.t(:conference_list)%></h1> <%= render @conferences %> </section> <article class="conference"> <header> <h1><%= conference.name %></h1> <dl> <!-- some stuff --> </dl> </header> <p><%= conference.description %></p> <footer> <menu> <li><%= link_to I18n.t(:view_the_sessions ), conference_sessions_path(conference)%></li> <!-- other links --> </menu> </footer> </article> Monday, June 20, 2011
  • 31. V w • ERb • HTML 5 • CoffeScript • SASS Monday, June 20, 2011
  • 34. Any Questions ???? Monday, June 20, 2011
  • 35. S , f r alessandro.cinelli@gmail.com /@cirpo sandro.paganotti@wavegroup.it /@sandropaganotti alberto.barrila@wavegroup.it /@albertobarrila Monday, June 20, 2011