WWW 2008 / Poster Paper April 21-25, 2008 · Beijing, China Towards a Programming Language for Services Computing Arun Kumar IBM India Research Laboratory 4, Block C, Institutional Area, Vasant Kunj, New Delhi 110070, India D Janakiram Dept. of Comp. Sc. & Engg. Indian Institute of Technology Madras, Chennai-600036, Tamil Nadu, India kkarun@in.ibm.com d.janakiram@cs.iitm.ernet.in ABSTRACT Services Computing is emerging as a new discipline. The acceptance of web services technology stems from the fact that services enable easy integration and interop eration of enterprise level distributed systems. However, currently software develop ers are forced to translate business level service requirements and encode them into programs using low level abstractions such as ob jects. We prop ose to introduce language constructs for Service Oriented Programming that would enable raising programming abstractions from ob jects to services. Categories and Sub ject Descriptors: D.3.3 [Programming Languages]: Language Constructs and Features [data typ es and structures, inheritance] General Terms: Languages, Design model [2] that applies the abstraction principle of classification to services and defines the concepts of service typ es and service instances [2, 1]. Service typ es capture the semantic description of the service primarily in terms of its interface description. A service instance, on the other hand, provides an op erational description of a service and represents an actual running instance. Web Service S/w Development Environment Other Libraries Developer Registry of ServiceType Definitions Compile Time Phase Deployable Program (Program with Service Type variables and unbound ServiceInstance Variables) Binding Component Executable Program Execution Engine 1. INTRODUCTION Limited Registry Search of Service Instances Available Services Run Time Phase Interop erability and manageability in the presence of heterogeneity are two very imp ortant concerns for enterprise IT system managers. Services computing promises to ease these problems by creating an infrastructure of loosely coupled comp onents residing in an heterogeneous framework. This has lead to several research efforts that explore ways of increasing the level of automation in service discovery, invocation, comp osition and interop eration [1, 4]. However, the current services based software development model suffers from several drawbacks. The develop ers are forced to take into consideration dynamics of the runtime environment since services are actively running comp onents rather than passive function/class libraries. Further, the develop ers are required to map high level service requirements to programming constructs available in current OO languages such as Java and C#. There is a clear mismatch b etween the needs of services software develop er and the programming models available today. In this pap er, we prop ose new language constructs that enable programming with services and discuss some b enefits arising from such an approach. Web Service Runtime Execution Environment Figure 1: Programming Model for Services Figure 1 shows the resulting programming model for service oriented software development that enables to split the development process across design time and runtime phases. This is essential to shield the develop ers from the dynamics of runtime environment. As shown in the figure, the development environment provides a service typ es registry using which the develop ers could program to service interfaces without worrying ab out live instances. These service oriented programs could then b e deployed by binding the service variables to actual running instances available at that time. The runtime execution environment provides access to instances registry. To utilize this programming model, we introduce two new language constructs namely ServiceType and ServiceInstance. ServiceTyp es and ServiceInstances are analogous to Classes and Ob jects, resp ectively, yet different. While ServiceTyp es refer to definition of a service just like a class defines an entity and ServiceInstance refers to a live service similar to ob jects, the difference lies in the fact that b oth ServiceTyp es and ServiceInstances are first class entities. Classes are typically not first class entities such as in C++. The ServiceTyp e variables can b e used to encode logic applicable at compile time while ServiceInstance variables allow encoding of logic applicable at runtime. They could b e declaratively defined as partially shown in 2. PROGRAMMING WITH SERVICES In this section, we build up on our previous work [3] that prop osed granting a first class status to services. The prop osal used a semantic web services based representation Copyright is held by the author/owner(s). WWW 2008, April 21­25, 2008, Beijing, China. ACM 978-1-60558-085-2/08/04. 1153 WWW 2008 / Poster Paper ServiceType{ functionalSpec{ interfaceTypeA{ inputTypes { .. }; outputTypes { .. }; preconditions { .. }; effects { .. }; }; .... }; modelDescription{ .. }; stateDescription { }; nonFunctionalReqmts{ }; } ServiceInstance{ serviceTypeRef; operationalSpec{ interfaceA{ inputs {..}; outputs{..}; } .... } state{ } nonFunctionalCapability{ } binding{ } } April 21-25, 2008 · Beijing, China instance and verifying the health of the instance by invoking their management interfaces. The functional methods are invoked by referring to the interface names (such as interfaceA in Fig. 2) through the ServiceInstance variable. Queries for interface descriptions are supp orted by invoking an appropriate op eration on the associated ServiceTyp e. Such op erations on instances would help automatic agents to programmatically interpret and subsequently invoke the interface of new services. The management commands and health check op erations are dep endent up on the management interfaces implemented by the instances. 3. RELATED WORK ServiceJ [4] prop oses extensions to Java to enable supp ort for service oriented computing in OO languages. Declarative language constructs are prop osed to transparently deal with service selection at runtime as well as for applying a filtering and ranking criteria. However, their extensions deal primarily with non-functional asp ects and it is not clear how their compiler works without having access to functional description of services available at compile time. The ServiceTyp e and ServiceInstance constructs prop osed in this pap er address the functional as well as non-functional asp ects of services in a unifying development framework. Zimmermann et al. [6] motivate the need for a Service Oriented Analysis and Design (SOAD) approach that leverages and builds up on existing approaches of Ob ject Oriented Analysis and Design (OOAD), Enterprise Architecture frameworks and Business Process Modeling concepts. Papazoglou [5] provides a detailed comparison b etween services in SOA and ob jects in OOAD. However, they felt that concepts like p olymorphism etc. are not applicable to SOA. The language constructs prop osed by us enable such OO features by raising the programming abstraction from ob jects to services. Figure 2: ServiceType and ServiceInstance Fig. 2. Alternatively, ServiceTyp e could b e defined with the help of service typ e descriptions available in the typ es registry. The definition in such a case would take the form: new ServiceType(XMLFileRef FS, XMLFileRef MD, XMLFileRef SD, XMLFileRef NFR) ServiceTyp e construct is comp osed of four elements - a functional sp ecification containing various interface descriptions, a model description, description of State in terms of a list of data typ es, and constraints on non-functional capabilities of service instances. Similarly, ServiceInstance could also b e defined with the help of service instance descriptions in instances registry as given b elow: new ServiceInstance(serviceTypeRef, XMLFileRef OS, XMLFileRef State, XMLFileRef NFC, XMLFileRef binding) The 'new' op eration here creates a new ServiceInstance entity and binds it to an actual running service instance, in the services registry, whose service details are provided through the XMLFile references in the parameters. The functional sp ecification in the ServiceTyp e definition enables the software develop ers to write logic that reasons up on the functionality of the service they are dealing with. The op erational sp ecification in ServiceInstances allows logic that invokes the service's functionality. Operations on Service Types are defined based up on the notion of classification, comp osition and inheritance defined for services in [2], -Classification: isEquivalentTo(ST) returns a degree of match b etween the current service typ e and the service typ e supplied as parameter; isBound() returns true if a service typ e has b een instantiated or b ound to at least one instance; getInstance(ST) returns an existing b ound ServiceInstance or creates a new binding to an actual running service instance and returns it as a ServiceInstance; isServiceTypeOf(SI) returns a value indicating a degree of match i.e. direct typ e of the service instance vs a sup er typ e in chain. - Comp osition: isComposedOf(ListofSTs) and isComponentOf(CompositeST) return a true if the current service typ e is comp osed of the supplied list of service typ es and if it is a comp onent of the supplied service typ e resp ectively. - Inheritance: isSuperTypeOf(ST) and isSubTypeOf(ST) return true if the current service typ e is a sup ertyp e and if it is a subtyp e of the sp ecified service typ e resp ectively. Operations on Service Instance variables include the functional methods (i.e. actual functionality offered by the instance) and others op erations that are related to querying the interface descriptions or sending commands to the 4. CONCLUSION We have prop osed programming language constructs to enable programming with services. The constructs incorp orate well established ob ject oriented software development principles such as classification, comp osition and inheritance into a service oriented programming model. We are currently in the process of developing a compiler for introducing these constructs as extensions to Java. 5. REFERENCES [1] V. Agarwal, K. Dasgupta, N. Karnik, A. Kumar, A. Kundu, S. Mittal, and B. Srivastava. A Service Creation Environment based on End to End Comp osition of Web Services. In Proceedings of WWW, May 2005. [2] A. Kumar, A. Neogi, and D. J. Ram. An OO Based Semantic Mo del for Service Oriented Computing. In Proc. of IEEE SCC, USA, Sept. 2006. [3] A. Kumar, S. Pragalapati, A. Neogi, and D. Janakiram. Raising Programming Abstraction from Ob jects to Services. In Proceedings of ICWS, July 2007. [4] S. D. Lab ey, M. van Do oren, and E. Steegmans. ServiceJ: - A Java Extension for Programming Web Service Interaction. In Proc. of IEEE ICWS, Jul 2007. [5] M. P. Papazoglou. Service-Oriented Computing: Concepts, Characteristics and Directions. In Proc. of WISE, Dec 2003. [6] O. Zimmermann, P. Krogdahl, and C. Gee. Elements of Service-Oriented Analysis and Design: An interdisciplinary mo deling approach for SOA pro ject. http://www.ibm.com/developerworks/webservices/ library/ws-soad1/, June 2004. 1154