Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Ixonos OyjEnter Information Classification here29.3.2007 Javan tehokas hyödyntäminen ja integraatiot PL/SQL pohjaisissa arkkitehtuureissa Marko Asplund.

Similar presentations


Presentation on theme: "© Ixonos OyjEnter Information Classification here29.3.2007 Javan tehokas hyödyntäminen ja integraatiot PL/SQL pohjaisissa arkkitehtuureissa Marko Asplund."— Presentation transcript:

1 © Ixonos OyjEnter Information Classification here29.3.2007 Javan tehokas hyödyntäminen ja integraatiot PL/SQL pohjaisissa arkkitehtuureissa Marko Asplund Ixonos Teknologiakonsultointi oy

2 © Ixonos Oyj29.3.2007Enter Information Classification here2 About the speaker Senior Consultant / Ixonos Technology Consulting Architecture design and implementation of enterprise applications, typically with Java technologies MSc., SCEA, SCBCD, SCJP, OCA

3 © Ixonos Oyj29.3.2007Enter Information Classification here3 Ixonos in Brief Ixonos operates in the ICT services market, producing customer specific technology consulting, project management and software production services Founded 1994, listed OMX Nordic Exchange in Helsinki Clientele comprises leading mobile and smartphone manufacturers, mobile network suppliers and telecom operators operating on the global markets as well as Finnish finance, industrial and service companies and public administration organizations. Headquarters in Helsinki, offices in Salo, Tampere, Turku, Jyväskylä, Oulu, Kemi, Haapajärvi and Slovak Republic, Estonia and Germany Turnover in 2007: 59,2 MEUR Operating profit in 2007: 4,7 MEUR Current personnel more than 900

4 © Ixonos Oyj29.3.2007Enter Information Classification here4 Tactical and development issues of our customers “Improving Performance” Supporting Project Executives Operative issues of our customers “Correct Competence” Supporting Projects Strategic issues of our customers ”Implementing Strategy” Supporting Corporate Executives Ixonos Service Areas and Service Focus TECHNOLOGY CONSULTING SERVICES PROJECT MANAGEMENT SERVICES USER INTERFACE & USER EXPERIENCE DESIGN SERVICES TESTING & QUALITY ASSURANCE SERVICES PROJECT DELIVERIES MAINTENANCE SERVICES Leading PMOs, Managing Programs and Projects Project Methodologies and Tools Project Portfolios and PMOs Business Processes, Product Predevelopment etc. Business Architectures and Intelligence SW Architectures and Requirements UI Specifications UI Prototypes & Usability, Graphic Design User Interface Concept Design Project Service Delivery Project Delivery Processes, Methodologies and Tools Business Requirements Testing Delivery Processes, Methodologies and Tools Testing & QA Strategies and Requirements Testing and QA Service Delivery Maintenance Service Delivery Maintenance Processes, Methodologies and Tools Service and Service Level Requirements

5 © Ixonos Oyj29.3.2007Enter Information Classification here5 Presentation background Objective Identify potential for Java technologies in PL/SQL based applications Review integration strategies and techniques Audience People involved with PL/SQL based application development who see potential for using Java technologies Java developers PL/SQL developers (project managers) Context Web application Java call-out to PL/SQL code

6 © Ixonos Oyj29.3.2007Enter Information Classification here6 Agenda Architectural differences between the two technologies Role of Java and PL/SQL Strategies for introducing Java in PL/SQL based applications Techniques for integrating Java and PL/SQL

7 © Ixonos Oyj29.3.2007Enter Information Classification here7 Strengths of Java and PL/SQL PL/SQL Standard way of implementing stored procedures Tight integration with the database: types, SQL execution etc. Simple development and deployment model Performance (network roundtrips) A key technology for Oracle Java Momentum Developer mindshare Universal adoption – future proof Development tools Peer support Third party libraries and software Strategic technology for Oracle

8 © Ixonos Oyj29.3.2007Enter Information Classification here8 The case for Java Succesfull system outgrows expectations Well suited for enterprise application development Lack of ready-made PL/SQL packages in certain areas Database professional resource shortage

9 © Ixonos Oyj29.3.2007Enter Information Classification here9 PL/SQL’s strong points Triggers Adapting ORM and database schemas Higher level data access abstraction layer Sharing and enforcing centralized set of business rules across applications

10 © Ixonos Oyj29.3.2007Enter Information Classification here10 Architectural differences PL/SQLJava EE

11 © Ixonos Oyj29.3.2007Enter Information Classification here11 Development environments PL/SQL Toad, Oracle SQL Developer or text editor Oracle RDBMS Apache or Oracle Web Server Version Control System (CVS, SVN) Java Java JDK JDeveloper OC4J Oracle RDBMS Version Control System (CVS, SVN)

12 © Ixonos Oyj29.3.2007Enter Information Classification here12 JDeveloper Well integrated with Oracle RDBMS and Application Server RAD development with ADF and JSF Java EE support Embedded OC4J PL/SQL package proxy class generation PL/SQL Web Service generation

13 © Ixonos Oyj29.3.2007Enter Information Classification here13 Architectural issues Development process Deployment model Importance of a well designed service layer Performance Licensing

14 © Ixonos Oyj29.3.2007Enter Information Classification here14 Integration approaches and techniques Approaches Re-implement from scratch Horizontal migration Vertical migration Techniques JDBC Database tables Web Services Streams Advanced Queueing Direct server-side stored procedure calls Practical matters Exception handling Oracle object types

