SlideShare a Scribd company logo
1 of 75
Xenogenetics for PL/SQLInfusing with Java Best Practices and Design Patterns
Blogger Presenter Author
Blogger Presenter
Xenogenetics for PL/SQLInfusing with Java Best Practices and Design Patterns
Zĕn'ə-jə-nĕt'ĭks for PL/SQLInfusing with Java Best Practices and Design Patterns
Show of hands: ,[object Object]
 Developer
 Biologist,[object Object]
Design Patterns
solutionsforgenericproblems
“Someone has already solved your problems”
Design by Contract EncapsulationDecouplingAssertion
specification body Encapsulation
specification specification body body Decoupling
procedure proc (p_name     in varchar2                ,p_sal      in number                ,p_hiredate in date                )
Expectation regarding Valid Input procedure proc (p_name     in varchar2                ,p_sal      in number                ,p_hiredate in date                ) Agreed Contract
package dbc is AssertFail   exception; c_AssertFail constant integer := -20999; pragmaexception_init (AssertFail, -20999);    procedure assert (p_check in boolean                     ,p_msg   in varchar2 := null                     ); end dbc;
procedure assert (p_check in boolean                  ,p_msg   in varchar2 := null                  ) is begin    if not nvl(p_check,false)   -- fail on null input    then raise_application_error          ( c_AssertFail, 'Assertion Fail'            ||': '||substr( nvl(p_msg, 'No Message')                          , 1, 200)           );    end if; end assert;
Validate Input procedure proc (...) is begin dbc.assert (p_name is not null                         ,'The Name must be Filled'                         ); dbc.assert ((p_sal is not null and p_sal > 0)               ,'The Salary must be greater than zero'               ); dbc.assert (p_hiredate >= trunc (sysdate)               ,'Hiredate must be in the Future'               );    ... end proc; proc.sql
-- Description of this procedure -- -- %paramp_name Name of an Employee --  {*} Requirement Name must be provided -- -- %paramp_sal Salary of the Employee --  {*} Requirement Salary must be greater than zero -- -- %paramp_hiredateHiredate --  {*} Requirement Hiredate must be in the Future -- -- %raises DBC.AssertFail -- When a Parameter does not match the requirement
Allround Automations Plugin PLSQLDOC
(aka Inversion of Control) Advanced Decoupling Dependency Injection
PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package HTTP Logger
PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package HTTP Logger
Dependency Injection- Traditional Approach Central Package instead of hard-coding c_mailserverc_interest_ratec_vat_ratec_file_in_namec_log_level APP_CONSTANTS Package Package Package
True Injection Configuration Values property package value After Logon trigger mailserverinterest_ratevat_ratefile_in_namelog_levelurl_proxy emailertax_calctax_calcloggerloggerrss_reader amislin324.517.6app_log_xdebugamisvm2… setMailServer EMAILER setFileInName setLogLevel LOGGER setUrlProxy RSS_READER Dependency_Injector TAX_CALC setInterestRate setVatRate
From mere Value Injection to Interface Injection A component can specify it requires some simple configuration values to be injected directory name, email address, discount percentage It can also stipulate that it wants some ‘helpers’ complete functional components for example: a Logger, an Emailer, a Discount Calculation Service, an Order Validation , etc. The component will prescribe the interface the injected helper must have Reuse is promoted through injected dependencies
Interface Injection“If you give me a logger, I will write logging” Dependency_Injector LOGGER log_message(  p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 ); set_loglevel_threshold( p_log_level in varchar2);set_file_writer( p_file_writer in varchar2 HRM_SALARY_RULES /* Logger interface: p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 */ set_logger (p_logger in varchar2)
Interface Injection“If you give me a logger, I will write logging” Dependency_Injector HRM_SALARY_RULES /* Logger interface: p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 */ set_logger (p_logger in varchar2) NEW_LOGGER_IMPL Write_trace_message(  p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 );
Reusability
JSON Cross Session Communication
Why? process process process
Why? process process process
session session CentralCache session session
session session
session session
Q session session
ApplicationContext session session
namespace Name : Value Name : Value Name : Value Name : Value Name : Value Name : Value context1.sql
JavaScript Object Notation Lightweight data-interchange format
Name : Value
Name : Value, Name : Value, Name : Value
Name : Value, Name : Value, Name : Value Name : Value, Name : Value, Name : Value Name : Value, Name : Value, Name : Value , ,
{"ACCOUNTING" : {     "EMPLOYEES" : [     {"ENAME" : "KING",       "JOB" : "PRESIDENT",       "SAL" : 5000     },     {"ENAME" : "MILLER",       "JOB" : "CLERK",       "SAL" : 1300     }]   } }
<department name="ACCOUNTING">   <employees>     <employee>       <ename>KING</ename>       <job>PRESIDENT</job>       <sal>5000</sal>     </employee>     <employee>       <ename>MILLER</ename>       <job>CLERK</job>       <sal>1300</sal>     </employee>   </employees> </department>
context2.sql
Caching session Cache package session session session
Caching session Cache package key value Alert Listener
Worker Session Worker Session Package (single session) client Worker Session dbms_job Worker Session Worker Session
Java Stored Procedure Unlocking the World
Challenges
Challenges Lack of Interaction Humans External Systems PL/SQL is limited
Q
1 ,[object Object],2 ,[object Object],3 ,[object Object],4 ,[object Object],5 ,[object Object],[object Object]
From Xenophobia to Xenogenetics Established best practices in languages like Java can help improve use of PL/SQL Design by Contract, Encapsulation,  Assertion, Reduced Impact of Changes Dependency Injection,  Decoupling, Reuse Technical concepts in Java can have a meaningful counterpart in PL/SQL Data and Interaction across sessions
From Xenophobia to Xenogenetics De-facto standards – such as JSON – may make sense in a PL/SQL context And open source PL/SQL libraries may exist Through Java Stored Procedures, PL/SQL can leverage Java capabilities & libraries To interact  through additional channels To calculate, process, generate, interpret

More Related Content

What's hot

Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018Alan Arentsen
 
When symfony met promises
When symfony met promises When symfony met promises
When symfony met promises Marc Morera
 
Into the ZF2 Service Manager
Into the ZF2 Service ManagerInto the ZF2 Service Manager
Into the ZF2 Service ManagerChris Tankersley
 
Introduction to Angular js
Introduction to Angular jsIntroduction to Angular js
Introduction to Angular jsMustafa Gamal
 
A3 sec -_regular_expressions
A3 sec -_regular_expressionsA3 sec -_regular_expressions
A3 sec -_regular_expressionsa3sec
 
focuslight-validator validate sinatra application - validation night at LINE ...
focuslight-validator validate sinatra application - validation night at LINE ...focuslight-validator validate sinatra application - validation night at LINE ...
focuslight-validator validate sinatra application - validation night at LINE ...Satoshi Suzuki
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnitJace Ju
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in ApexJeffrey Kemp
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
Dealing With Legacy PHP Applications
Dealing With Legacy PHP ApplicationsDealing With Legacy PHP Applications
Dealing With Legacy PHP ApplicationsViget Labs
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8Dhaval Dalal
 
The road to continuous deployment (PHPCon Poland 2016)
The road to continuous deployment (PHPCon Poland 2016)The road to continuous deployment (PHPCon Poland 2016)
The road to continuous deployment (PHPCon Poland 2016)Michiel Rook
 
Oracle PL/SQL - Creative Conditional Compilation
Oracle PL/SQL - Creative Conditional CompilationOracle PL/SQL - Creative Conditional Compilation
Oracle PL/SQL - Creative Conditional CompilationScott Wesley
 
Review unknown code with static analysis
Review unknown code with static analysisReview unknown code with static analysis
Review unknown code with static analysisDamien Seguy
 
6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScriptpcnmtutorials
 

What's hot (20)

Perl6 grammars
Perl6 grammarsPerl6 grammars
Perl6 grammars
 
Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
When symfony met promises
When symfony met promises When symfony met promises
When symfony met promises
 
Into the ZF2 Service Manager
Into the ZF2 Service ManagerInto the ZF2 Service Manager
Into the ZF2 Service Manager
 
Introduction to Angular js
Introduction to Angular jsIntroduction to Angular js
Introduction to Angular js
 
A3 sec -_regular_expressions
A3 sec -_regular_expressionsA3 sec -_regular_expressions
A3 sec -_regular_expressions
 
focuslight-validator validate sinatra application - validation night at LINE ...
focuslight-validator validate sinatra application - validation night at LINE ...focuslight-validator validate sinatra application - validation night at LINE ...
focuslight-validator validate sinatra application - validation night at LINE ...
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnit
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
February0504 pm
February0504 pmFebruary0504 pm
February0504 pm
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in Apex
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
Laravel 5.5 dev
Laravel 5.5 devLaravel 5.5 dev
Laravel 5.5 dev
 
Dealing With Legacy PHP Applications
Dealing With Legacy PHP ApplicationsDealing With Legacy PHP Applications
Dealing With Legacy PHP Applications
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8
 
The road to continuous deployment (PHPCon Poland 2016)
The road to continuous deployment (PHPCon Poland 2016)The road to continuous deployment (PHPCon Poland 2016)
The road to continuous deployment (PHPCon Poland 2016)
 
Oracle PL/SQL - Creative Conditional Compilation
Oracle PL/SQL - Creative Conditional CompilationOracle PL/SQL - Creative Conditional Compilation
Oracle PL/SQL - Creative Conditional Compilation
 
Review unknown code with static analysis
Review unknown code with static analysisReview unknown code with static analysis
Review unknown code with static analysis
 
6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript
 

Viewers also liked

ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010
ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010
ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010Lucas Jellema
 
Reaching Out From PL/SQL (OPP 2010)
Reaching Out From PL/SQL (OPP 2010)Reaching Out From PL/SQL (OPP 2010)
Reaching Out From PL/SQL (OPP 2010)Lucas Jellema
 
Java power to the SOA developer (ODTUG Kaleidoscope 2010)
Java power to the SOA developer (ODTUG Kaleidoscope 2010)Java power to the SOA developer (ODTUG Kaleidoscope 2010)
Java power to the SOA developer (ODTUG Kaleidoscope 2010)Lucas Jellema
 
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...Lucas Jellema
 
The AMIS Report from Oracle Open World and JavaOne 2011 - Part One
The AMIS Report from Oracle Open World and JavaOne 2011 - Part OneThe AMIS Report from Oracle Open World and JavaOne 2011 - Part One
The AMIS Report from Oracle Open World and JavaOne 2011 - Part OneLucas Jellema
 
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...Lucas Jellema
 

Viewers also liked (6)

ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010
ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010
ODTUG Technical Journal - The Reusability Test - Fusion Column July 2010
 
Reaching Out From PL/SQL (OPP 2010)
Reaching Out From PL/SQL (OPP 2010)Reaching Out From PL/SQL (OPP 2010)
Reaching Out From PL/SQL (OPP 2010)
 
Java power to the SOA developer (ODTUG Kaleidoscope 2010)
Java power to the SOA developer (ODTUG Kaleidoscope 2010)Java power to the SOA developer (ODTUG Kaleidoscope 2010)
Java power to the SOA developer (ODTUG Kaleidoscope 2010)
 
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...
It's happening - on Event Driven SOA, Part Two (EDN patterns, ADF BC integrat...
 
The AMIS Report from Oracle Open World and JavaOne 2011 - Part One
The AMIS Report from Oracle Open World and JavaOne 2011 - Part OneThe AMIS Report from Oracle Open World and JavaOne 2011 - Part One
The AMIS Report from Oracle Open World and JavaOne 2011 - Part One
 
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...
What is the Oracle PaaS Cloud for Developers (Oracle Cloud Day, The Netherlan...
 

Similar to Xenogenetics

Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsMarian Marinov
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleGeoffrey De Smet
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With PhpJeremy Coates
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Coursemussawir20
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Thuan Nguyen
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Gosuke Miyashita
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution planspaulguerin
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with PerlDave Cross
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with JasmineTim Tyrrell
 
Serverless Functions and Vue.js
Serverless Functions and Vue.jsServerless Functions and Vue.js
Serverless Functions and Vue.jsSarah Drasner
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CDavid Wheeler
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web ModuleMorgan Cheng
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEnginedottedmag
 

Similar to Xenogenetics (20)

Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Sydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plansSydney Oracle Meetup - execution plans
Sydney Oracle Meetup - execution plans
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with Jasmine
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
Serverless Functions and Vue.js
Serverless Functions and Vue.jsServerless Functions and Vue.js
Serverless Functions and Vue.js
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
 
Symfony 1, mi viejo amigo
Symfony 1, mi viejo amigoSymfony 1, mi viejo amigo
Symfony 1, mi viejo amigo
 
Framework
FrameworkFramework
Framework
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web Module
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngine
 

More from Lucas Jellema

Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Lucas Jellema
 
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lucas Jellema
 
Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Lucas Jellema
 
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...Lucas Jellema
 
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...Lucas Jellema
 
Op je vingers tellen... tot 1000!
Op je vingers tellen... tot 1000!Op je vingers tellen... tot 1000!
Op je vingers tellen... tot 1000!Lucas Jellema
 
IoT - from prototype to enterprise platform (DigitalXchange 2022)
IoT - from prototype to enterprise platform (DigitalXchange 2022)IoT - from prototype to enterprise platform (DigitalXchange 2022)
IoT - from prototype to enterprise platform (DigitalXchange 2022)Lucas Jellema
 
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...Lucas Jellema
 
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...Lucas Jellema
 
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...Lucas Jellema
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Lucas Jellema
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...Lucas Jellema
 
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Lucas Jellema
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Lucas Jellema
 
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...Lucas Jellema
 
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)Lucas Jellema
 
Tech Talks 101 - DevOps (jan 2022)
Tech Talks 101 - DevOps (jan 2022)Tech Talks 101 - DevOps (jan 2022)
Tech Talks 101 - DevOps (jan 2022)Lucas Jellema
 
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Lucas Jellema
 
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...Lucas Jellema
 

More from Lucas Jellema (20)

Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
 
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
 
Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...Apache Superset - open source data exploration and visualization (Conclusion ...
Apache Superset - open source data exploration and visualization (Conclusion ...
 
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
 
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...Help me move away from Oracle - or not?!  (Oracle Community Tour EMEA - LVOUG...
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
 
Op je vingers tellen... tot 1000!
Op je vingers tellen... tot 1000!Op je vingers tellen... tot 1000!
Op je vingers tellen... tot 1000!
 
IoT - from prototype to enterprise platform (DigitalXchange 2022)
IoT - from prototype to enterprise platform (DigitalXchange 2022)IoT - from prototype to enterprise platform (DigitalXchange 2022)
IoT - from prototype to enterprise platform (DigitalXchange 2022)
 
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
 
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
 
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...Introducing Dapr.io - the open source personal assistant to microservices and...
Introducing Dapr.io - the open source personal assistant to microservices and...
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
 
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
 
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
 
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
 
Tech Talks 101 - DevOps (jan 2022)
Tech Talks 101 - DevOps (jan 2022)Tech Talks 101 - DevOps (jan 2022)
Tech Talks 101 - DevOps (jan 2022)
 
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
 
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
 

Xenogenetics

  • 1.
  • 2. Xenogenetics for PL/SQLInfusing with Java Best Practices and Design Patterns
  • 5. Xenogenetics for PL/SQLInfusing with Java Best Practices and Design Patterns
  • 6. Zĕn'ə-jə-nĕt'ĭks for PL/SQLInfusing with Java Best Practices and Design Patterns
  • 7.
  • 9.
  • 10.
  • 13.
  • 14. “Someone has already solved your problems”
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Design by Contract EncapsulationDecouplingAssertion
  • 22.
  • 23. procedure proc (p_name in varchar2 ,p_sal in number ,p_hiredate in date )
  • 24. Expectation regarding Valid Input procedure proc (p_name in varchar2 ,p_sal in number ,p_hiredate in date ) Agreed Contract
  • 25. package dbc is AssertFail exception; c_AssertFail constant integer := -20999; pragmaexception_init (AssertFail, -20999); procedure assert (p_check in boolean ,p_msg in varchar2 := null ); end dbc;
  • 26. procedure assert (p_check in boolean ,p_msg in varchar2 := null ) is begin if not nvl(p_check,false) -- fail on null input then raise_application_error ( c_AssertFail, 'Assertion Fail' ||': '||substr( nvl(p_msg, 'No Message') , 1, 200) ); end if; end assert;
  • 27. Validate Input procedure proc (...) is begin dbc.assert (p_name is not null ,'The Name must be Filled' ); dbc.assert ((p_sal is not null and p_sal > 0) ,'The Salary must be greater than zero' ); dbc.assert (p_hiredate >= trunc (sysdate) ,'Hiredate must be in the Future' ); ... end proc; proc.sql
  • 28. -- Description of this procedure -- -- %paramp_name Name of an Employee -- {*} Requirement Name must be provided -- -- %paramp_sal Salary of the Employee -- {*} Requirement Salary must be greater than zero -- -- %paramp_hiredateHiredate -- {*} Requirement Hiredate must be in the Future -- -- %raises DBC.AssertFail -- When a Parameter does not match the requirement
  • 30.
  • 31. (aka Inversion of Control) Advanced Decoupling Dependency Injection
  • 32.
  • 33.
  • 34. PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package HTTP Logger
  • 35. PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package PL/SQL Package HTTP Logger
  • 36. Dependency Injection- Traditional Approach Central Package instead of hard-coding c_mailserverc_interest_ratec_vat_ratec_file_in_namec_log_level APP_CONSTANTS Package Package Package
  • 37. True Injection Configuration Values property package value After Logon trigger mailserverinterest_ratevat_ratefile_in_namelog_levelurl_proxy emailertax_calctax_calcloggerloggerrss_reader amislin324.517.6app_log_xdebugamisvm2… setMailServer EMAILER setFileInName setLogLevel LOGGER setUrlProxy RSS_READER Dependency_Injector TAX_CALC setInterestRate setVatRate
  • 38. From mere Value Injection to Interface Injection A component can specify it requires some simple configuration values to be injected directory name, email address, discount percentage It can also stipulate that it wants some ‘helpers’ complete functional components for example: a Logger, an Emailer, a Discount Calculation Service, an Order Validation , etc. The component will prescribe the interface the injected helper must have Reuse is promoted through injected dependencies
  • 39. Interface Injection“If you give me a logger, I will write logging” Dependency_Injector LOGGER log_message( p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 ); set_loglevel_threshold( p_log_level in varchar2);set_file_writer( p_file_writer in varchar2 HRM_SALARY_RULES /* Logger interface: p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 */ set_logger (p_logger in varchar2)
  • 40. Interface Injection“If you give me a logger, I will write logging” Dependency_Injector HRM_SALARY_RULES /* Logger interface: p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 */ set_logger (p_logger in varchar2) NEW_LOGGER_IMPL Write_trace_message( p_log_level in varchar2 , p_log_origin in varchar2 , p_log_message in varchar2 );
  • 42. JSON Cross Session Communication
  • 45.
  • 46. session session CentralCache session session
  • 51. namespace Name : Value Name : Value Name : Value Name : Value Name : Value Name : Value context1.sql
  • 52. JavaScript Object Notation Lightweight data-interchange format
  • 54. Name : Value, Name : Value, Name : Value
  • 55. Name : Value, Name : Value, Name : Value Name : Value, Name : Value, Name : Value Name : Value, Name : Value, Name : Value , ,
  • 56. {"ACCOUNTING" : { "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } }
  • 57. <department name="ACCOUNTING"> <employees> <employee> <ename>KING</ename> <job>PRESIDENT</job> <sal>5000</sal> </employee> <employee> <ename>MILLER</ename> <job>CLERK</job> <sal>1300</sal> </employee> </employees> </department>
  • 58.
  • 60. Caching session Cache package session session session
  • 61. Caching session Cache package key value Alert Listener
  • 62. Worker Session Worker Session Package (single session) client Worker Session dbms_job Worker Session Worker Session
  • 63. Java Stored Procedure Unlocking the World
  • 65. Challenges Lack of Interaction Humans External Systems PL/SQL is limited
  • 66.
  • 67. Q
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73. From Xenophobia to Xenogenetics Established best practices in languages like Java can help improve use of PL/SQL Design by Contract, Encapsulation, Assertion, Reduced Impact of Changes Dependency Injection, Decoupling, Reuse Technical concepts in Java can have a meaningful counterpart in PL/SQL Data and Interaction across sessions
  • 74. From Xenophobia to Xenogenetics De-facto standards – such as JSON – may make sense in a PL/SQL context And open source PL/SQL libraries may exist Through Java Stored Procedures, PL/SQL can leverage Java capabilities & libraries To interact through additional channels To calculate, process, generate, interpret
  • 75.

Editor's Notes

  1. … and you don’t want to be sitting here [animation] when someone down here [animation] has already written this solution.
  2. ENCAPSULATION (hide implementation from consumers)Encapsulation: wijziging van implementatiezonderuiterlijkegevolgen; netter organiserenDecoupling: views, pl/sqlapiAssertion: verifieren van afgesproken contract
  3. When developing stored procedures, you agreed upon a specific interface, the signature of the stored procedure. Implicitly you agreed upon a contract. One using the Stored Procedure will know which parameters to supply and what will be returned by the stored procedure.In order to implement the stored procedure you make certain assumption about the supplied values for the parameters.Using Assertions you can make sure that the user of the Stored Procedures is faithful to the contract.Talen: webservices, javaElementen in contractDatatype (aantal, type, eisenaaninhoud)ExceptionsReturn SLA elementen: side effects – transactions/ nietbeschikbaarFunctionelebeschrijving
  4. Deel van assertions is er, datatype
  5. Do nothing or Complain Loudly
  6. This is
  7. Nice and optimistic interpretation:We do not want to burden you with the task(s) ofcalling us, keeping up to date with our latest contact details, being familiar with our internal procedures Let us handle the nitty gritty and just tell you what you need to know when you should know it
  8. EmailDirectoryurllogging
  9. EmailDirectoryurllogging
  10. Background parallel processing; information exchange between different processesWhy would you want cross session communication?Background processes for parallel processingSharing cache resultsInter-user communication…?
  11. Background parallel processing; information exchange between different processes
  12. Javakoffie
  13. Communication across sessions: Options: DBMS_PIPE – serialized in case of Public Pipes, only one session gets the informationQueueing – quite heavy Tables – always need transaction mechanism Application Context- no transaction neededApplication Context: storing name-value pairsKunnenalleen strings in
  14. Communication across sessions: Options: DBMS_PIPE – serialized in case of Public Pipes, only one session gets the informationQueueing – quite heavy Tables – always need transaction mechanism Application Context- no transaction neededApplication Context: storing name-value pairsKunnenalleen strings in
  15. Communication across sessions: Options: DBMS_PIPE – serialized in case of Public Pipes, only one session gets the informationQueueing – quite heavy Tables – always need transaction mechanism Application Context- no transaction neededApplication Context: storing name-value pairsKunnenalleen strings in
  16. Communication across sessions: Options: DBMS_PIPE – serialized in case of Public Pipes, only one session gets the informationQueueing – quite heavy Tables – always need transaction mechanism Application Context- no transaction neededApplication Context: storing name-value pairsKunnenalleen strings in
  17. JavascriptPhpWeb wereld
  18. Very compact, with lots of information.
  19. Same information, now represented in XML – lot more text
  20. Available Open Source projects for JSON in combination with PL/SQL
  21. Available Open Source projects for JSON in combination with PL/SQL
  22. Usually, jobs can only be used for batch programming (no synchronous response). However: a task can be divided up over various jobs – where each job does part of the work – and all jobs report back their result to the original thread (session) through a pipe
  23. The job is scheduled to run every minuteIt calls upon the Java Stored Procedure to retrieve the newly arrived email-messages – in a specific accountFor each message, an email event is enqueue in the AQ Queue. The new email-messages are subsequently removed.A queue listener has been registered on the queue with email eventsEvery email (event) is dequeued and processedThe email can contain query statements – in some form – that the processor knows how to handleThe reply to the query is then sent in an email message that forms the response to the original email messageNote: other listeners could dequeue the email events and process them in other waysIncoming messages from other sources could be retrieved and processed in a similar way as email messages (VOIP, SMS, IM/Chat, Twitter)The database can both send and retrieve messages from such serversNote: Java is much better equipped than plain PL/SQL (that really only has utl_http, utl_tcp, utl_smtp) for customized, flexible, advanced interaction with a wide range of infrastructures and technologies.
  24. Screenshot:Frank sends email to Maggie – with a query on EmployeesAfter some time, a response is sent to this particular email – by the queue listener using the JSP to send(list of employee data, corresponding with “query”)
  25. Java is much better equipped than plain PL/SQL (that really only has utl_http, utl_tcp, utl_smtp) for customized, flexible, advanced interaction with a wide range of infrastructures and technologies.Java libraries can help to generate PDF, create and/or read Word and Excel etc.Through JMS – external Java applications can be accessed in a decoupled way. For example: Complex Event Processor
  26. Write functional JavaFor example in JDeveloperUsing the full richness of the IDE and of the Java Language (and libraries)Wrap with PL/SQL Map Java &amp; PL/SQL data types Load into DatabaseCustom classes and libraries (JAR-files)Set appropriate privilegesInvoke JSP through a normal PL/SQL interface
  27. Look around youThink out of the the boxKeep an open mind
  28. Leverage Java – without the need to buy/install/maintain (middletier) additional infrastructureChannels: receiving emails, Instant Messaging (chatting)Processing/Generating (statistics, Excel, PDF, images, ..)