DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. SOA Principles: An Example App

SOA Principles: An Example App

Giancarlo Frison user avatar by
Giancarlo Frison
·
May. 28, 12 · Interview
Like (0)
Save
Tweet
Share
14.27K Views

Join the DZone community and get the full member experience.

Join For Free

soa describes a set of patterns for creating loosely coupled, standards-based business-aligned services that, because of the separation of concerns between description, implementation, and binding, provide a new level of flexibility.


service oriented architecture terminology has spread in recent years, at least among people who were involved in most of the information technology activities. the guidelines suggested by this methodology are granted as major factors to succeed in different distributable systems domains.
just as the definition is clear and easy to understand, so is its implementation into a real project, being intuitive, concise and elegant.

i have released an application demonstrating how soa’s principles can be applied into a small project making use of eip (enterprise integration pattern), ioc (inversion of control), and a building tool and scripting language such as groovy.

i analized a simple business case : an entertainment provider who wanted to dispatch rewards and bonuses to some of its customers, depending on customer service’s subscriptions.

the process sequence is simple:

it is required to provide an implementation of a rewardsservice. the service accepts as input a customer account number and a portfolio containing channels subscriptions. the customer status team is currently developing the eligibilityservice which accepts the account number as an input.


i set up an infrastructure to write acceptance tests for this first meaningful feature. this is what could be defined as a “walking skeleton,” a prototype with the essential aspect that it could be built, deployed and tested after being easily downloaded from github .

rewardservice is invoked by the client and it calls, in turn, the eligibility service which however, in this case is not  implemented. as many real scenarios expect external services, this proof-of-concept refers the eligibility service to a black-box, where only request/response interface is known.

the unit test simulates the eligibility service behaviors mocking the end-point through the camel testing framework. however, if you want to run the application on your local machine i set up , within a line of code, a faux eligibility service that merely returns a positive response:

def alwayseligible = {exchange -> if(exchange){exchange.getout().setbody('customer_eligible')}} as processor

the entry point is an http restful interface built upon the apache cxf, and is easily set up within few lines in the configuration . cxf is initialized by spring in this following way:

jaxrs.'server'(id:'restservice',address:'http://${http.host}:${http.port}') {jaxrs.'servicebeans'{ ref(bean:'rewardservice')} }

services are connected by apache camel. rewardservice contains only the reference of the esb context –  an instance of producertemplate . such solution allows a complete separation between the linking system and the business services. the camel context represents  the soa’s wiring, and is configured through a dsl as in the example below:

from('direct:rewards').to(eligibilityserviceendpoint)
SOA app

Published at DZone with permission of Giancarlo Frison, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How We Solved an OOM Issue in TiDB with GOMEMLIMIT
  • Key Elements of Site Reliability Engineering (SRE)
  • 7 Ways for Better Collaboration Among Your Testers and Developers
  • Utilizing Database Hooks Like a Pro in Node.js

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: