Web Services

Download Report

Transcript Web Services

™
Service-oriented Architecture
Principles, Practice, and IBM i
Rich Diedrich
[email protected]
Lab Services Power Systems Delivery Practice – IBM i
© 2014 IBM Corporation
What do I mean by a Service-oriented Architecture?
 Software architecture consisting of services
 Principles, not specific technologies
 Services
– Provide a business function
– Reusable
– Encapsulated
 Additional service properties
– Loosely coupled
– Stateless
– May reside on different platforms
2
© 2014 IBM Corporation
A service performs a business function and has several important
properties
 Performs business function
– Get information
– Perform action
 Properties
–
–
–
–
–
3
Encapsulated
Reusable
Stateless
Event driven
Loosely coupled
© 2014 IBM Corporation
An encapsulated interface hides the implementation
 Documented interface
– Web Services Description Language (WSDL)
– Can be done in other ways
 Internal implementation not exposed
– Changes in implementation do not affect consumers
– Enables platform changes
4
© 2014 IBM Corporation
Services should be designed to be reusable
 Services implement business function
– Interface should reflect actual business operations
– Questions to be asked:
• What are the business objects?
• What information needs to be returned from these objects?
• What operations can be performed on these objects
 Can be combined in new ways
– Not restricted to specific flow in traditional programs
 Can be used by new interfaces
– Trend is to have customers enter data themselves
– Desktops
– Phones
5
© 2014 IBM Corporation
Services are modular
 Definition
– Constructed in standardized units or dimensions for flexibility and variety in
use
 Modern Applications
– Rapidly changing requirements
– Wide variety of interfaces
• Different properties
• New interfaces on short notice
– State is driven by the interface
6
© 2014 IBM Corporation
ILE (Integrated Language Environment) enables modular coding in
IBM i languages
 Enables modular code
– Fast calls
– Fine grained reusable procedures
 Service programs
–
–
–
–
–
Common code
Dynamic binding
Encapsulation
Update capable
Activation can be deferred
 Teraspace
– Large storage allocation
7
© 2014 IBM Corporation
Stateless services are critical for reusability and scalability
 Service order may change based on interface
– Traditional application flow may not match user expectation
– Different users may request or enter information in different order
 Thousands of users entering data at once
– Not a few users doing mass entry
– Not feasible to assign a job to a user
 Library list situation
– Changing the library list may have performance impacts
– Important factor in consolidating systems
8
© 2014 IBM Corporation
Stateless programming can be a significant change for traditional
IBM i applications
 Monolithic programs are filled with state
–
–
–
–
User interface state interlaced with business logic
Difficult to separate
Deep structural problem
“Magic” solutions do not fix
 Two kinds of state
– Modal interface state
• Current screen
• Dictated by program flow
– Accumulated state
• “Shopping cart”
• Flexible operation order
9
© 2014 IBM Corporation
Traditional green screen flow
Customer
Entry
Address
Entry
10
Billing
Entry
Item
Entry
Order
Confirmation
© 2014 IBM Corporation
Web Flow
Customer
Items
Confirmation
Address
11
Billing
© 2014 IBM Corporation
Screen Scraping State Problem
12
Item
Information
Item
List
Wrong
State
Item
Information
Item
List
Item
Information
© 2014 IBM Corporation
Event driven
 Consumer controls flow
– Service is not driving
– Consumer may be a person or another process
 Consumer controls timing
– Service is very different than batch entry process
 Record locking becomes interesting
– Service cannot rely on notification of external process ending
– Pending transactions must be handled appropriately
13
© 2014 IBM Corporation
Loosely coupled
 Service may be consumed over a network
– Each interaction will have higher overhead
– Green screen is a very light and responsive interface
 Interface must be designed for higher latency
– Fewer calls with more data in each call
14
© 2014 IBM Corporation
Loosely coupled interfaces require larger grained calls for
performance
Lower overhead
Better performance
High overhead
Poor performance
Consumer
Provider
Consumer
Provider
© 2014 IBM Corporation
Service interfaces should be designed for extensibility
 Operations and parameters may need to be added
– Shouldn't break existing interfaces
– New operations
– Optional parameters
 Business object model is important
– Allows logical changes
 Original implementation may be limited
– Underlying data
– Available procedures
 Interfaces can be designed for future functionality
16
© 2014 IBM Corporation
Business Level Interfaces
Customer
Billing
Address
Item
Adjustments
17
Customer
Order
Customer
Billing
Address
Items
Price
Billing
Address
Item
Price
© 2014 IBM Corporation
What does implementing a service-oriented architecture mean to my
IBM i applications?
 Code modernization
– Separation of layers
– Modularization
– ILE RPG direction is toward modern coding practices
 Database modernization
– Integrity in database
– Use of SQL
 Development tools
– SEU no longer being enhanced
– RPG changes not recognized by SEU
18
© 2014 IBM Corporation
What are some steps to modernize an IBM i application?
 Develop/Update application programming process and standards
–
–
–
–
Current tools
Modular and service oriented code
Stateless when practical
Current language techniques
 Design new architecture
– Based on desired business process
– Understand the relationship to current architecture
 Use the architecture and standards as code is developed or
modified
– Develop reusable procedures for any new interfaces or functions
– Modify older code to use the procedures
19
© 2014 IBM Corporation
More steps in modernization:
 Some parts of an application may required dedicated projects
– Large programs
– Unmaintainable programs
 Some parts of an application may be left alone
– Rarely used
– Few users
 Start now!
– No magic solution
– Lots of hard work ahead
20
© 2014 IBM Corporation
That is a lot of change, how should it be prioritized?
 Prioritize business services
– Designed based on business functions
– Used with a variety of interfaces
– Used with rapidly changing requirements
 Not everything must be done immediately
– Infrequently used functions
– Limited set of users
– Infrequently changed
 Tactical tools
– HATS
– Open Access
 Watch for scope creep
21
© 2014 IBM Corporation
How can do I know that I can handle future technologies?
 How do I design for (name an interface technology)?
– Specific interface technologies will change
– The fundamental principles work across technologies
 Flight/400
– Modernized years ago
– Presented at LUG
– 2010 Lombardi presentation used the interfaces
 Integrated Web Services Server
– Compile service oriented procedure with integrated PCML option
– Web based wizard can expose as web service
– Service can be running in minutes
22
© 2014 IBM Corporation
What are some current technologies?
 Web Services
– SOAP
– REST
 IBM MQ
–
–
–
–
High function heterogeneous message queue
Request/response
Send and forget
Publish and subscribe
 IBM Integration Bus
– Can perform transforms
23
© 2014 IBM Corporation
Integrated Web Services for IBM i
 Server
– Rapidly deploy programs or procedures as web services
– Simple web based wizard
 Client
– Generate web services client code from WSDL
– C++, C, RPG stubs
 http://www-03.ibm.com/systems/power/software/i/iws/index.html
24
© 2014 IBM Corporation
What should I remember from this presentation?
 Principles are important
– Specific technologies will change
– Tooling will change
 Think about business functions
– Probably related to current application flow
– Needs to be thought through
 Use modern tools
– Increased productivity
– Continuing enhancements
 Get started
– The basic principles will apply in the future
– All the actual magic applies to modularized code
25
© 2014 IBM Corporation