1 / 8

Service Oriented Architecture using Spring Framework

Service Oriented Architecture using Spring Framework . Ryan Kirkendall Xiaofeng Qi. Goals of SOA. Promote loosely coupled services with clear areas of functionality Utilize Spring provided classes to reduce redundant code (DAOs) Services are “black boxes” to client code

fawzia
Download Presentation

Service Oriented Architecture using Spring Framework

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. Service Oriented Architecture using Spring Framework Ryan Kirkendall Xiaofeng Qi

  2. Goals of SOA • Promote loosely coupled services with clear areas of functionality • Utilize Spring provided classes to reduce redundant code (DAOs) • Services are “black boxes” to client code • Can be replaced/refactored without impacting client code • Results in code that is: • Cleaner • More reliable • More flexible • More understandable

  3. Components of a service • Service interface (client code programs against this) • Service implementation • DAO (Data Access Object) interface • DAO Implementation • POJO (plain old java object) goes between the layers of the application.

  4. Guidelines • Anything can talk to a service (POJO, DAO, other services) • Only a given service may talk to it’s DAO(s) • Services and DAOs are accessed by their interface • Requires a factory for constructing these objects (Spring framework) • Services throw unchecked exceptions

  5. Diagram – client code/service/dao interaction OJB Services (Interfaces, Implementations) (POJO) NOTE: POJOS (Model Beans) are always the same there is no bean translation between layers Stolen graphic from: http://www.onjava.com/lpt/a/4744

  6. Close Up Service Layer Service Implementation POJO DAO Implementation Client Code (Struts, Other Services, POJOs) POJO Service Interface DAO Interface POJO POJO Client Code retrieves Service Implementation from Spring and communicates with Implementation using the Service Interface Spring “injects” DAO into service Implementation. Service communicates with DAO using the DAO interface NOTE: POJOS (Model Beans) are always the same there is no bean translation between layers Code Examples

  7. Close Up Struts Layer ActionForm 2. Struts gives ActionForm to Action Action 3. Action gets Model Bean from ActionForm and send it to service layer POJO 5. Action Returns Action Form with embedded Model Bean POJO POJO 4. Service Returns Model Bean ActionForm Service(s) POJO 1. Set Model Bean directly from JSP using “.” notation to drill down to bean through ActionForm JSP JSP 6. JSP Renders Module bean NOTE: POJOS (Model Beans) are always the same there is no bean translation between layers Code Examples

  8. On to the code URLs about SOA http://www.onjava.com/lpt/a/4744 http://www-106.ibm.com/developerworks/webservices/library/ws-migratesoa/ http://www.javaworld.com/javaworld/jw-10-2004/jw-1004-soa.html

More Related