15 © Ixonos Oyj29.3.2007Enter Information Classification here15 Re-implement from scratch Costly Risky Slow time to market

16 © Ixonos Oyj29.3.2007Enter Information Classification here16 Horizontal migration Migrate layer at a time From top to bottom Original application should have a layered architecture If not, refactoring required

17 © Ixonos Oyj29.3.2007Enter Information Classification here17 Vertical migration Hybrid architecture: Java and PL/SQL based subsystems collectively implement application feature set Migrate logical application units vertically through all layers HTTP Server routes requests to the appropriate subsystem Database as ”integration bus” Overhead due to plumbing code duplication NB: caching, concurrency, transactions etc. need to be implemented coherently!

18 © Ixonos Oyj29.3.2007Enter Information Classification here18 Vertical migration

19 © Ixonos Oyj29.3.2007Enter Information Classification here19 JDBC based integration Same technique can be used across platforms PL/SQL call from JDBC PL/SQL call with Spring framework PL/SQL call using JPublisher generated code

20 © Ixonos Oyj29.3.2007Enter Information Classification here20 Demo PL/SQL package CREATE OR REPLACE PACKAGE ougf AS FUNCTION hello2(name VARCHAR2) RETURN VARCHAR2; END ougf; CREATE OR REPLACE PACKAGE BODY ougf AS FUNCTION hello2(name VARCHAR2) RETURN VARCHAR2 IS BEGIN RETURN 'hello, ' || name; END hello2; END ougf;

21 © Ixonos Oyj29.3.2007Enter Information Classification here21 PL/SQL call from JDBC Connection c = dataSource.getConnection(); CallableStatement stmt = c.prepareCall("{? = call ougf.hello2(?)}"); stmt.registerOutParameter(1, Types.VARCHAR); stmt.setString(2, “ougf"); stmt.execute(); String msg = stmt.getString(1);

22 © Ixonos Oyj29.3.2007Enter Information Classification here22 PL/SQL call with Spring framework public class Greeter2 extends StoredProcedure { public Greeter2(DataSource ds) { setDataSource(ds); setSql("ougf.hello2"); setFunction(true); declareParameter(new SqlOutParameter("message", Types.VARCHAR)); declareParameter(new SqlParameter("name", Types.VARCHAR)); compile(); } public String getGreeting(String name) { Map params = new HashMap(); params.put("name", name); Map res = execute(params); return (String)res.get("message"); }

23 © Ixonos Oyj29.3.2007Enter Information Classification here23 PL/SQL call with Spring framework – cont. Greeter2 g = new Greeter2(ds); String msg = g.getGreeting(“Larry");

24 © Ixonos Oyj29.3.2007Enter Information Classification here24 PL/SQL call using JPublisher generated code Use Oracle JPublisher / JDeveloper to generate Java code for accessing PL/SQL procedures Ougf ougf = new Ougf(dataSource); String msg = ougf.hello2(“Charles");

25 © Ixonos Oyj29.3.2007Enter Information Classification here25 Direct server-side stored procedure calls Java can be used for implementing stored procedures Typically Java is used in the middle tier Java stored procedures can be called from PL/SQL and vice versa PL/SQL call-out to Java also possible via External Procedure call Is server-side Java going to be supported on the long term? Dependence on DB server Java version

26 © Ixonos Oyj29.3.2007Enter Information Classification here26 Streams Advanced Queueing Asynchronous messaging APIs: JMS + DBMS_AQ et al. + (SOAP)

27 © Ixonos Oyj29.3.2007Enter Information Classification here27 Exception handling

28 © Ixonos Oyj29.3.2007Enter Information Classification here28 SQL exception handling // Spring exception mapping with AspectJ public aspect ExceptionTranslator { private static final SQLErrorCodeSQLExceptionTranslator translator = new SQLErrorCodeSQLExceptionTranslator("Oracle"); after() throwing(SQLException e): call(public * com.ixonos.plsql.jpublish..*(..)) { throw translator.translate(thisJoinPoint.toString(), null, e); }

29 © Ixonos Oyj29.3.2007Enter Information Classification here29 PL/SQL exception handling User-defined exceptions don't include enough information to be processed by the caller (Java) possible to define an exception translator or aspect to extract data from the message Recommended approach use Oracle application errors (raise_application_error) define an exception class for each error condition define error codes for Spring translator (sql-error-codes.xml)

30 © Ixonos Oyj29.3.2007Enter Information Classification here30 How to proceed Business Define business objective and drivers Define IT and architectural drivers Product management Plan feature roadmap Competence management Technology Evaluate existing architecture and code base (esp. layering) Assess reusability Design target architecture (hw + sw, licensing) Choose integration strategy Development process development

31 © Ixonos Oyj29.3.2007Enter Information Classification here31 Summary Java and PL/SQL play well together Both are well supported by Oracle Hybrid architecture for a transition period if ”re-implement from scratch” is not feasible Use JDeveloper/JPublisher generated proxy classes Practical matters Performance Licensing Exception handling Type mapping

32 © Ixonos OyjEnter Information Classification here29.3.2007 Kiitos – Thank you www.ixonos.com


Download ppt "© Ixonos OyjEnter Information Classification here29.3.2007 Javan tehokas hyödyntäminen ja integraatiot PL/SQL pohjaisissa arkkitehtuureissa Marko Asplund."

Similar presentations


Ads by Google