Spring

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Spring - Presentation Transcript

    1. Spring
    2. Spring? • Inversion of control • Dependency Injection
    3. • DEPENDENCY INJECTION Atunci cand : • public Car buildCar() { Car car = new Car(); Engine engine = new Engine(); car.setEngine(engine); return car; } - Scriem cod ca asta si vrem sa-i impresionam pe altii;
    4. • INVERSION OF CONTROL Atunci cand : • public Car buildCar() { Car car = new Car(); Engine engine = new Engine(); car.setEngine(engine); return car; } … si chestia de mai sus, o face Springu’
    5. • Cool stuff: – Roo - roo generate controller ;) – Easy configuration with xml; – Templates for Hibernate DAO; – AOP features: aspects, advices, pointcuts ☺ – Easy to configure a project with it: – Standard set of libraries; – Many examples; – Good documentation and many books; – Its so full of patterns! ☺
    6. Container Configuration • Dependency Injection <bean id=“myCar" class=“gm.Ford"> <property name=“engine" ref=“renaultEngine" /> </bean> <bean id=“renaultEngine" class=“renault.engines.RenaultEngine“/> • Inversion of control myCar = context.getBean(“myCar”); • Service locator Is what spring is using for retrieving the objects from its container;
    7. Fast configuration • Autowiring <bean id="sequenceGenerator“ class="SequenceGenerator” autowire="byType"> </bean> <bean id="datePrefixGenerator” class="DatePrefixGenerator"> class SequenceGenerator { public SequenceGenerator(DatePrefixGenerator generator) {…} } • Scan package <context:component-scan base-package=“org.mypackage"/>
    8. …bean creation • Prototype (instance/request) • Singleton (instance/IOC container) • Session/Request (instance/session/request) • Proxying: • Necessary for AOP (see proxy pattern)
    9. Aspects • Advice • Ex: logging before and after • Pointcut • Ex: account.putMoney() • Aspect – Advice + Pointcut: Log(“[Enter]putMoney”) Account.putMoney(); Log(“[Exit]putMoney”)
    10. Externalized configuration • @Controller • @RequestMapping • @Aspect • @Autowired
    11. QA? http://alexsisu.posterous.com/ alexandru.sisu@gmail.com
    12. Resources • http://www.springsource.org/ • http://www.springbyexample.org • http://www.springsource.org/roo
    SlideShare Zeitgeist 2009

    + alex.albualex.albu Nominate

    custom

    275 views, 0 favs, 1 embeds more stats

    Alex a ne-a prezentat Spring la Geek Meet #6 Timiş more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 275
      • 207 on SlideShare
      • 68 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 1
    Most viewed embeds
    • 68 views on http://geekmeet.ro

    more

    All embeds
    • 68 views on http://geekmeet.ro

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories