Java Course Day 23

296
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
296
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java Course Day 23

  1. 1. Day 23
  2. 2. Spring?
  3. 3. Container
  4. 4. Container DI
  5. 5. Container DIAOP
  6. 6. Container DIAOP Framework
  7. 7. ContainerLightweight DI AOP Framework
  8. 8. Bean Configuration
  9. 9. <bean id="employee" class="com.all4rest.domain.Employee" />
  10. 10. <bean id="employee" class="com.all4rest.domain.Employee" > <constructor-arg name="name" value="oleg" /> <constructor-arg name="salary" value="200.00" /></bean>
  11. 11. <bean id="employee" class="com.all4rest.domain.Employee" > <property name="name" value="oleg" /></bean>
  12. 12. <bean id="salonService" class="com.all4rest.domain.SalonService" > <property name="name" value="haircut" /></bean><bean id="employee" class="com.all4rest.domain.Employee" > <property name="salonService" ref="salonService" /></bean>
  13. 13. <bean id="employee" class="com.all4rest.domain.Employee" > <property name="salonService" > <bean class="com.all4rest.domain.SalonService" /> </property></bean>
  14. 14. <list>, <set>, <map>, <props><bean id="service.haircut" class="com.all4rest.domain.SalonService" > <property name="name" value="haircut" /></bean><bean id="service.manicure" class="com.all4rest.domain.SalonService" > <property name="name" value="manicure" /></bean><bean id="employee" class="com.all4rest.domain.Employee" > <property name="salonServices" > <list> <ref bean="service.haircut" /> <ref bean="service.manicure" /> </list> </property></bean>
  15. 15. <bean id="employee" class="com.all4rest.domain.Employee" > <property name="name" ><null /></property></bean>
  16. 16. Autowiring(byName, byType, constructor, auto-detect)
  17. 17. Bean scoping<bean id="employee" class="com.all4rest.domain.Employee“ scope="prototype" /> singleton request web session
  18. 18. Factories<bean id="employee" class="com.all4rest.domain.Employee“ factory-bean="employeeFactory“ factory-method="createEmployee" />
  19. 19. Initialization/Destruction methods<bean id="employee" class="com.all4rest.domain.Employee“ init-method="employeeInit“ destroy-method="employeeDestroy" />
  20. 20. Parent/child beans<bean id="abstractEmployee" class="com.all4rest.domain.AbstractEmployee“ abstract="true"/><bean id="employee" class="com.all4rest.domain.Employee“ parent="abstractEmployee" />
  21. 21. Handling Application Events<bean id="contextRefreshListener“ class="com.all4rest.ContextRefreshListener" />public class ContextRefreshListener implements ApplicationListener { public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextRefreshedEvent) { // do my staff } }}
  22. 22. BeanNameAwareApplicationContextAware
  23. 23. AOP(aspect, advice, pointcut)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×