SlideShare une entreprise Scribd logo

Spring<xml> est mort, Vive Spring NoXML @ ParisJUG

Gildas Cuisinier
Gildas Cuisinier
Gildas CuisinierConsultant à Luxembourg

Spring<xml> est mort, Vive Spring NoXML @ ParisJUG

1  sur  66
Télécharger pour lire hors ligne
Spring<XML> est mort
 Vive Spring NoXML
      par Gildas Cuisinier
          @gcuisinier
whois(@gcuisinier)
Maître Artisan Développeur, Sfeir Benelux

    Initiateur de la section Spring de
              @Developpez.com

 Relecteur de plusieurs livres sur Spring

Evangéliste Spring ( JUGs, Devoxx France )
Spring ?
Spring ?




              es
            nc
          da
        en




                              AO
         ép




                                P
       ed
     nd
  tio
 ec
Inj




          Abstraction de services
Retour en 2004
Retour en 2004
Publicité

Recommandé

Contenu connexe

Dernier

OTel Orientation_ How to Train Teams (OTel in Practice).pdf
OTel Orientation_ How to Train Teams (OTel in Practice).pdfOTel Orientation_ How to Train Teams (OTel in Practice).pdf
OTel Orientation_ How to Train Teams (OTel in Practice).pdfPaige Cruz
 
Artificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfArtificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfIsidro Navarro
 
Heltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfHeltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfMarielaL5
 
Bluetooth Low Energy(BLE) and beacons working
Bluetooth Low Energy(BLE) and beacons workingBluetooth Low Energy(BLE) and beacons working
Bluetooth Low Energy(BLE) and beacons workingshrey Ansh
 
Semiconductor Review Magazine Feature.pdf
Semiconductor Review Magazine Feature.pdfSemiconductor Review Magazine Feature.pdf
Semiconductor Review Magazine Feature.pdfkeyaramicrochipusa
 
AWS reInvent 2023 recaps from Chicago AWS user group
AWS reInvent 2023 recaps from Chicago AWS user groupAWS reInvent 2023 recaps from Chicago AWS user group
AWS reInvent 2023 recaps from Chicago AWS user groupAWS Chicago
 
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptx
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptxEvolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptx
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptxKyle Willson
 
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Adrian Sanabria
 
Breaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologyBreaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologySafe Software
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxBrandon Minnick, MBA
 
M.Aathiraju Self Intro.docx-AD21001_____
M.Aathiraju Self Intro.docx-AD21001_____M.Aathiraju Self Intro.docx-AD21001_____
M.Aathiraju Self Intro.docx-AD21001_____Aathiraju
 
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...Memory Fabric Forum
 
Bit N Build Poland
Bit N Build PolandBit N Build Poland
Bit N Build PolandGDSC PJATK
 
Manual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveManual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveDomotica daVinci
 
Q1 Memory Fabric Forum: SMART CXL Product Lineup
Q1 Memory Fabric Forum: SMART CXL Product LineupQ1 Memory Fabric Forum: SMART CXL Product Lineup
Q1 Memory Fabric Forum: SMART CXL Product LineupMemory Fabric Forum
 
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-CManual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-CDomotica daVinci
 
My self introduction to know others abut me
My self  introduction to know others abut meMy self  introduction to know others abut me
My self introduction to know others abut meManoj Prabakar B
 
H3 Platform CXL Solution_Memory Fabric Forum.pptx
H3 Platform CXL Solution_Memory Fabric Forum.pptxH3 Platform CXL Solution_Memory Fabric Forum.pptx
H3 Platform CXL Solution_Memory Fabric Forum.pptxMemory Fabric Forum
 
Automate Your Master Data Processes for Shared Service Center Excellence
Automate Your Master Data Processes for Shared Service Center ExcellenceAutomate Your Master Data Processes for Shared Service Center Excellence
Automate Your Master Data Processes for Shared Service Center ExcellencePrecisely
 

