We present a framework for designing and composing services in a “call-by-contract” fashion, i.e. according to their behavior.
We discuss how to correctly plan service compositions in some relevant classes of services and behavioral properties. To this
aim, we propose both a core functional calculus for services, and a graphical design language. The core calculus features
primitives for selecting and invoking services that respect given behavioral requirements, typically safety properties on
the service execution history. A type and effect system over-approximates the actual run-time behavior of services. A further
static analysis step finds the viable plans that drive the selection of those services matching the behavioral requirements
on demand.