{"id":799,"date":"2013-06-01T10:43:20","date_gmt":"2013-06-01T16:43:20","guid":{"rendered":"http:\/\/garysamuelson.com\/blog\/?p=799"},"modified":"2013-07-28T21:47:22","modified_gmt":"2013-07-29T03:47:22","slug":"osgi-and-jpa-deliver-business-objects-to-bpm","status":"publish","type":"post","link":"http:\/\/garysamuelson.com\/blog\/?p=799","title":{"rendered":"OSGi and JPA Deliver Business Objects to BPM"},"content":{"rendered":"<hr \/>\n<p><em><strong>Multi-part Series:<\/strong> <\/em><\/p>\n<ol>\n<li><a title=\"BPM Integration with OSGI: JAX-RS and JPA\" href=\"http:\/\/garysamuelson.com\/blog\/?p=774\">BPM Integration with OSGI: JAX-RS and JPA<\/a><\/li>\n<li><em><strong>(this article) <\/strong><\/em><strong> <\/strong>JPA OSGi Bundle Delivers (Java) Business Domain Objects<\/li>\n<li><a title=\"JSON Formatted Business Information through DOSGi (JAX-RS ReST Services)\" href=\"http:\/\/garysamuelson.com\/blog\/?p=918\">JSON Formatted Business Information through DOSGi (JAX-RS ReST Services) <\/a><\/li>\n<li><a title=\"BPM Service and Web-client Consumers for JSON over ReST\" href=\"http:\/\/garysamuelson.com\/blog\/?p=1038\">BPM Service and Web-client Consumers for JSON over ReST<\/a><\/li>\n<\/ol>\n<hr \/>\n<h3><em><strong>Forward<\/strong><\/em><\/h3>\n<p>OSGi and JPA provide the means for rapid turn-around on integration features. I won&#8217;t deny the fact that there&#8217;s still complexity out there swimming beneath our mixed up, legacy back-office systems. But, no matter how complicated the waters may be there is no excuse for avoiding continuous integration.<\/p>\n<p>OSGi encapsulates new code with tight control on version management. Websphere, at the server layer, allows real-time switching between integration bundles. JPA (with annotations and JAXB) makes database integration easy&#8230; relatively speaking.<\/p>\n<h1>OSGi and JPA Deliver Business Objects to BPM<\/h1>\n<p style=\"padding-left: 30px;\"><a href=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright  wp-image-809\" title=\"Business Objects from JPA\" alt=\"\" src=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40.png\" width=\"327\" height=\"524\" srcset=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40.png 519w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40-187x300.png 187w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40-93x150.png 93w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-01_11h13_40-400x641.png 400w\" sizes=\"auto, (max-width: 327px) 100vw, 327px\" \/><\/a><em>In context: JPA marshals Java objects between JAX-RS and database.<\/em><\/p>\n<h2>View from BPM<\/h2>\n<p>From a BPM perspective, &#8220;business objects&#8221; are &#8220;java objects&#8221;. The relationship, or glue, between the ReST service and everything else below that layer is&#8230; <em><b>technically<\/b><\/em><strong> inconsequential from a business-value perspective<\/strong> (overlooking DBMS properties and performance for now).<\/p>\n<p>A good metaphor is the relationship between your cell phone and a conversation. What&#8217;s important is that we&#8217;re able to make contact and talk. In terms of relationships and outcomes &#8211; the cell-phone itself acts as a bridge. A bridge that&#8217;s only noticed when it fails to meet expectations.<\/p>\n<p>Ironically, something that &#8220;just needs to work&#8221; really MUST work. And here&#8217;s the inverse relationship between infrastructure and BPM:<\/p>\n<p style=\"padding-left: 30px;\"><em><strong>If infrastructure gets noticed then&#8230; it&#8217;s not getting enough attention!<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<h2>Technical View<\/h2>\n<p>Object Relational Mapping (ORM) must be seamless &#8211; incurring little to no resistance between business intent and delivered value from services.<\/p>\n<p><strong>Premium qualities include:<\/strong><\/p>\n<ol start=\"1\">\n<li><em><b>Transparency of features and implementation<\/b><\/em><strong> &#8211;<\/strong> Supports testing. And, if it misses expectations or simply breaks&#8230; we need source-code visibility and access.<\/li>\n<li><em><b>Fine grain visibility and control for version and configuration management<\/b><\/em><strong> &#8211;<\/strong> (again) If it breaks&#8230; we need to find out where, who, and when. Goal is discrete application of: features, fixes, and reversal of poor configuration or code.<\/li>\n<li><em><b>Reasonable and well understood technology<\/b><\/em><strong> &#8211;<\/strong> Open source typically makes this happen. Meaning that an open\/adopted standard brings with it a small army of followers, shared ideas, and ubiquitous documentation.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>OSGi with JPA Technology and Tools<\/h2>\n<p><a href=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright  wp-image-911\" title=\"OSGi, JPA, and Tools\" alt=\"\" src=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01.png\" width=\"413\" height=\"443\" srcset=\"http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01.png 850w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01-279x300.png 279w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01-139x150.png 139w, http:\/\/garysamuelson.com\/blog\/wp-content\/uploads\/2013\/06\/2013-06-06_10h00_01-400x428.png 400w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><\/a>For this exercise I used both Eclipse and Rational Application Developer (RAD). Eclipse Juno was used for building a deployment for IBM&#8217;s new Websphere Liberty server and RAD for Websphere Application server v8.5 (WAS). Both Eclipse (Juno) and RAD incorporated Dali Java Persistence tools though RAD added a few additional features &#8211; notably a code generator for Entity Manager.<\/p>\n<p><strong>Eclipse and RAD examples:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">Walk-through showing Eclipse Juno with IBM&#8217;s Liberty tools. Deployment is Liberty<\/p>\n<ul>\n<li><a title=\"Eclipse (Juno) with Websphere Liberty deployment (example and tutorial)\" href=\"http:\/\/garysamuelson.com\/liberty_osgi_jaxrs_jpa_01\/WebsphereLibertyProfileOSGiandJPA.html\">Eclipse (Juno) with Websphere Liberty deployment (example and tutorial)<\/a><\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\">Walk-through using Rational Application Developer (RAD) v9 beta. Deployment is on Websphere v8.5. <strong>This is the most complete (and well-written) tutorial.<\/strong> Includes a JPA test harness and transactions for OSGi. Both Eclipse (Juno) and RAD tools are almost identical. RAD does offer a code generator for &#8220;entity manager&#8221; &#8211; however, the generated code required some slight re-work. See &#8220;appendix&#8221; (at end-of page) for code listings.<\/p>\n<ul>\n<li><a title=\"Rational Application Developer for Websphere Application Server (example and tutorial)\" href=\"http:\/\/garysamuelson.com\/liberty_osgi_jaxrs_jpa_01\/OSGi%20and%20JPA%20WebsphereRAD%20Workbook.html\">Rational Application Developer for Websphere Application Server (example and tutorial)<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Multi-part Series: BPM Integration with OSGI: JAX-RS and JPA (this article) JPA OSGi Bundle Delivers (Java) Business Domain Objects JSON Formatted Business Information through DOSGi (JAX-RS ReST Services) BPM Service and Web-client Consumers for JSON<a class=\"moretag\" href=\"http:\/\/garysamuelson.com\/blog\/?p=799\"> Read more&hellip;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,16,17,4],"tags":[],"class_list":["post-799","post","type-post","status-publish","format-standard","hentry","category-business-process-management-best-practices","category-business-process-management-integration","category-bpm-integration-technology","category-software-architecture"],"_links":{"self":[{"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=799"}],"version-history":[{"count":56,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions"}],"predecessor-version":[{"id":813,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/799\/revisions\/813"}],"wp:attachment":[{"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/garysamuelson.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}