Design patterns - ICIN 2010


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Design patterns - ICIN 2010

  1. 1. Session 7b Future Ideas Analysis of Design Patterns for Composite Telco Services Corrado Moiso - Strategy & Innovation, Telecom Italia R. Minerva, A. Manzalini - Strategy & Innovation, Telecom Italia P. Baglietto, M. Maresca, M. Stecca - CIPI University of Genoa and Padua All rights reserved
  2. 2. The issue <ul><li>IT-based interfaces to monitor and control Telco capabilities are a consolidated approach: </li></ul><ul><ul><li>services defined as a combination of functions offered by them; </li></ul></ul><ul><li>Telco composite services strongly rely on: </li></ul><ul><ul><li>processing of asynchronous events generated by the capabilities; </li></ul></ul><ul><ul><li>executing (concurrent) activities; </li></ul></ul><ul><ul><li>handling long-running transactions with several interactions with the capabilities; </li></ul></ul><ul><li>The languages adopted for Telco composite services must: </li></ul><ul><ul><li>dynamically create, destroy and synchronize execution threads; </li></ul></ul><ul><ul><li>receive and process asynchronous events; </li></ul></ul><ul><ul><li>build and maintain logical contexts to execute long-running transactions; </li></ul></ul><ul><li>The complexity of these mechanisms suggests to define a set of (language independent) design patterns; </li></ul>
  3. 3. Composite services a reference model Composite Service Component Service Component Service Component Service Telco Capability Telco Capability Telco Capability Heterogeneous protocols (e.g., capability specific) Interfaces based on basic interaction primitives Command Assist Event Basic interaction primitives
  4. 4. Basic interaction primitives <ul><li>Command : </li></ul><ul><ul><li>the application issues a request (e.g., an action invocation, or a data access); the capability processes it and immediately returns a response; </li></ul></ul><ul><li>Event : </li></ul><ul><ul><li>the capability notifies an event to an application which previously expressed an interest; </li></ul></ul><ul><li>Assist : </li></ul><ul><ul><li>the capability sends a request to an application (previously registered) which returns a response with the instruction on how to perform an action; </li></ul></ul>
  5. 5. Request-Response interaction pattern <ul><li>Client-Server interactions </li></ul>Composite Service Component Service Command Commands processed by the Component Service CommandRes The Composite Service waits for the result Command CommandRes
  6. 6. Notification interaction pattern <ul><li>Pub-Sub model </li></ul>Command (Subscribe: EventDescr, CBref ) CommandRes (SubscribeRes: SubID ) Subscription to a specific event class to start notifications Composite Service Component Service Command (UnSubscribe: SubID ) CommandRes (UnSubscribeRes: SubID ) Unsubscription to stop notifications Event1 Event (Notify: Event1, SubID ) Processing of events performed by Composite Service according to the logic of CBref Eventn Events of the Component Service (notified to all the subscribed application) Event (Notify: Eventn, SubID )
  7. 7. Request-started transaction interaction pattern <ul><li>Application-started Transaction </li></ul>The Component Service starts of a new “activity” Command (StartActivity: Descr, CBref ) CommandRes (StartRes: SessID ) Composite Service Component Service Event (ChangeStatus, SessID ) Command (ModifyExecution, SessID ) Monitoring and control (in pull and/or push mode via CBref ) of the activity Execution of the activity performed by the Component Service Assist (InstructionRequest, SessID )
  8. 8. Solicit-started transaction interaction pattern <ul><li>Component Service-started Transaction </li></ul>Command (Subscribe: ActivityDescr,CBref) CommandRes (SubscribeRes: SubID ) Subscription to a specific class of activities that the application has to monitor/control Composite Service Component Service Notification of an activity to be controlled by the subscribed application Assist (Activity, SubID , SessID ) AssistRes(Instruction) Monitoring and control (in pull and/or push mode) of the activity Execution of the activity performed by the Component Service Event (ChangeStatus, SessID ) Command (ModifyExecution, SessID ) Assist (InstructionRequest, SessID )
  9. 9. Interaction Patterns and existing interfaces – some examples Interaction Pattern Examples from OSA Examples from Parlay X Examples from Ribbit Examples from Ringful Request-Response User Location (pull mode) Short Messaging - Receive (pull mode) API – Messages (send and retrieval) SMS API - SendSms (without response) Notification User Location (periodic/ triggered events) Terminal Loc. (periodic/ triggered events) API - Messages (reception of events) Request-started trans. Multi-Party Call (appl. initiated)   API - Calls Conference Call API Request-started trans. (only pull) Charging Session Third Party Call Solicit-started transaction Multi-Party Call (network initiated) Call Direction
  10. 10. Request-started transaction in Parlay X 3rd Party Call <ul><li>Parlay X 3rd Party Call does not support notification: </li></ul><ul><ul><li>the call are monitored/controlled in pull-mode; </li></ul></ul>MakeCallSessionReq(Leg1, Leg2) MakeCallSessionRes( CallSessionIdentifier ) Composite Service Third Party Call Service The Component Service starts of a new call EndCallSessionReq( CallSessionIdentifier ) EndCallSessionRes() The thread periodically polls the state of the call GetCallSessionInformationRes(CallInfo) GetCallSessionInformationReq( CallSessionIdentifier ) GetCallSessionInformationRes(CallInfo) GetCallSessionInformationReq( CallSessionIdentifier )
  11. 11. Request-started transaction in Ribbit Call Control <ul><li>Ribbit allows to control calls also in push-mode: </li></ul><ul><ul><li>combined use of Call and Event APIs; </li></ul></ul>Composite Service Call API Application API PUT /apps/mydomain:myapp/ { &quot;notificationUrl&quot; : Ref } 200 OK {Appl-Info} POST /rest/1.0/calls/… { &quot;legs&quot;:[Leg1, Leg2]} 201 CREATED LOCATION Call-Id POST Json={Call-Event} Event processed by Ref Events on call evolution POST Json={Call-Event} PUT /rest/1.0/calls/ Call-Id { &quot;active&quot;:false } 200 OK { Call-Info}
  12. 12. Design Patterns <ul><li>Provide guidelines on how to implement composite services interacting with component services; </li></ul><ul><li>A design pattern for each interaction pattern: </li></ul><ul><ul><li>describe the structure of an orchestrator defining the composition logic; </li></ul></ul><ul><li>Language independent: </li></ul><ul><ul><li>possible mappings on Java and WS-BPEL; </li></ul></ul>
  13. 13. Request-started transaction Design Pattern <ul><li>The orchestrator has to perform the following operations: </li></ul><ul><ul><li>setup a Software Listener to handle push-mode control </li></ul></ul><ul><ul><li>send the request that initiates the transaction: </li></ul></ul><ul><ul><ul><li>the request include the callback URL to the Software Listener </li></ul></ul></ul><ul><ul><ul><li>the response returns a Context_ID ; </li></ul></ul></ul><ul><ul><li>manage the creation/interaction of threads: </li></ul></ul><ul><ul><ul><li>for each (new) Context_ID the orchestrator activates a long running thread in charge of: </li></ul></ul></ul><ul><ul><ul><ul><li>managing and monitoring the resource activity and </li></ul></ul></ul></ul><ul><ul><ul><ul><li>proactively performing some operations; </li></ul></ul></ul></ul><ul><ul><ul><li>a long running thread: </li></ul></ul></ul><ul><ul><ul><ul><li>is executed in parallel with other long running threads; </li></ul></ul></ul></ul><ul><ul><ul><ul><li>is triggered by events tagged with the associated Context_ID; </li></ul></ul></ul></ul><ul><ul><ul><ul><li>works on its own data and on some information shared with other threads; </li></ul></ul></ul></ul>
  14. 14. Design Patterns mapping <ul><li>BPEL based solution: </li></ul><ul><ul><li>need to follow the BPEL syntax and organization; </li></ul></ul><ul><ul><li>support developers through low level features (e.g., automatic correlation event - CS instance); </li></ul></ul><ul><li>Plain Java object based solution: </li></ul><ul><ul><li>more flexible than BPEL based solution; </li></ul></ul><ul><ul><li>significant skill and effort to the developers; </li></ul></ul><ul><ul><li>re-implement the patterns every time a new CS is developed; </li></ul></ul>
  15. 15. Some open issues: Composite Service Session ID <ul><li>the Orchestrator Execution Platform should use csSessionID s to: </li></ul><ul><ul><li>identify CS sessions/instances executed simultaneously; </li></ul></ul><ul><ul><li>associate events to the appropriate CS Sessions, in case of a Callback based Design Pattern; </li></ul></ul><ul><li>SubID and SessID may not be sufficient to handle csSessionID s: </li></ul><ul><ul><li>they are at service level, and not at CS instance level; </li></ul></ul><ul><ul><li>they are related to specific component services; </li></ul></ul><ul><li>csSessionID s are not properly considered in the APIs for capabilities: </li></ul><ul><ul><li>it is necessary to manage the correspondence between the csSessionID s coming from the Orchestrator and the events issued by the Components; </li></ul></ul><ul><li>Possible solutions </li></ul><ul><li>adding a software module between Orchestrator and Component Services: </li></ul><ul><li>extending callback-based APIs with a general purpose parameter ( extrainfo ); </li></ul>
  16. 16. Parental Control Service – a use case <ul><li>the service: </li></ul><ul><ul><li>it controls the location of a child’s terminal; </li></ul></ul><ul><ul><li>as soon as the user leaves a defined area two third party calls (e.g., to the mother, and to the father) are triggered at the same time; </li></ul></ul><ul><ul><li>as soon as one call is activated, the other is dropped; </li></ul></ul><ul><li>the composite service orchestrates: </li></ul><ul><ul><li>Parlay X Location: “Notification Design Pattern”; </li></ul></ul><ul><ul><li>Ribbit Call and Event APIs: “Request Started Transaction Design Pattern”; </li></ul></ul>
  17. 17. BPEL for Parental Control Service Notification Design Pattern Request Started Transaction Design Pattern
  18. 18. Parental Control Service : the role of csSessionID s <ul><li>A BPEL-based Orchestrator provides the Correlation Set concept for csSessionID management (e.g., to dispatch incoming messages); </li></ul><ul><li>Unfortunately it is not possible to take advantage of this mechanism with the current generation APIs: </li></ul><ul><ul><li>most of them do not include extraInfo parameter, to exchange the csSessionID between Orchestrator and external services; </li></ul></ul><ul><li>For instance: </li></ul><ul><ul><li>in the parental control service the BPEL engine would not be able to dispatch the incoming events (e.g., Call instantiated) to the appropriate BPEL instances; </li></ul></ul>APIs without extraInfo parameter are not suitable to be combined by means of widely used BPEL language
  19. 19. The role of csSessionID s in Java <ul><li>The usage of the extraInfo parameter is very useful also when implementing the design patterns in Java: </li></ul><ul><ul><li>it supports the correlation between the incoming events and the corresponding Orchestration Sessions </li></ul></ul><ul><li>For instance: </li></ul><ul><ul><li>a Java-based Orchestrator may use a table storing the set of the csSessionIDs of the active Sessions, e.g.: </li></ul></ul><ul><ul><ul><li>an HashMap: <csSessionID, instance_ref> ; </li></ul></ul></ul><ul><ul><li>it can be matched with the extraInfo parameter contained in the incoming events notifications; </li></ul></ul>
  20. 20. Lessons learnt (1/2) <ul><li>higher degree of flexibility and efficiency in the interactions with Service Components requires the use of a more complex design pattern, e.g., </li></ul><ul><ul><li>notifications in addition to the commands </li></ul></ul><ul><ul><li>retrieve information in push mode rather than in pull mode </li></ul></ul><ul><ul><li>handling of multiple service sessions </li></ul></ul><ul><li>the complexity of the design patterns does not depend on the protocol used to define the interfaces (e.g., CORBA, SOAP, REST): </li></ul><ul><ul><li>it depends on the expression power of the interactions enabled by the interfaces </li></ul></ul>The definition of APIs for Telco Capabilities must carefully identify the interaction patterns (instead of the protocols to adopt)
  21. 21. Lessons learnt (2/2) <ul><li>the composition/orchestration of multiple interfaces requires the definition of CS SessionIDs at the level of Composite Service: </li></ul><ul><ul><li>they identify a specific session/instance of the composite service </li></ul></ul><ul><ul><li>they are needed to properly route events to the service session in charge of their execution </li></ul></ul>Signatures of APIs for Telco Capabilities should be extended with a new parameter to pass “CS Session ID” between Composite Service and Service Components
  22. 22. Thanks ! Questions?