SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
S PRINGING INTO ACTION
W HAT         IS    S PRING ?

   Spring is an open source framework, created by
    Rod Johnson and described in his book Expert
    One-on-One: J2EE Design and Development

   Spring does many things, but when you strip it
    down to its base parts, Spring is a lightweight
    dependency injection and aspect-oriented
    container and framework
W HAT           IS    S PRING ?

   Lightweight
       Spring is lightweight in terms of both size and overhead.

   Dependency Injection
       Spring promotes loose coupling through a technique
        known as dependency injection (DI).

   Aspect-oriented
       Spring comes with rich support for aspect-oriented
        programming (AOP)
W HAT           IS    S PRING ?

   Container
       Spring is a container in the sense that it contains
        and manages the lifecycle and configuration of
        application objects

   Framework
       Spring makes it possible to configure and
        compose complex applications from simpler
        components. In Spring, application objects are
        composed declaratively, typically in an XML file.
S PRING           MODULES

   You are free to choose the modules that suit your
    application and look to other options

   ll of Spring’s modules are built on top of the core
    container.
T HE      CORE CONTAINER

   Spring’s core container provides the fundamental
    functionality of the Spring Framework

   This module contains the BeanFactory

   which is the fundamental Spring container and the
    basis on which Spring’s DI is based.
A PPLICATION CONTEXT MODULE


     Spring’s application context builds on the core
      container.

     The core module’s BeanFactory makes Spring a
      container, but the context module is what makes
      it a framework.

     This module extends the concept of BeanFactory,
      adding support for internationalization (I18N)
      messages, application lifecycle events, and
      validation
S PRING ’ S AOP                 MODULE


   Spring provides rich support for aspect-oriented
    programming in its AOP module. This module
    serves as the basis for developing your own
    aspects for your Springenabled application. Like
    DI, AOP supports loose coupling of application
    objects. With AOP
JDBC ABSTRACTION AND
          THE DAO MODULE


   Working with JDBC often results in a lot of
    boilerplate code that gets a connection,creates a
    statement, processes a result set, and then
    closes the connection.Spring’s JDBC and Data
    Access Objects (DAO) module abstracts away the
    boilerplate code so that you can keep your
    database code clean and simple
O BJECT - RELATIONAL MAPPING
(ORM) INTEGRATION MODULE

    For those who prefer using an object-relational
     mapping (ORM) tool over straight JDBC, Spring
     provides the ORM module. Spring’s ORM support
     builds on the DAO support
J AVA M ANAGEMENT E XTENSIONS
                       (JMX)

      Exposing the inner workings of a Java application
       for management is a critical part of making an
       application production ready. Spring’s JMX odule
       makes it easy to expose your application’s beans
       as JMX MBeans. This makes it possible to
       monitor and reconfigure a running application.
T HE S PRING MVC               FRAMEWORK


        The Model/View/Controller (MVC) paradigm is a
         commonly accepted approach to building web
         applications such that the user interface is
         separate from the application logic. Java has no
         shortage of MVC frameworks, with Apache Struts,
         JSF, WebWork(Struts 2.0), and Tapestry among
         the most popular MVC choices.
J AVA M ESSAGE S ERVICE
                         (JMS)

   The downside to remoting is that it depends on
    network reliability and that both ends of the
    communication be available. Message-oriented
    communication, on the other hand, is more
    reliable and guarantees delivery of messages,
    even if the network and endpoints are unreliable.
A S PRING             JUMP START -1
   Dependency injection is the most basic thing that
    Spring does.

   Although it’s not necessary to hide the
    implementation behind an interface, it’s highly
    recommended as a way to separate the
    implementation from its contract
C ONFIGURING H ELLO W ORLD
                      IN S PRING
   The GreetingServiceImpl class has a single
    property: greeting

   The XML file in listing 1.3 declares an instance of
    a GreetingServiceImpl in the Spring container
    and configures its greeting property with a value
    of “Buenos Dias!” Let’s dig into the details of this
    XML file a bit to understand how it works
L AB 1-練習-1

   規劃一個一個sayHello Method合約規範的介面
    Igreeting interface
L AB 1-練習-2

   撰寫與實做Igreeting介面的Entity Class(Bean)

   sayHello() 要設定寫出去的資訊(Class必須設定
    存取子與封裝的欄位)
L AB 1-練習-3

   配置Spring bean config

   設定屬性(Property-setter and getter)內容