Dernier (20)

OTel Orientation_ How to Train Teams (OTel in Practice).pdf
OTel Orientation_ How to Train Teams (OTel in Practice).pdfOTel Orientation_ How to Train Teams (OTel in Practice).pdf
OTel Orientation_ How to Train Teams (OTel in Practice).pdf
 
Artificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfArtificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdf
 
Heltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfHeltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdf
 
Bluetooth Low Energy(BLE) and beacons working
Bluetooth Low Energy(BLE) and beacons workingBluetooth Low Energy(BLE) and beacons working
Bluetooth Low Energy(BLE) and beacons working
 
Semiconductor Review Magazine Feature.pdf
Semiconductor Review Magazine Feature.pdfSemiconductor Review Magazine Feature.pdf
Semiconductor Review Magazine Feature.pdf
 
AWS reInvent 2023 recaps from Chicago AWS user group
AWS reInvent 2023 recaps from Chicago AWS user groupAWS reInvent 2023 recaps from Chicago AWS user group
AWS reInvent 2023 recaps from Chicago AWS user group
 
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptx
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptxEvolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptx
Evolution of Chatbots: From Custom AI Chatbots and AI Chatbots for Websites.pptx
 
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
Early Tech Adoption: Foolish or Pragmatic? - 17th ISACA South Florida WOW Con...
 
Breaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI TechnologyBreaking Barriers & Leveraging the Latest Developments in AI Technology
Breaking Barriers & Leveraging the Latest Developments in AI Technology
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptx
 
M.Aathiraju Self Intro.docx-AD21001_____
M.Aathiraju Self Intro.docx-AD21001_____M.Aathiraju Self Intro.docx-AD21001_____
M.Aathiraju Self Intro.docx-AD21001_____
 
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...
Q1 Memory Fabric Forum: Advantages of Optical CXL​ for Disaggregated Compute ...
 
Bit N Build Poland
Bit N Build PolandBit N Build Poland
Bit N Build Poland
 
Manual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveManual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-Wave
 
COE AI Lab Universities
COE AI Lab UniversitiesCOE AI Lab Universities
COE AI Lab Universities
 
Q1 Memory Fabric Forum: SMART CXL Product Lineup
Q1 Memory Fabric Forum: SMART CXL Product LineupQ1 Memory Fabric Forum: SMART CXL Product Lineup
Q1 Memory Fabric Forum: SMART CXL Product Lineup
 
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-CManual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
 
My self introduction to know others abut me
My self  introduction to know others abut meMy self  introduction to know others abut me
My self introduction to know others abut me
 
H3 Platform CXL Solution_Memory Fabric Forum.pptx
H3 Platform CXL Solution_Memory Fabric Forum.pptxH3 Platform CXL Solution_Memory Fabric Forum.pptx
H3 Platform CXL Solution_Memory Fabric Forum.pptx
 
Automate Your Master Data Processes for Shared Service Center Excellence
Automate Your Master Data Processes for Shared Service Center ExcellenceAutomate Your Master Data Processes for Shared Service Center Excellence
Automate Your Master Data Processes for Shared Service Center Excellence
 

En vedette

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

