SoaML - ServiceInterface

From Training Material
Jump to navigation Jump to search

UML Collaboration and CollaborationUse

Please see: UML - Collaboration

Modelling Services using ServiceInterface

ServiceInterface:

  • Type of a service port
  • Can be bi-directional
  • Can have a protocol
  • Is defined from the perspective of the service provider using three primary sections:
    • the provided and required Interfaces (UML interfaces)
    • the ServiceInterface class
    • the protocol Behavior (activity, sequence or state diagram)


The provided and required Interfaces

  • are standard UML interfaces that are realized or used by the ServiceInterface
  • The realized interfaces specify
    • the value provided
    • the messages that will be received by the provider (and correspondingly sent by the consumer)
  • The used interfaces define
    • the value required
    • the messages or events that will be received by the consumer (and correspondingly sent by the provider)

The enclosed parts of the ServiceInterface

  • represent the roles that will be played by the connected participants
    • the role that is typed by the realized interface will be played by the service provider;
    • the role that is typed by the used interface will be played by the consumer.

The Behavior

  • specifies the valid interactions between the provider and consumer
  • it is the communication protocol of the interaction
  • constraining but without specifying how either party implements their role
  • any UML behavior specification can be used (interaction and activity diagrams are the most common)

Examples

ServiceInterface NobleProg Example.png

Instructions

  • A ServiceInterface is a UML Class and defines specific roles each participant plays in the service interaction
  • These roles have a name and an interface type
  • The interface of the provider (which must be the type of one of the parts in the class) is realized (provided) by the ServiceInterface class
    • In our example, the OutlineTarget interface is realized by the CourseOutlinePush serviceInterface
  • The interface of the consumer (if any) must be used by the class
    • In our example, CourseOutlineSource is used by the CourseOutlinePush interface

«ServiceInterface» CourseOutlinePush

  • Represents the service
  • The terms and conditions under which the service can be enacted and the results of the service
  • The service interface may be related to business goals or requirements (we want to 'push' the outline to another site)
  • The service interface can also be used in services architectures to show how multiple services and participants work together for a business purpose
  • This service interface is defined from the perspective of the provider of the service – the CourseOutlineSource

provider : CourseOutlineTarget

  • Defines the role of the provider in the CourseOutlinePush service
  • The type of the provider role is “CourseOutlineTarget”
  • This is the interface that a provider will require on a port to provide this service.

consumer: CourseOutlineSource

  • This is the role of the consumer in the courseOutlinePush service
  • The type of the consumer role is “CourseOutlineSource”
  • This is the interface that a consumer will implement on a port to consume this service
  • In the case of a one-directional service, there may not be a consumer interface

CourseOutlineTarget

  • The interface contain all the operations and signals a providing participant may receive when enacting this service

CourseOutlineSource

  • The interface for a CourseOutlinePush service consumer
  • This indicates all of the operations and signals a consuming participant will receive when enacting the service
  • In simple unidirectional services, the consumer interface may be missing or empty.

nobleprog.co.uk

  • A participant
  • The CourseOutlinePush ServiceInterface is used to type «servicePoint» ports and «requestPoint» ports of participants
  • The provider of the service uses a «servicePoint» port and the consumer of the service uses a «requestPoint» port
  • Since the 'nobleprog.co.uk' uses a «requestPoint» the “conjugate” interfaces are used – so the nobleprog.co.uk' port provides the CourseOutlineSource interfaces and uses the CourseOutlineTarget interface
  • Since they are conjugate, the ports on the nobleprog.co.uk and nobleprog.us can be connected to enact the service
  • When «requestPoint» is used the type name will be preceded with a tilde (“~”) to show that the conjugate type is being used

Exercise

  • Design a service interface for a PlaceOrderService using example above, use following words:

OrderPlacer, OrderTaker, submitOrder, confirmOrder, rejectOrder, orderProvider, orderConsumer