T HE H ELLO W ORLD MAIN
                                                CLASS
   The BeanFactory class used here is the Spring
    container. After loading the hello.xml file into the
    container
L AB 1-練習-3
   專案參考相關的JAR

   主程式撰寫
U NDERSTANDING
DEPENDENCY INJECTION (DI)


   DI is at the heart of the Spring Framework. It may
    sound a bit intimidating, conjuring up notions of
    a complex programming technique or design
    pattern.

   In fact, by applying DI in your projects, you’ll find
    that your code will become significantly simpler,
    easier to understand, and easier to test.
I NJECTING             DEPENDENCIES


   Originally, dependency injection was commonly
    referred to by another name: inversion of
    control(IoC)

   Any nontrivial application (pretty much anything
    more complex than HelloWorld.java) is made up
    of two or more classes that collaborate with each
    other to perform some business logic.
D EPENDENCY INJECTION
            IN ACTION

Mais conteúdo relacionado

Mais procurados

J2EE Architecture Explained
J2EE  Architecture ExplainedJ2EE  Architecture Explained
J2EE Architecture ExplainedAdarsh Kr Sinha
 
Jetspeed-2 Overview
Jetspeed-2 OverviewJetspeed-2 Overview
Jetspeed-2 Overviewbettlebrox
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.suranisaunak
 
Spring Tutorial for Beginners
Spring Tutorial for BeginnersSpring Tutorial for Beginners
Spring Tutorial for BeginnersJava2Blog
 
JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011Edward Burns
 
Building Enterprise Application with J2EE
Building Enterprise Application with J2EEBuilding Enterprise Application with J2EE
Building Enterprise Application with J2EECalance
 
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...Kalle
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Atit Patumvan
 
Spring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionSpring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionTomcy John
 
Introduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresIntroduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresAkash Badone
 
Silverlight difference faqs- 2
Silverlight difference faqs- 2Silverlight difference faqs- 2
Silverlight difference faqs- 2Umar Ali
 

Mais procurados (20)

J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
 
J2ee
J2eeJ2ee
J2ee
 
J2EE Architecture Explained
J2EE  Architecture ExplainedJ2EE  Architecture Explained
J2EE Architecture Explained
 
Jetspeed-2 Overview
Jetspeed-2 OverviewJetspeed-2 Overview
Jetspeed-2 Overview
 
Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.Introduction Java Web Framework and Web Server.
Introduction Java Web Framework and Web Server.
 
J2EE day 1
J2EE day 1J2EE day 1
J2EE day 1
 
Spring 2
Spring 2Spring 2
Spring 2
 
Spring Tutorial for Beginners
Spring Tutorial for BeginnersSpring Tutorial for Beginners
Spring Tutorial for Beginners
 
J2ee architecture
J2ee architectureJ2ee architecture
J2ee architecture
 
J2ee
J2eeJ2ee
J2ee
 
JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011
 
Building Enterprise Application with J2EE
Building Enterprise Application with J2EEBuilding Enterprise Application with J2EE
Building Enterprise Application with J2EE
 
Java J2EE
Java J2EEJava J2EE
Java J2EE
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...
Hennessey An Open Source Eye Gaze Interface Expanding The Adoption Of Eye Gaz...
 
J2ee seminar
J2ee seminarJ2ee seminar
J2ee seminar
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
 
Spring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionSpring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – Introduction
 
Introduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresIntroduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their features
 
Silverlight difference faqs- 2
Silverlight difference faqs- 2Silverlight difference faqs- 2
Silverlight difference faqs- 2
 

Destaque

Access Net Web Services From Java
Access  Net Web Services From JavaAccess  Net Web Services From Java
Access Net Web Services From JavaGuo Albert
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorialGuo Albert
 
Minicollge Webtypografie
Minicollge WebtypografieMinicollge Webtypografie
Minicollge Webtypografieremohollaar
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvcGuo Albert
 
This Presentation will Revolutionize News Feed E-commerce
This Presentation will Revolutionize News Feed E-commerceThis Presentation will Revolutionize News Feed E-commerce
This Presentation will Revolutionize News Feed E-commerceTommyismyname
 
Spring 2.x 中文
Spring 2.x 中文Spring 2.x 中文
Spring 2.x 中文Guo Albert
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practiceGuo Albert
 
Whoops! Where did my architecture go?
Whoops! Where did my architecture go?Whoops! Where did my architecture go?
Whoops! Where did my architecture go?Oliver Gierke
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Oliver Gierke
 
Spring in action - Hades & Spring Roo
Spring in action - Hades & Spring RooSpring in action - Hades & Spring Roo
Spring in action - Hades & Spring RooOliver Gierke
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring DataOliver Gierke
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 

Destaque (13)

Access Net Web Services From Java
Access  Net Web Services From JavaAccess  Net Web Services From Java
Access Net Web Services From Java
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorial
 
Minicollge Webtypografie
Minicollge WebtypografieMinicollge Webtypografie
Minicollge Webtypografie
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
This Presentation will Revolutionize News Feed E-commerce
This Presentation will Revolutionize News Feed E-commerceThis Presentation will Revolutionize News Feed E-commerce
This Presentation will Revolutionize News Feed E-commerce
 
Spring 2.x 中文
Spring 2.x 中文Spring 2.x 中文
Spring 2.x 中文
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practice
 
Whoops! Where did my architecture go?
Whoops! Where did my architecture go?Whoops! Where did my architecture go?
Whoops! Where did my architecture go?
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
 
Spring in action - Hades & Spring Roo
Spring in action - Hades & Spring RooSpring in action - Hades & Spring Roo
Spring in action - Hades & Spring Roo
 
eCommerce Cloud
eCommerce CloudeCommerce Cloud
eCommerce Cloud
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring Data
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 

Semelhante a Overview chap1

Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsVirtual Nuggets
 
Spring presentecion isil
Spring presentecion isilSpring presentecion isil
Spring presentecion isilWilly Aguirre
 
Spring presentecion isil
Spring presentecion isilSpring presentecion isil
Spring presentecion isilWilly Aguirre
 
TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFrameworkShankar Nair
 
Spring core module
Spring core moduleSpring core module
Spring core moduleRaj Tomar
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptxNourhanTarek23
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkDineesha Suraweera
 
Spring (1)
Spring (1)Spring (1)
Spring (1)Aneega
 
Spring framework
Spring frameworkSpring framework
Spring frameworkKani Selvam
 
Spring Basics
Spring BasicsSpring Basics
Spring BasicsEmprovise
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkASG
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malavRohit malav
 
Spring framework Introduction
Spring framework  IntroductionSpring framework  Introduction
Spring framework IntroductionAnuj Singh Rajput
 

Semelhante a Overview chap1 (20)

Spring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggetsSpring Framework Tutorial | VirtualNuggets
Spring Framework Tutorial | VirtualNuggets
 
Spring
SpringSpring
Spring
 
Spring presentecion isil
Spring presentecion isilSpring presentecion isil
Spring presentecion isil
 
Spring presentecion isil
Spring presentecion isilSpring presentecion isil
Spring presentecion isil
 
TheSpringFramework
TheSpringFrameworkTheSpringFramework
TheSpringFramework
 
Spring ppt
Spring pptSpring ppt
Spring ppt
 
Spring core module
Spring core moduleSpring core module
Spring core module
 
Spring Framework Rohit
Spring Framework RohitSpring Framework Rohit
Spring Framework Rohit
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptx
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
 
Spring notes
Spring notesSpring notes
Spring notes
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
Spring Basics
Spring BasicsSpring Basics
Spring Basics
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malav
 
Spring framework Introduction
Spring framework  IntroductionSpring framework  Introduction
Spring framework Introduction
 
Java spring ppt
Java spring pptJava spring ppt
Java spring ppt
 

Mais de Guo Albert

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorGuo Albert
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得Guo Albert
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置Guo Albert
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionGuo Albert
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study NotesGuo Albert
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsGuo Albert
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date libraryGuo Albert
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errorsGuo Albert
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南Guo Albert
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableGuo Albert
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引Guo Albert
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟Guo Albert
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemGuo Albert
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReportsGuo Albert
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationGuo Albert
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectGuo Albert
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generationGuo Albert
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplateGuo Albert
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03Guo Albert
 

Mais de Guo Albert (20)

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy Simulator
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @Version
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study Notes
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation Tips
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date library
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errors
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History Table
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG System
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report Implementation
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy object
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generation
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03
 

Último

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 

