Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Introduction to the Spring FrameworkBy: Nigusse A. DugumaKansas State universityDepartment of Computer ScienceNov 20, 2007By: Nigusse A. DugumaNov 20, 20072Discussion PointsBrief Introduction to SpringSpring Framework Key FeaturesOverview of the Spring FrameworkSpring Framework Vs. J2EESpring DAOBy: Nigusse A. DugumaNov 20, 20073What is Spring?An open source framework created by Rod Johnson.created to address the complexity of enterprise application developmentIt makes it possible plain JavaBeans to achieve things that were previously only possible with EJBs.Simplicity, testability, and loose couplingSpring is a framework that helps to develop loosely coupled application code."Everything should be made as simple as possible, but not simpler." EinstineBy: Nigusse A. DugumaNov 20, 20074Spring Framework Key FeaturesCore Spring:Inversion Control/Dependency Injection (IoC/DI)Aspect Oriented Programming (AOP)Aspect: A modularization of a concern that cuts across multiple objects.By: Nigusse A. DugumaNov 20, 20075Dependency InjectionObjects are passively given their dependencies instead of creating or looking for dependent objects for them selves.Instead of an object looking up dependencies from a container, the container gives the dependencies to the object at instantiation with out being asked.Primary approaches to implementing DI:Constructor injection and Setter injection.By: Nigusse A. DugumaNov 20, 20076Aspect Oriented ProgrammingApplication objects do what they are supposed to do perform business logic -nothing moreThey are not responsible for other system concerns, such as logging or transaction support Aspect: A modularization of a concern that cuts across multiple objects.By: Nigusse A. DugumaNov 20, 20077Components of Spring FrameworkAOPORMDAOJMX JCXJMSWebContextPortlet MVCRemoting MVCCoreBy: Nigusse A. DugumaNov 20, 20078Components of the Spring FrameworkCore Container: -it contains the BeanFactory which is the basis on which Spring DI is based.Application Context Module – The core module's BeanFactory makes Spring a Container, but the Context module is what makes it a Framework.AOP Module – serves as the basis for developing your own Aspects for your Spring enabled application.JDBC abstraction and the DAO- this module uses the Spring's AOP module to provide transaction management services for the objects in a spring application.By: Nigusse A. DugumaNov 20, 20079Cont.(Spring Framework)ORM (Object Relational Mapping) Module –builds on the DAO support, providing way to build DAO for several ORM solutions.Spring provides hooks into several popular ORM frameworks including Hibernate,iBATIS,SQL Maps, Java Persistence API, Java Data Objects.The Spring MVC FrameworkSpring comes with its own MVC framework that promotes loose coupling techniques in the web layer of an application.By: Nigusse A. DugumaNov 20, 200710Spring vs. EJB3Feature Sp ring EJB3Simple ORM Persistence √ √Implementation Hibernate, iBatis,JPA JDO,TopLink JPA(Providers includeHibernate, Kodo andTopLink)JDBC Support √ ?Supported TransactionTypesJDBC,Hibernate, JTA JTASupport for DistributedTransaction √ (With JTA)√Configuration XMLTransactional by default,override with annotations orXMLStandard √ (With JTA) √By: Nigusse A. DugumaNov 20, 200711Summary Key Features of SpringDependency Injection & AOPComponents of the Spring FrameworkComparison b/n Spring and EJB3By: Nigusse A. DugumaNov 20, 200712References[1] Spring In Action By. Craig Walls (2007) Second Edition.[2] POJO Application Frameworks: Spring Vs. EJB 3.0 by Michael Juntao Yuan http://www.onjava.com/lpt/a/5996 accessed on Nov 5,2007[3] Dependency Injection for Loose Coupling -The Code Project
View Full Document