Presentation is loading. Please wait.

Presentation is loading. Please wait.

Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.

Similar presentations


Presentation on theme: "Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009."— Presentation transcript:

1 Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.

2 16 de mayo de 2009 Contents  The problem  The Spring Framework  Dependency Injection  Aspect-Oriented Programming  Portable Service Abstractions  Best Practices

3 16 de mayo de 2009 Contents  The problem  The Spring Framework  Dependency Injection  Aspect-Oriented Programming Portable Service Abstractions  Best Practices

4 16 de mayo de 2009 Portable Service Abstractions Consistent integration with various standard and 3rd party APIs. Allows access to these frameworks without knowing how they actually work. Spring provides abstraction and integration for: – Transaction Management: JTA, JDBC, others – Data Access: JDBC, Hibernate, JDO, TopLink, iBatis – Email – Remoting – EJB, Web Services, RMI – Integrates nicely with Struts, JSF, Tapestry, Velocity and other web frameworks Spring also provides it’s own web framework, Spring Web MVC

5 16 de mayo de 2009 Portable Service Abstractions Benefits: Insulates you from the underlying APIs Greater reusability Spring abstractions always consist of interfaces This makes testing simpler For data access, Spring uses a generic transaction infrastructure and DAO exception hierarchy that is common across all supported platforms

6 16 de mayo de 2009 Spring integration with Hibernate Define a DataSource bean Define a Session Factory bean demo.entity.Contact org.hibernate.dialect.Oracle10gDialect

7 16 de mayo de 2009 Spring integration with Hibernate Define an Hibernate Template bean Define a Transaction Manager bean Define a Parent DAO bean for CRUD operations

8 16 de mayo de 2009 Spring integration with Hibernate Define an Transaction Proxy Template bean Service interface and implementation PROPAGATION_REQUIRED

9 16 de mayo de 2009 Spring integration with Hibernate DAO interface and implementation

10 16 de mayo de 2009 Why use Spring? Spring can effectively organize your middle tier objects, whether or not you choose to use EJB. Spring can eliminate the proliferation of Singletons seen on many projects. Spring can eliminate the need to use a variety of custom properties file formats, by handling configuration in a consistent way throughout applications and projects. Spring can facilitate good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero. Spring is designed so that applications built with it depend on as few of its APIs as possible. Applications built using Spring are very easy to unit test.

11 16 de mayo de 2009 Why use Spring? Spring can make the use of EJB an implementation choice, rather than the determinant of application architecture. Spring helps you solve many problems without using EJB. For example, using AOP to deliver declarative transaction management without using an EJB container. Spring provides a consistent framework for data access, whether using JDBC or an O/R mapping product such as TopLink, Hibernate or a JDO implementation. Spring provides a consistent, simple programming model in many areas, making it an ideal architectural "glue." Spring is essentially a technology dedicated to enabling you to build applications using POJOs.

12 16 de mayo de 2009 12 Thank You


Download ppt "Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009."

Similar presentations


Ads by Google