Último (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Overview chap1

  • 2. W HAT IS S PRING ?  Spring is an open source framework, created by Rod Johnson and described in his book Expert One-on-One: J2EE Design and Development  Spring does many things, but when you strip it down to its base parts, Spring is a lightweight dependency injection and aspect-oriented container and framework
  • 3. W HAT IS S PRING ?  Lightweight  Spring is lightweight in terms of both size and overhead.  Dependency Injection  Spring promotes loose coupling through a technique known as dependency injection (DI).  Aspect-oriented  Spring comes with rich support for aspect-oriented programming (AOP)
  • 4. W HAT IS S PRING ?  Container  Spring is a container in the sense that it contains and manages the lifecycle and configuration of application objects  Framework  Spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file.
  • 5. S PRING MODULES  You are free to choose the modules that suit your application and look to other options  ll of Spring’s modules are built on top of the core container.
  • 6. T HE CORE CONTAINER  Spring’s core container provides the fundamental functionality of the Spring Framework  This module contains the BeanFactory  which is the fundamental Spring container and the basis on which Spring’s DI is based.
  • 7. A PPLICATION CONTEXT MODULE  Spring’s application context builds on the core container.  The core module’s BeanFactory makes Spring a container, but the context module is what makes it a framework.  This module extends the concept of BeanFactory, adding support for internationalization (I18N) messages, application lifecycle events, and validation
  • 8. S PRING ’ S AOP MODULE  Spring provides rich support for aspect-oriented programming in its AOP module. This module serves as the basis for developing your own aspects for your Springenabled application. Like DI, AOP supports loose coupling of application objects. With AOP
  • 9. JDBC ABSTRACTION AND THE DAO MODULE  Working with JDBC often results in a lot of boilerplate code that gets a connection,creates a statement, processes a result set, and then closes the connection.Spring’s JDBC and Data Access Objects (DAO) module abstracts away the boilerplate code so that you can keep your database code clean and simple
  • 10. O BJECT - RELATIONAL MAPPING (ORM) INTEGRATION MODULE  For those who prefer using an object-relational mapping (ORM) tool over straight JDBC, Spring provides the ORM module. Spring’s ORM support builds on the DAO support
  • 11. J AVA M ANAGEMENT E XTENSIONS (JMX)  Exposing the inner workings of a Java application for management is a critical part of making an application production ready. Spring’s JMX odule makes it easy to expose your application’s beans as JMX MBeans. This makes it possible to monitor and reconfigure a running application.
  • 12. T HE S PRING MVC FRAMEWORK  The Model/View/Controller (MVC) paradigm is a commonly accepted approach to building web applications such that the user interface is separate from the application logic. Java has no shortage of MVC frameworks, with Apache Struts, JSF, WebWork(Struts 2.0), and Tapestry among the most popular MVC choices.
  • 13. J AVA M ESSAGE S ERVICE (JMS)  The downside to remoting is that it depends on network reliability and that both ends of the communication be available. Message-oriented communication, on the other hand, is more reliable and guarantees delivery of messages, even if the network and endpoints are unreliable.
  • 14. A S PRING JUMP START -1  Dependency injection is the most basic thing that Spring does.  Although it’s not necessary to hide the implementation behind an interface, it’s highly recommended as a way to separate the implementation from its contract
  • 15. C ONFIGURING H ELLO W ORLD IN S PRING  The GreetingServiceImpl class has a single property: greeting  The XML file in listing 1.3 declares an instance of a GreetingServiceImpl in the Spring container and configures its greeting property with a value of “Buenos Dias!” Let’s dig into the details of this XML file a bit to understand how it works
  • 16. L AB 1-練習-1  規劃一個一個sayHello Method合約規範的介面 Igreeting interface
  • 17. L AB 1-練習-2  撰寫與實做Igreeting介面的Entity Class(Bean)  sayHello() 要設定寫出去的資訊(Class必須設定 存取子與封裝的欄位)
  • 18. L AB 1-練習-3  配置Spring bean config  設定屬性(Property-setter and getter)內容
  • 19. T HE H ELLO W ORLD MAIN CLASS  The BeanFactory class used here is the Spring container. After loading the hello.xml file into the container
  • 20. L AB 1-練習-3  專案參考相關的JAR  主程式撰寫
  • 21. U NDERSTANDING DEPENDENCY INJECTION (DI)  DI is at the heart of the Spring Framework. It may sound a bit intimidating, conjuring up notions of a complex programming technique or design pattern.  In fact, by applying DI in your projects, you’ll find that your code will become significantly simpler, easier to understand, and easier to test.
  • 22. I NJECTING DEPENDENCIES  Originally, dependency injection was commonly referred to by another name: inversion of control(IoC)  Any nontrivial application (pretty much anything more complex than HelloWorld.java) is made up of two or more classes that collaborate with each other to perform some business logic.