Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spring, Hibernate and Web Services 13 th September 2014.

Similar presentations


Presentation on theme: "Spring, Hibernate and Web Services 13 th September 2014."— Presentation transcript:

1 Spring, Hibernate and Web Services 13 th September 2014

2 Software Framework Refers to set of libraries or classes, which are used in the creation of an application. An application framework provides a foundation for developing the application and alleviates from putting additional efforts for it. Techniques used in framework Configuration files Central Controller Presentation System

3 What does Spring offer? Dependency Injection Also known as IoC (Inversion of Control) Inversion of control takes the integration and configuration of the system out of the application, and instead performs dependency injection. Inversion of controldependency injection Aspect Oriented Programming Runtime injection-based Service Abstractions ORM, DAO, Web MVC etc. Allows access to these without knowing how they actually work Open source project on SourceForge founded by Rod Johnson & Jürgen Höller Apache license

4 What does Spring offer? Enable applications to be coded from POJOs Allow enterprise services to be applied to those POJOs in a declarative, non-invasive way POJOs can be made transactional without the need to know about transaction APIs Collaborating instances are injected using plain Java constructors or setter methods True POJOs are testable in isolation Decouples your application objects from their environment Switch to global transactions over JTA Export your business objects in different environments Switch between SLSB, web service etc.

5 What does Spring offer? Core Lightweight Container(The heart of Spring) Aspect-Oriented Programming (AOP) framework Modularizes behavior that would otherwise be scattered through different methods Decorates your POJOs with cross-cutting behavior in a transparent manner Container instantiates objects and injects dependencies on collaborating objects and configuration properties through Java methods Uses Hollywood Principle - “Don’t call me, I’ll call you”

6 Benefits Portability Your core business logic is implemented once and runs anywhere Leverage Your core code is decoupled from volatile infrastructure Consistency Common configuration strategy everywhere Productivity Test-driven development Don’t need to reinvent your own infrastructure

7 Struts Vs Spring - MVC Spring Struts A model-view-controller framework Made to simplify the writing and testing Fully integrates with the Spring dependency injection framework Open Source All other Spring features can also be used with other web frameworks such as Struts or JSF A model-view-controller framework Made to simplify the writing Open Source Difficult to set up RESTful web services No control on Model layer

8 Spring Modules Middle tier DAO implementations Presentation tier DAO interfaces Service objects / Business Facades RDBMS Domain objects JSP, JSF, Velocity, Jasper Reports… Remote exporters

9 Dependency Injection  Example: public class Department{ private Employee employee; public Department(Employee emp) { employee= emp; } Characteristics  Cons  You must create dependencies to pass along  Pros  Easy to understand  Testable  Flexible  Extensible  Enforces separation of interface from implementation  Code is simple and clear Spring is a framework for wiring up your entire application

10 What does hibernate offer? Open Source light-weight ORM solution Java Object/Relational Mapping, Maps JavaBeans (POJOs) to tables, Lets you avoid SQL Works with (almost) all relational Databases, Easy migration from one vendor database to another Hibernate generates the JDBC Code based on the underlying vendor database Support CRUD (Create, Read, Update and Delete) operations Very well matured and adopted by a large developer community

11 ORM – Hibernate Introduction Traditional Solutions JDBC/SQL code embedded in Class, EJB (J2EE) solution etc. More coding, container dependent etc. are the issues Best practice would be to keep the Persistence separate from classes

12 Webservice Introduction SOA is a software design principle and an architectural pattern for implementing loosely coupled, reusable and coarse grained services. You can implement SOA using any protocols such as HTTP, HTTPS, JMS. Messages can be in XML or Data Transfer Objects (DTOs). Web service is an implementation technology and one of the ways to implement SOA. Web services offer is the standards based and platform-independent service via HTTP, XML, SOAP, WSDL and UDDI, thus allowing interoperability between heterogeneous technologies such as J2EE and.NET

13 Webservice Introduction Web Services support loosely coupled connections. The loosely coupled applications reduce the cost of maintenance and increases re-usability. Web Services present a new form of middle-ware based on XML and HTTP. Web services are language and platform independent. Styles of Web Services used for application integration SOAP WS and RESTful Web Service

14 Webservice Integration

15 Q&A


Download ppt "Spring, Hibernate and Web Services 13 th September 2014."

Similar presentations


Ads by Google