Spring-framework-Training,core spring 3.0,spring training,springpeople

1,088,021 views
1,094,086 views

Published on

SpringPeople provides high-end Consulting, Development and Educational Services. As Master Certified Training Delivery partner in India for SpringSource Inc., SpringPeople brings to India the immensely popular, high-quality public and onsite training courses from SpringSource University curriculum on Spring, Apache and Groovy/Grails technologies. Visit: http://www.springpeople.com/index.php, for further details

Published in: Education, Technology
1 Comment
1 Like
Statistics
Notes
  • Hi, I am David one of the creator of https://www.springmockexams.com. First all, I want to thank you for your slides ! Thanks also for sharing your knowledge. We provide a free and a complete solution to prepare your Spring Core Certification as well. If you are interested you can just head over: https://www.springmockexams.com The website is also packed with general information regarding the exam. Thanks – David
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,088,021
On SlideShare
0
From Embeds
0
Number of Embeds
13,969
Actions
Shares
0
Downloads
137
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide
  • Emphasize this presentation will show how to hit the ground running with core Spring feature set.
  • The quick start should be “quick” -- communicate at a high level what has to be done to get a basic Spring-powered application up and running
  • Let’s start with a high level picture of how Spring works…
    A good analogy is an automobile plant. At a auto plant cars are assembled from parts on an assembly line. Workers on the line have an instruction manual that tells how to piece together the parts to build a car. So, you can view Spring as an application assembler where the parts are your Java components, and the instructions provided to Spring act as the manual for the assembly process. After assembly, you have a fully configured system ready to be used--just like after car assembly, you have a fully configured car ready to be driven. Parts can be interchanged, can be used in other vehicles (systems), etc.
  • Focus on the relationships between the elements rather than they syntax itself.
  • Spring-framework-Training,core spring 3.0,spring training,springpeople

    1. 1. Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Spring Quick Start Introducing the Spring Application Context and Spring’s XML-based configuration language
    2. 2. 2 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Topics in this session • Spring quick start • Writing bean definitions – Configuring objects – Going beyond constructor instantiation • Creating an application context • Summary
    3. 3. 3 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit How Spring Works Spring ApplicationContextConfiguration Instructions Your Application Classes (POJOs) Fully configured application system Ready for use Creates
    4. 4. 4 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Your Application Classes public class TransferServiceImpl implements TransferService { public TransferServiceImpl(AccountRepository ar) { this.accountRepository = ar; } … } public class TransferServiceImpl implements TransferService { public TransferServiceImpl(AccountRepository ar) { this.accountRepository = ar; } … } public class JdbcAccountRepository implements AccountRepository { public JdbcAccountRepository(DataSource ds) { this.dataSource = ds; } … } public class JdbcAccountRepository implements AccountRepository { public JdbcAccountRepository(DataSource ds) { this.dataSource = ds; } … } Needed to load accounts from the database Needed to perform money transfers between accounts
    5. 5. 5 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Configuration Instructions <beans> <bean id=“transferService” class=“app.impl.TransferServiceImpl”> <constructor-arg ref=“accountRepository” /> </bean> <bean id=“accountRepository” class=“app.impl.JdbcAccountRepository”> <constructor-arg ref=“dataSource” /> </bean> <bean id=“dataSource” class=“com.oracle.jdbc.pool.OracleDataSource”> <property name=“URL” value=“jdbc:oracle:thin:@localhost:1521:BANK” /> <property name=“user” value=“moneytransfer-app” /> </bean> </beans>
    6. 6. 6 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Creating and Using the Application // Create the application from the configuration ApplicationContext context = new ClassPathXmlApplicationContext(“application-config.xml”); // Look up the application service interface TransferService service = (TransferService) context.getBean(“transferService”); // Use the application service.transfer(new MonetaryAmount(“300.00”), “1”, “2”);
    7. 7. 7 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Inside the Spring Application Context // Create the application from the configuration ApplicationContext context = new ClassPathXmlApplicationContext(“application-config.xml”); Application Context OracleDataSource dataSource JdbcAccountRepository accountRepository TransferServiceImpl transferService
    8. 8. 8 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Quick Start Summary • Spring manages the lifecycle of the application – All beans are fully initialized before they are used • Beans are always created in the right order – Based on their dependencies • Each bean is bound to a unique id – The id reflects the service the bean provides to clients • The ApplicationContext works as a container, encapsulating the bean implementations chosen for a given deployment – Conceals implementation details
    9. 9. 9 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Topics in this session • Spring quick start • Writing bean definitions – Configuring objects – Going beyond constructor instantiation • Creating an application context • Summary
    10. 10. 10 Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Register… To register for this training please visit http://www.springpeople.com/courses/regular/spr-001.php For further info please contact SpringPeople Technologies info@springpeople.com +91 80 4114 6519 http://www.springpeople.com To register for this training please visit http://www.springpeople.com/courses/regular/spr-001.php For further info please contact SpringPeople Technologies info@springpeople.com +91 80 4114 6519 http://www.springpeople.com

    ×