1 / 15

Spring , Hibernate and Web Services

Spring , Hibernate and Web Services. 13 th September 2014. Software Framework. Refers to set of libraries or classes, which are used in the creation of an application .

daire
Download Presentation

Spring , Hibernate and Web Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spring , Hibernate and Web Services 13th 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 controltakes the integration and configuration of the system out of the application, and instead performs dependency 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

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

  9. Dependency Injection • Example: public class Department{ private Employee employee; public Department(Employee emp) { employee= emp; } } Spring is a framework for wiring up your entire application 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

  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

More Related