En vedette (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Spring&amp;lt;xml&gt; est mort, Vive Spring NoXML @ ParisJUG

  • 1. Spring<XML> est mort Vive Spring NoXML par Gildas Cuisinier @gcuisinier
  • 2. whois(@gcuisinier) Maître Artisan Développeur, Sfeir Benelux Initiateur de la section Spring de @Developpez.com Relecteur de plusieurs livres sur Spring Evangéliste Spring ( JUGs, Devoxx France )
  • 4. Spring ? es nc da en AO ép P ed nd tio ec Inj Abstraction de services
  • 8. Spring 1.0 1 <bean id="monBean" class="be.hikage.service.MyService"> 2 <property name="version" value="maVersion"/> 3 </bean> 4 5 <bean />
  • 9. Spring 1.0 1 <bean id="monBean" class="be.hikage.service.MyService"> 2 <property name="version" value="maVersion"/> 3 </bean> 4 5 <bean /> 6 <bean /> 7 <bean /> 8 <bean /> 9 <bean /> 10 <bean />
  • 11. Spring 1.2 1 <bean id="monBean" class="be.hikage.service.MyService"> 2 <property name="version" value="maVersion"/> 3 </bean> 4
  • 12. Spring 1.2 1 <bean id="monBean" class="be.hikage.service.MyService"> 2 <property name="version" value="maVersion"/> 3 </bean> 4 5 <import resource="service-layer.xml"/> 6 <import resource="dao-layer.xml"/> 7 <import resource="disp-layer.xml"/>
  • 14. "> Proxy xy" lter Chain inPro il.Fi Sourc e "> filt erCha curi ty.ut ition an id =" g.ace gise Defin 1 <be s="or ation clas lter Invoc e="fi PARIS ON 2 ert y nam E_COM <prop ASE_B EFOR 3 lue> OWERC <v a _TO_L T_URL NT 4 C ONVER CHE_A P E_APA RN_TY 5 PATTE er nFilt n = nteg ratio 6 /logi textI essi onCon 7 httpS lter rm= ionFi in.fo egrat 8 /log xtInt Conte e ssion 9 httpS ter = onFil ts/** Inte grati 10 /asse ntext ess ionCo eck= 11 httpS ty_ch er, ecuri nFilt eg i_s nteg ratio 12 /j_ac textI er onCon gFilt essi Proc essin 13 httpS ation uth entic 14 formA er, nFilt nteg ratio 15 /**= textI essi onCon lter 16 httpS ionFi ra nslat tionT 17 excep ue> 18 < /v a l r"> 19 roper ty> lter" Filte </p ionFi tegr ation egrat extIn 20 n> onte xtInt ssio nCont </bea sionC ttpSe 1 tpSes y...H 2 id="h t curit <bean egise 22 ="o rg.ac class Point "> 23 t" lter Entry </bea n> yPoin ingFi 24 atio nEntr onPr ocess entic icati Logi nAuth ..Au thent "/> 25 "form rity. login n id= isecu ue="/ <bea .aceg mUrl" val 26 ="org inFor e"/> class og "fals me="l alue= 27 erty na ps" v <prop ceHtt name ="for 28 erty <prop 29 n> </bea 30
  • 15. Spring 2.0 1 <security:http auto-config="true"> 2 <security:intercept-url pattern="/login*" 3 access="IS_AUTHENTICATED_ANONYMOUSLY"/> 4 <security:intercept-url pattern="/logoutSuccess*" 5 access="IS_AUTHENTICATED_ANONYMOUSLY"/> 6 <security:intercept-url pattern="/css/main.css" 7 access="IS_AUTHENTICATED_ANONYMOUSLY"/> 8 <security:intercept-url pattern="/**" 9 access="ROLE_USER"/> 10 11 <security:form-login login-page="/login.html" 12 login-processing-url="/loginProcess" 13 default-target-url="/index.jsp" 14 <security:logout logout-url="/logout" 15 logout-success-url="/logoutSuccess.html"/> 16 </security:http>
  • 16. Spring 2.5 1 @Controller 2 public class MyController { 3 4 private MyService myService; 5 6 @Autowired 7 public void setMyService(MyService myService) { 8 this.myService = myService; 9 } 10 11 }
  • 17. Spring 2.5 1 @Controller 2 public class MyController { 3 4 private MyService myService; 5 6 @Autowired 7 public void setMyService(MyService myService) { 8 this.myService = myService; 9 } 10 11 } 1 <context:component-scan base-package="be.hikage" />
  • 18. Spring 3.0 1 @Configuration 2 public class ApplicationConfig { 3 4 @Bean 5 public MyService myService() { 6 return new MyService(); 7 } 8 9 }
  • 19. Spring 3.0 1 @Configuration // <beans> 2 public class ApplicationConfig { 3 4 @Bean //<bean id="myService> 5 public MyService myService() { 6 return new MyService(); 7 } 8 9 }
  • 20. Spring 3.0 1 @Configuration // <beans> 2 public class ApplicationConfig { 3 4 @Bean //<bean id="myService> 5 public MyService myService() { 6 return new MyService(); 7 } 8 9 } 1 ApplicationContext factory = 2 new AnnotationConfigApplicationContext(ApplicationConfig.class)
  • 21. Spring 3.0 1 @Component 2 public class MyTask { 3 4 @Scheduled(cron="* * * * *") 5 public void execute() { 6 // code 7 } 8 9 }
  • 22. Spring 3.0 1 @Component 2 public class MyTask { 3 4 @Scheduled(cron="* * * * *") 5 public void execute() { 6 // code 7 } 8 9 } 1 <context:component-scan base-package="be.hikage" /> 2 <task:annotation-driven scheduler="myScheduler" .. />
  • 23. Spring 3.0 1 @Component 2 public class MyTask { 3 4 @Scheduled(cron="* * * * *") 5 public void execute() { 6 // code 7 } 8 9 } 1 <context:component-scan base-package="be.hikage" /> 2 <task:annotation-driven scheduler="myScheduler" .. />
  • 25. @ComponentScan 1 <context:component-scan base-package="be.hikage"/> 1 @Configuration 2 @ComponentScan("be.hikage") 3 public class ApplicationConfig
  • 26. @ComponentScan 1 <context:component-scan base-package="be.hikage"/> 1 @Configuration 2 @ComponentScan("be.hikage") 3 public class ApplicationConfig
  • 27. @EnableScheduling 1 public class MaTache { 2 3 @Scheduled(fixedRate = 1000) 4 public void execute() { 5 System.out.println("Maman, je parle au ParisJUG"); 6 } 7 }
  • 29. @EnableScheduling 1 <task:annotation-driven /> 1 @Configuration 2 @EnableScheduling 3 public class ApplicationConfig { 4 }
  • 30. @EnableScheduling 1 @Target(ElementType.TYPE) 2 @Retention(RetentionPolicy.RUNTIME) 3 @Import(SchedulingConfiguration.class) 4 @Documented 5 public @interface EnableScheduling { 6 7 }
  • 31. @EnableScheduling 1 @Configuration 2 public class SchedulingConfiguration { 3 4 @Bean(name=AnnotationConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME) 5 @Role(BeanDefinition.ROLE_INFRASTRUCTURE) 6 public ScheduledAnnotationBeanPostProcessor scheduledAnnotationProcessor() { 7 return new ScheduledAnnotationBeanPostProcessor(); 8 } 9 10 }
  • 32. @EnableCaching 1 @Service 2 public class CalculateurPrix { 3 4 @Cacheable(value = "price") 5 public Double calculePrix(String reference){ 6 // calcul long et complexe 7 return 42L; 8 } 9 10 11 12 13 14 }
  • 33. @EnableCaching 1 @Service 2 public class CalculateurPrix { 3 4 @Cacheable(value = "price") 5 public Double calculePrix(String reference){ 6 // calcul long et complexe 7 return 42L; 8 } 9 10 @CacheEvict(value = "price",allEntries = true) 11 public void setRistourne(Float indice){ 12 13 } 14 }
  • 34. @EnableCaching 1 <caching:annotation-driven /> 2 3 <bean class="org.springframework.cache .concurrent.ConcurrentMapCacheManager"/> 4
  • 35. @EnableCaching 1 @Configuration 2 @EnableCaching 3 public class ApplicationConfig { 4 5 @Bean 6 CacheManager cacheManager(){ 7 return 8 new ConcurrentMapCacheManager(); 9 } 10 }
  • 36. Abstraction de Cache Out of the Box ConcurrentHashMap EhCache GemFire JCache (Spring 3.2/3.3)
  • 38. @EnableWebMvc 1 <mvc:annotation-driven /> 1 @Configuration 2 @EnableWebMvc 3 public class WebConfig { 4 }
  • 39. @EnableWebMvc 1 <mvc:annotation-driven/> 2 <mvc:interceptors> 3 <bean class="osf..LocaleChangeInterceptor"/> 4 </mvc:interceptors>
  • 40. @EnableWebMvc + WebMvcConfigurerAdapter 1 @Configuration 2 @EnableWebMvc 3 public class WebConfig 4 extends WebMvcConfigurerAdapter{ 5 6 @Override 7 public void addInterceptors(InterceptorRegistry registry) { 8 registry.addInterceptor(new LocaleChangeInterceptor()); 9 } 10 }
  • 44. @EnableWebMvc Ajout Intercepteur Configuration de ViewController Ajout de ResourceHandler
  • 45. @EnableWebMvc Ajout Intercepteur Configuration de ViewController Ajout de ResourceHandler
  • 46. @EnableWebMvc Ajout Intercepteur Configuration de ViewController Ajout de ResourceHandler Ne permet pas une configuration fine
  • 47. @EnableWebMvc Ajout Intercepteur Configuration de ViewController Ajout de ResourceHandler Ne permet pas une configuration fine ➡ @EnableWebMvc et étendre WebMvcConfigurationSupport
  • 50. Testing 2.5 1 @RunWith(SpringJUnit4ClassRunner.class) 2 @ContextConfiguration("test-config.xml") 3 public class MyTest { 4 @Autowired 5 MyService service; 6 7 @Test 8 public void myTest(){ 9 } 10 }
  • 51. Testing 3.1 1 @RunWith(SpringJUnit4ClassRunner.class) 2 @ContextConfiguration(classes = TestConfig.class) 3 @ActiveProfiles("test") 4 public class MyTest { 5 @Autowired 6 MyService service; 7 8 @Test 9 public void myTest(){ 10 } 11 }
  • 52. Servlet 3.0 1 public class WebInitializer implements WebApplicationInitializer { 2 3 @Override 4 public void onStartup(ServletContext servletContext) throws ServletException { 5 6 AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); 7 context.register(WebMvcConfig.class); 8 9 ServletRegistration.Dynamic servletConfig = servletContext.addServlet("dispatcher", new DispatcherServlet(context)); 10 servletConfig.setLoadOnStartup(1); 11 servletConfig.addMapping("*.do"); 12
  • 53. DEMO
  • 55. @Profile 1 @Configuration 2 public class ApplicationConfig { 3 4 @Bean 5 DataSource dataSource(){ 6 JndiObjectFactoryBean result = new JndiObjectFactoryBean(); 7 result.setJndiName("jdbc/dataSource"); 8 return (DataSource) result.getObject(); 9 } 10 }
  • 56. <Profile /> 1 <beans profile="dev"> 2 <jdbc:embedded-database id="dataSource"> 3 <jdbc:script location="schema.sql"/> 4 <jdbc:script location="test-data.sql"/> 5 </jdbc:embedded-database> 6 </beans>
  • 57. Activation 1 <webapp> 2 <context-param> 3 <param-name>spring.profiles.active</param-name> 4 <param-value>dev</param-value> 5 </context-param> 6 </webapp>
  • 58. Activation 1 <servlet> 2 <servlet-name>dispatcher</servlet-name> 3 <servlet-class>osf.web.servlet.DispatcherServlet</servlet-class> 4 <init-param> 5 <param-name>spring.profiles.active</param-name> 6 <param-value>dev</param-value> 7 </init-param> 8 </servlet>
  • 59. Spring 3.1, c’est aussi Support Hibernate 4 Namespace c: JPA sans Persistence.xml ...
  • 61. Spring 3.2 Spring 3.2 RC1 - Release début Novembre Principalement des améliorations de l’existant Support des contrôleurs asynchrones dans WebMVC Amélioration du testing (REST, MVC) Release prévue pour le 12/12/12 ;-) Spring 3.3 JEE 7 : JPA 2.1, Bean Validation 1.1, JMS 2
  • 63. Spring en 2003 Framework
  • 64. Spring en 2012 Batch SpringData SpringMobile Framework Integration Security Flex SpringAndroid SpringSocial

Notes de l'éditeur

  1. \n
  2. \n
  3. Comment d&amp;#xE9;finir Spring ?\n\nSpring est un conteneur, qui fournit 3 fonctionnalit&amp;#xE9;s principales\n* Injection, IoC, gestion du cycle de vie des objets\n* AOP, permettant de s&amp;#xE9;parer les fonctionnalit&amp;#xE9;s transversales\n* Abstraction permettant de simplifier l&amp;#x2019;utiliser de biblioth&amp;#xE8;que tierce ( JMS, JDBC, Hibernate) en proposant des unifirmisations d&amp;#x2019;exception, .. \n
  4. Comment d&amp;#xE9;finir Spring ?\n\nSpring est un conteneur, qui fournit 3 fonctionnalit&amp;#xE9;s principales\n* Injection, IoC, gestion du cycle de vie des objets\n* AOP, permettant de s&amp;#xE9;parer les fonctionnalit&amp;#xE9;s transversales\n* Abstraction permettant de simplifier l&amp;#x2019;utiliser de biblioth&amp;#xE8;que tierce ( JMS, JDBC, Hibernate) en proposant des unifirmisations d&amp;#x2019;exception, .. \n
  5. Comment d&amp;#xE9;finir Spring ?\n\nSpring est un conteneur, qui fournit 3 fonctionnalit&amp;#xE9;s principales\n* Injection, IoC, gestion du cycle de vie des objets\n* AOP, permettant de s&amp;#xE9;parer les fonctionnalit&amp;#xE9;s transversales\n* Abstraction permettant de simplifier l&amp;#x2019;utiliser de biblioth&amp;#xE8;que tierce ( JMS, JDBC, Hibernate) en proposant des unifirmisations d&amp;#x2019;exception, .. \n
  6. Comment d&amp;#xE9;finir Spring ?\n\nSpring est un conteneur, qui fournit 3 fonctionnalit&amp;#xE9;s principales\n* Injection, IoC, gestion du cycle de vie des objets\n* AOP, permettant de s&amp;#xE9;parer les fonctionnalit&amp;#xE9;s transversales\n* Abstraction permettant de simplifier l&amp;#x2019;utiliser de biblioth&amp;#xE8;que tierce ( JMS, JDBC, Hibernate) en proposant des unifirmisations d&amp;#x2019;exception, .. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. Ce fut &amp;#xE9;galement l&amp;#x2019;un des premiers framework &amp;#xE0; utiliser les annotations\n
  27. \n
  28. Permet de r&amp;#xE9;duire le XML, simplifie la compr&amp;#xE9;hension ..\nMais est nettement plus obscure .. Qu&amp;#x2019;est-ce qui se cache derri&amp;#xE8;re\n
  29. @Component / @Service / @Controller\n@RequestMapping\n@AutoWired\n
  30. Configuration en Java\n--&gt; Meilleur refactoring\n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. Plus de clart&amp;#xE9; ( ALT+CLick dans IDE)\n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. @SlowService\n@CachePut\n@Caching(@CacheEvict(&amp;#xAB;primary&amp;#xBB;), @CacheEvict(&amp;#xAB;secondary&amp;#xBB;, &amp;#xAB;otherkey&amp;#xBB;))\n\n
  46. \n
  47. \n
  48. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  49. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  50. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  51. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  52. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  53. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  54. Etendre de WebMvcConfigurer et overrider les m&amp;#xE9;thodes n&amp;#xE9;cessaires\n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. WebApplicationInitializer vs ServletContainerInitializer\n\n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n