{"id":1849,"date":"2012-09-10T10:00:00","date_gmt":"2012-09-10T10:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/implementing-entity-services-using-nosql-part-2-contract-first.html"},"modified":"2012-10-22T06:57:35","modified_gmt":"2012-10-22T06:57:35","slug":"implementing-entity-services-using_8619","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html","title":{"rendered":"Implementing Entity Services using NoSQL &#8211; Part 2: Contract-first"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">It\u2019s time to begin the coding of my <a href=\"http:\/\/www.soaglossary.com\/entity_service.php\" target=\"_blank\" title=\"What is an Entity service?\">SOA entity service<\/a> with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at <a href=\"http:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_10.html\">Part 1<\/a> of this series.<\/p>\n<p>This technique of starting with a web service contract definition is at the heart of the \u2018contract-first\u2019 approach to service-oriented architecture implementation and has numerous technical benefits including\u2026<\/p>\n<ul>\n<li>Positive <a href=\"http:\/\/en.wikipedia.org\/wiki\/Service_Loose_Coupling#Logic-to-Contract\" target=\"_blank\">logic-to-contract<\/a> coupling (because the implementation code follows the contract).<\/li>\n<li>Positive <a href=\"http:\/\/en.wikipedia.org\/wiki\/Service_Loose_Coupling#Consumer-to-Contract\" target=\"_blank\">consumer-to-contract<\/a> coupling (because the consumer couples to the contract).<\/li>\n<li>Avoids contract-to-implementation coupling (where the implementation influences the contract).<\/li>\n<li>Avoids contract-to-technology coupling (where the consumer becomes dependent on the implementation technology).<\/li>\n<\/ul>\n<p>I don\u2019t want to go on about contract-first SOA, but it is really important. In fact it\u2019s the only method allowed by some web services frameworks such as the well respected <a href=\"http:\/\/static.springsource.org\/spring-ws\/sites\/2.0\/\" target=\"_blank\">Spring Web Services<\/a>. Springsource\u2019s reasoning for only supporting the contract-first method is explained in great detail <a href=\"http:\/\/static.springsource.org\/spring-ws\/sites\/2.0\/reference\/html\/why-contract-first.html\" target=\"_blank\">here<\/a>.         <\/p>\n<p><strong>The business case for my service.<\/strong>        <\/p>\n<p>I\u2019ve decided to implement a web service for managing \u2018Product\u2019 entities which I\u2019m going to refer to as the \u2018<i>Product Entity Service<\/i>\u2018. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Product_information_management\" target=\"_blank\" title=\"What is Product Information Management?\">Product information management<\/a> (or PIM for short) is a very common business activity and therefore, my entity service should have lots of re-use potential. I personally know this is true because of my previous retail and defence logistics experience, but if I wanted to prove this to be the case, I\u2019d normally analyse the business processes and look for all the places where product information is of benefit. If I did that I\u2019d probably find that the following business processes would be potential consumers of the Product Entity Service (in a traditional retail setting for example)\u2026         <\/p>\n<ul>\n<li>Buying, product purchasing and on-boarding<\/li>\n<li>Sales order capture<\/li>\n<li>Sales order fulfilment<\/li>\n<li>Customer service<\/li>\n<li>Catalogue production<\/li>\n<li>Business-2-Business enablement<\/li>\n<li>etc. etc.<\/li>\n<\/ul>\n<p><strong>My Product Entity Service\u2019s Operations.<\/strong>        <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Because I\u2019m creating a service that is purely tasked with managing the Product entities, I\u2019m going to keep the operations quite rudimentary. My service will offer consumers <strong><i>create, read, update, delete and find<\/i><\/strong> operations. The service will be a SOAP based web service with a WS-I interoperability certificate to help ensure cross platform compatibility with a wide range of consumers. I may, at a later date, also offer a REST version of the same service (often referred to as the <a href=\"http:\/\/www.soapatterns.org\/concurrent_contracts.php\">concurrent contracts<\/a> pattern).         <\/p>\n<p>My service consumers (possibly other services or processes) can then do with these Product entities whatever they like, for example by offering more business aligned features to support Product work-flows such as \u2018approve\u2019 or \u2018discontinue\u2019.         <\/p>\n<p>My service contract will be described using the Web Services Description Language (<a href=\"http:\/\/en.wikipedia.org\/wiki\/WSDL\" target=\"_blank\" title=\"What is a WSDL?\">WSDL<\/a>). I tend to hand craft these and then check them against the WS-I basic profile to make sure I\u2019ve created an interoperable contract. WSDL\u2019s are not particularly friendly files to work with, but any good SOA architect should be able to write one in my opinion.         <\/p>\n<p><strong>The Product Entity\u2019s data model.<\/strong>        <\/p>\n<p>A Product data entity should be capable of describing a real life Product that is of value to the business. Every business has its own ideas of what exactly this data item should contain, so in order to keep it simple I\u2019ll just define a few basic fields such as <i><strong>id, name, description, manufacturer, category, and size<\/strong><\/i>. I\u2019ll also add some housekeeping fields such as <i><strong>version, date created\/updated\/deleted<\/strong><\/i>, etc. It\u2019s best to think of this data as a \u2018document\u2019 as both SOA and NoSQL definitely benefit from a \u2018document-centric\u2019 view of the world.         <\/p>\n<p>The Product document will be described using XML Schema (i.e. as an <a href=\"http:\/\/en.wikipedia.org\/wiki\/XSD\" target=\"_blank\" title=\"What is an XSD or XML Schema Definition?\">XSD<\/a>). I also tend to do these by hand and I use lots of modularity in the structure to help support the <a href=\"http:\/\/www.soapatterns.org\/schema_centralization.php\" target=\"_blank\">schema centralisation<\/a> pattern which fosters reuse and interoperability amongst the data models used in SOA. This technique is often referred to as creating a \u2018canonical data model\u2019 that describes all the business entities within one central model.         <\/p>\n<p><strong>Creating the Java Service.<\/strong>        <\/p>\n<p>Now that the service contract is complete, I\u2019m ready to create my maven project and begin the implementation of the service. To do this I use the latest <a href=\"http:\/\/netbeans.org\/\" target=\"_blank\">Netbeans IDE<\/a> because it has great wizards for starting <a href=\"http:\/\/maven.apache.org\/\" target=\"_blank\">Maven<\/a> projects and importing WSDL\u2019s for implementation. Maven helps with code compilation, packaging, deployment and testing as well as managing dependencies and performing code generation for my services. Both of these tools are free.         <\/p>\n<p>The WSDL importing process creates a Java interface that represents and reflects the service\u2019s contract. It also creates a set of Java objects that represent the XML structures used by the service as messages. These objects are annotated by the import routine using JAXB annotations. <a href=\"http:\/\/www.oracle.com\/technetwork\/articles\/javase\/index-140168.html\" target=\"_blank\">JAXB<\/a> offers \u2018marshalling and unmarshalling\u2019 of XML text into Java objects. This happens invisibly behind the scenes as part of the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Java_API_for_XML_Web_Services\" target=\"_blank\">JAX-WS<\/a> web services framework.         <\/p>\n<p>All I have to do now is create an implementation of the methods on the service. In the first instance I simply add some basic boilerplate code just to get something working. Once that\u2019s done you I deploy the service to a server and do some basic integration testing to check it\u2019s all hanging together and that the service endpoint is being exposed as intended. The server I use for this is <a href=\"http:\/\/glassfish.java.net\/\" target=\"_blank\">Glassfish 3.1<\/a> from Oracle which can be integrated within Netbeans and is also free.         <\/p>\n<p><strong>Initial Service Integration Testing<\/strong>        <\/p>\n<p>I use <a href=\"http:\/\/www.soapui.org\/\" target=\"_blank\">SOAP UI<\/a> for my service testing because it\u2019s free and very capable. It can be used as a testing tool for almost any SOAP or REST service, and using a test harness like this will prevent me from having to build a working service client which can be quite time consuming.         <\/p>\n<p>I should mention that service development can be done in a completely test driven way with SOAP-UI but at the very start it\u2019s easier to have a basic service deployed (even if it doesn\u2019t work) just so that you can grab it\u2019s WSDL from it\u2019s endpoint using the \u201chttp:\/\/service?wsdl\u201d convention and check that everything is deployed and integrated correctly. If I didn\u2019t do this, I could get started just with the WSDL, but the endpoint location wouldn\u2019t work so tests would fail not because of bad logic but because of a general lack of service availability.         <\/p>\n<p>I\u2019m now able to create basic tests which pass Product messages backwards and forwards successfully between the service implementation hosted locally on Glassfish and the SOAP-UI test client, even if those messages don\u2019t do anything and the Products they contain don\u2019t get persisted yet.         <\/p>\n<p>The next stage is to begin the CouchDB integration so that the Product messages can be persisted and retrieved from the NoSQL database. Then, between the service and the CouchDB DAO I\u2019ll add any business logic that I need to make it all behave as it should.         <\/p>\n<p>Subscribe now to get an alert when I start the CouchDB DAO. If you missed Part 1 of this diary series you can <a href=\"http:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_10.html\" title=\"Implementing Entity Services using NoSQL \u2013 Part 1.\">catch-up here<\/a>.         <\/p>\n<p><strong>Costs so far:<\/strong>        <\/p>\n<ul>\n<li>Software \u2013 \u00a30.<\/li>\n<li>Time \u2013 2-to-8 hours (depending on experience).<\/li>\n<\/ul>\n<div>Continue to <a href=\"http:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_6090.html\">Part 3<\/a>.<\/div>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/benwilcock.wordpress.com\/2012\/07\/11\/implementing-entity-services-using-nosql-part-2\/\">Implementing Entity Services using NoSQL \u2013 Part 2: Contract-first<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Ben Wilcock at the <a href=\"http:\/\/benwilcock.wordpress.com\/\">SOA, BPM, Agile &amp; Java<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at Part 1 of this series. This technique of starting with a web service contract definition is at the heart of the \u2018contract-first\u2019 approach to service-oriented architecture implementation &hellip;<\/p>\n","protected":false},"author":268,"featured_media":57,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[116,113],"class_list":["post-1849","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-couchdb","tag-nosql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-09-10T10:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T06:57:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"136\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ben Wilcock\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ben Wilcock\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html\"},\"author\":{\"name\":\"Ben Wilcock\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2d350b077826f7d46a210509a397f080\"},\"headline\":\"Implementing Entity Services using NoSQL &#8211; Part 2: Contract-first\",\"datePublished\":\"2012-09-10T10:00:00+00:00\",\"dateModified\":\"2012-10-22T06:57:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html\"},\"wordCount\":1225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-couchdb-logo.jpg\",\"keywords\":[\"Apache CouchDB\",\"NoSQL\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html\",\"name\":\"Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-couchdb-logo.jpg\",\"datePublished\":\"2012-09-10T10:00:00+00:00\",\"dateModified\":\"2012-10-22T06:57:35+00:00\",\"description\":\"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-couchdb-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-couchdb-logo.jpg\",\"width\":150,\"height\":136},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/09\\\/implementing-entity-services-using_8619.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Implementing Entity Services using NoSQL &#8211; Part 2: Contract-first\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2d350b077826f7d46a210509a397f080\",\"name\":\"Ben Wilcock\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g\",\"caption\":\"Ben Wilcock\"},\"sameAs\":[\"http:\\\/\\\/benwilcock.wordpress.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Ben-Wilcock\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks","description":"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html","og_locale":"en_US","og_type":"article","og_title":"Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks","og_description":"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at","og_url":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-09-10T10:00:00+00:00","article_modified_time":"2012-10-22T06:57:35+00:00","og_image":[{"width":150,"height":136,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg","type":"image\/jpeg"}],"author":"Ben Wilcock","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ben Wilcock","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html"},"author":{"name":"Ben Wilcock","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2d350b077826f7d46a210509a397f080"},"headline":"Implementing Entity Services using NoSQL &#8211; Part 2: Contract-first","datePublished":"2012-09-10T10:00:00+00:00","dateModified":"2012-10-22T06:57:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html"},"wordCount":1225,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg","keywords":["Apache CouchDB","NoSQL"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html","url":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html","name":"Implementing Entity Services using NoSQL - Part 2: Contract-first - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg","datePublished":"2012-09-10T10:00:00+00:00","dateModified":"2012-10-22T06:57:35+00:00","description":"It\u2019s time to begin the coding of my SOA entity service with NoSQL project, and as promised I\u2019m starting with the web service\u2019s contract. Take a look at","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-couchdb-logo.jpg","width":150,"height":136},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/09\/implementing-entity-services-using_8619.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Implementing Entity Services using NoSQL &#8211; Part 2: Contract-first"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2d350b077826f7d46a210509a397f080","name":"Ben Wilcock","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56494aa90104dce5c0d913dc53446ba80d85fd0c49e799cc026cc39b0c521c98?s=96&d=mm&r=g","caption":"Ben Wilcock"},"sameAs":["http:\/\/benwilcock.wordpress.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Ben-Wilcock"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/268"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1849"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1849\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}