Implementation Case with Java tools and experiences - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Implementation Case with Java tools and experiences

Description:

Only those entities and fields needed. FCD translated against TA and FDTP (naming, data types) ... Marshall it to XML document (FDTP or MDTP) Put the FDTP or ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 20
Provided by: ifr1
Category:

less

Transcript and Presenter's Notes

Title: Implementation Case with Java tools and experiences


1
Implementation - Case with Java (tools and
experiences)
  • Heikki Pakkala, THL
  • WP1.8 TG3.1 EuroFIR Web Services
  • 3rd Meeting, Florence 2009

2
Implementation - Case with Java
  • What the Web Services are supposed to do?
  • Our Solution stack
  • Our Starting points
  • From WSDLs to Web Services
  • Web Service FCDB
  • From FCDB into Java Persistence API (JPA)
  • Working with the XML files
  • The work flow from request to response
  • Some thoughts of test driven development
  • How to design for change?

3
The big picture
4
Implementation with Java solution stack
  • (Windows) Tomcat MySQL Java (J2EE)
  • Why Java why not?
  • Java EE Web Services Technologies (Metro stack)
  • Java API for XML-Based Web Services (JAX-WS)
  • Java Architecture for XML Binding (JAXB)
  • Java Persistence API (JPA), implementation with
    Hibernate
  • Tools
  • Eclipse (Myeclipse)
  • SoapUI

5
Implementation with Java starting points
  • Experience with Java still many new things
    (like e.g. Web services)
  • Things can be done with very different ways
  • This is not how-to-make-it manual
  • Our principles
  • Do not reinvent the wheel use frameworks
  • Design for change isolate potential change
  • Test driven development

6
Basic tool Eclipse (Myeclipse)
7
Starting with the WSDLs
  • WSDLs ? creation of Web Services stubs with
    MyEclipse tools
  • A large set of generated classes
  • Creating a common service dispatcher
  • Delegation
  • authentication
  • errors

8
FCDB for the Web services 1/3
  • FCDB designed specially for Web services
  • FCD will be loaded from the production FCDB (new
    releases)
  • Only those entities and fields needed
  • FCD translated against TA and FDTP (naming, data
    types)
  • Search intensive structure heavy indexed
  • Structures supporting our needs (like e.g.
    LanguaL search)
  • Nothing very special but this structure would
    not fit to our FCD storing needs
  • Some surrogates added to make our life easier
    with the Hibernate

9
FCDB for the Web services 2/3
10
FCDB for the Web services 3/3
  • Think ahead the things that you will need!
  • Tree traversing is not for SQL
  • LanguaL NT (linked with food)
  • LanguaL BT search uses tree
  • LanguaL tree is created when loading the FCD
  • All branches are multiplied for all foods
  • This set is SQL compatible

11
Java Persistence API (JPA) for FDQL Hibernate
implementation
12
JPA Hibernate in action
  • OR mapping
  • Reverse engineer from Web Service FCDB
  • A large set of generated classes
  • Database Communication always via Hibernate
  • Let Hibernate do all database operations (get the
    food and Hibernate will find the rest connected
    with it lazy or eager)
  • HQL or SQL available

13
JAXB working with XML files 1/2
14
JAXB working with XML files 2/2
  • We need the XML schema first
  • Bind the XML schema with a JAXB compiler
  • A large set of generated classes
  • Generate your XML object tree
  • Fill it with data
  • Marshall it to XML document
  • Or
  • Generate your XML object tree
  • Link it with a document
  • Validate document
  • Unmarshal data from document to your XML object
    tree
  • Available XML schemata for FDQL, FDTP, MDTP
  • also usable for parameters, term lists etc (do
    your own XML schemata)

15
Main actions from request to response
  • SOAP request receiving
  • authentication
  • FDQL parsing to XML object (create unmarshall)
  • Delegation to the right Web Service and creating
    it
  • Web Service
  • FDQL interpretation (possible or not, search
    plan)
  • FDQL translation (mapping with Hibernate objects)
  • Query execution to FDQL with Hibernate objects
    (HQL, SQL)
  • Getting the results with Hibernate objects
  • Creating the FDTP/MDTP object tree
  • Fill the tree from Hibernate objects
  • Marshall it to XML document (FDTP or MDTP)
  • Put the FDTP or MDTP into SOAP envelope
  • Send SOAP response

16
Test driven development
  • Iteration
  • Test cases
  • Unit testing
  • Writing the test cases sometimes challenging
  • Rerun test patterns after changes

17
Testing the whole Web Service - soapUI
  • Write your own request and see what comes out
  • Write test requests
  • Mock-up response for development of eSearch

18
Design for change ?
  • Isolate changing elements interfaces
  • Production FCDB and Web Service FCDB
  • JPA Hibernate
  • WSDLs
  • FDQL
  • XML schemata
  • Actions inside Web Services
  • FDTP and MDTP
  • SOAP
  • Separate generated code (large amount of
    generated classes from WSDL, Hibernate and XML
    schemata) from written code

19
Summary
  • What the Web Services are supposed to do?
  • Our Solution stack
  • Our Starting points
  • From WSDLs to Web Services
  • Web Service FCDB
  • From FCDB into Java Persistence API (JPA)
  • Working with the XML files
  • The work flow from request to response
  • Some thoughts of test driven development
  • How to design for change?
  • Thank you for your patience!
Write a Comment
User Comments (0)
About PowerShow.com