Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with...

23
Nipissing University, Nor Nipissing University, Nor th Bay, Ontario, Canada th Bay, Ontario, Canada 1 Building Reusable Building Reusable Components with Service- Components with Service- Oriented Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation Grant Haibin Zhu, Ph.D. Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Dept. of Computer Science and mathematics, Nipissing University, 100 College Dr., North Nipissing University, 100 College Dr., North Bay, ON P1B 8L7, Canada Bay, ON P1B 8L7, Canada [email protected] [email protected] http://www.nipissingu.ca/faculty/haibinz http://www.nipissingu.ca/faculty/haibinz

Transcript of Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with...

Page 1: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, OntNipissing University, North Bay, Ontario, Canadaario, Canada

11

Building Reusable Components Building Reusable Components with Service-Orientedwith Service-Oriented

-IBM Eclipse Innovation Grant-IBM Eclipse Innovation Grant

Haibin Zhu, Ph.D.Haibin Zhu, Ph.D.Dept. of Computer Science and mathematics, Nipissing Dept. of Computer Science and mathematics, Nipissing

University, 100 College Dr., North Bay, ON P1B 8L7, CanadaUniversity, 100 College Dr., North Bay, ON P1B 8L7, [email protected]@nipissingu.ca

http://www.nipissingu.ca/faculty/haibinzhttp://www.nipissingu.ca/faculty/haibinz

Page 2: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 22

Nipissing UniversityNipissing University

Page 3: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 33

                                          

                  

Barrie 2.5

Brantford 4.5

Hamilton 4 - 4.5

Kitchener/ Waterloo

4.5

London 5.5

Ottawa 4 - 4.5

Owen Sound 4

Pembroke 2.5

Peterborough 3.5

Sault Ste. Marie 4.5 - 5

Sudbury 1.5

Timmins 4 - 4.5

Toronto 3.5 - 4

Page 4: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 44

ContentsContents

1.1. The Difficulties of Software ReuseThe Difficulties of Software Reuse

2.2. The Key Problems of Reusable The Key Problems of Reusable ComponentsComponents

3.3. Fundamental Architectures for ServicesFundamental Architectures for Services

4.4. Issues of Reusable ServicesIssues of Reusable Services

5.5. Conclusions Conclusions

Page 5: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 55

The Difficulties of Software ReuseThe Difficulties of Software Reuse

The initial idea of component-based development The initial idea of component-based development is learning from the hardware industry to reuse is learning from the hardware industry to reuse hardware components such as integrated circuits hardware components such as integrated circuits (IC), large-scale integrated circuit (LSI), very large (IC), large-scale integrated circuit (LSI), very large scale integrated circuits (VLSI), chips, chip-sets, scale integrated circuits (VLSI), chips, chip-sets, boards, etc boards, etc

Reusing hardware components is well accepted, Reusing hardware components is well accepted, because in hardware engineering, to understand a because in hardware engineering, to understand a component is much easier than to make it. component is much easier than to make it.

It is impossible for application developers to It is impossible for application developers to develop hardware components such as chips and develop hardware components such as chips and boards.boards.

Page 6: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 66

The Difficulties of Software ReuseThe Difficulties of Software Reuse

It is possible for application developers to develop It is possible for application developers to develop software components such as a program segment, a software components such as a program segment, a function, or even a class.function, or even a class.

In the software industry, a software component either is In the software industry, a software component either is too simple or has too complicated specifications. too simple or has too complicated specifications. – If it is too simple, the programmers believe that they can make it If it is too simple, the programmers believe that they can make it

by themselves. by themselves. – If the specifications are too complex, the situation is that, after If the specifications are too complex, the situation is that, after

understanding the component’s specification, the programmers understanding the component’s specification, the programmers believe that they can make a better one by themselves.believe that they can make a better one by themselves.

Page 7: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 77

The Difficulties of Software ReuseThe Difficulties of Software Reuse

The key difficulty is to make specifications The key difficulty is to make specifications much simpler than the implementation logic.much simpler than the implementation logic.

Service-oriented architectures brought about Service-oriented architectures brought about new light to the research and practice of new light to the research and practice of reusable components, because the reusable components, because the “register, find, bind and execute” paradigm “register, find, bind and execute” paradigm is a good style for software development. is a good style for software development.

Page 8: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 88

Make services more reusableMake services more reusable One is that we must provide the services that are One is that we must provide the services that are

difficult to develop and we should have an difficult to develop and we should have an advanced development environment that is difficult advanced development environment that is difficult or expensive for application developers to build or or expensive for application developers to build or purchase. purchase.

The other one is that we should make the services The other one is that we should make the services easy to apply and we should provide cheap easy to apply and we should provide cheap service application tools that are easy and cheap service application tools that are easy and cheap to install. to install.

That is why the “register, find, bind and execute” That is why the “register, find, bind and execute” paradigm is a possible way to make more paradigm is a possible way to make more reusable components.reusable components.

Page 9: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 99

Fundamental Architectures for Fundamental Architectures for ServicesServices

Centralized service center Centralized service center

Service Center One URL with many services

Application 3

Application 1

Application 4

Application 2

Page 10: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1010

Architectures (2)Architectures (2)

Distributed Service Center Distributed Service Center

One URL with many services

Application 3

Application 1

Application 4

Application 2

Service provider 2

Service provider 3

Service provider 4

Service provider 1

Service center

Page 11: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1111

Architectures (3)Architectures (3)

Distributed service providers with Distributed service providers with centralized service registry centralized service registry

A Service registry One URL with many

services

Application 3

Application 1

Application 4

Application 2

Service provider 2

Service provider 3

Service provider 4

Service provider 1

Page 12: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1212

Architectures (4)Architectures (4)

Distributed Service Providers and Distributed Service Providers and Service Registries Service Registries

Application 3

Application 1

Application 4

Application 2

Service provider 1

Service provider 3

Service provider 2

Service provider 4

Page 13: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1313

Issues of Reusable ServicesIssues of Reusable Services

Questions:Questions:– How can we make a service easily understood? Or how How can we make a service easily understood? Or how

could we make a service with a shorter cognitive could we make a service with a shorter cognitive distance? distance?

– How can service providers convince service requestors How can service providers convince service requestors that their services are just what the requestors ask for? that their services are just what the requestors ask for?

– How can application developers evaluate services? How can application developers evaluate services? – How can we compare the financial benefits between How can we compare the financial benefits between

buying services and developing by ourselves? buying services and developing by ourselves? – How can we guarantee the performance of an How can we guarantee the performance of an

application with services? application with services?

Page 14: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1414

Service SpecificationService Specification

S ::= <N, P, I, R, M>, where, S ::= <N, P, I, R, M>, where, – N is the name of the service provider (internally an N is the name of the service provider (internally an

identification or Universal Resource Locator (URL) of identification or Universal Resource Locator (URL) of the service provider); the service provider);

– P is the pattern of the service (the simplest form of the P is the pattern of the service (the simplest form of the pattern is the name of the service and the most complex pattern is the name of the service and the most complex form is the complete function description of the service); form is the complete function description of the service);

– I is the format of inputs of the service; I is the format of inputs of the service; – R is the format of returned results of the service; and R is the format of returned results of the service; and – M is the implementation of the service.M is the implementation of the service.

Page 15: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1515

A Good Reusable ServiceA Good Reusable Service

(1) Tdev(M) >> Tund(P) which means that (1) Tdev(M) >> Tund(P) which means that the time to implement a service should be the time to implement a service should be greatly larger than the time to understand greatly larger than the time to understand the service patternthe service pattern

(2) Q(I+R) << Q(M) that means that the (2) Q(I+R) << Q(M) that means that the space occupied by the input data and the space occupied by the input data and the result data should be greatly less than the result data should be greatly less than the space occupied by the service including space occupied by the service including data and processes. data and processes.

Page 16: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1616

Service RegistryService Registry A service registry stores and manages a collection of service A service registry stores and manages a collection of service

specifications or a set of bindings between a service name and a specifications or a set of bindings between a service name and a service specification. service specification.

Sspec ::= <N, P, I, R, Y>, where Y is the semantics description of the Sspec ::= <N, P, I, R, Y>, where Y is the semantics description of the service. service.

To manage service specifications with Java, a service registry can be To manage service specifications with Java, a service registry can be expressed by a class Registry that implements the Map interface expressed by a class Registry that implements the Map interface where the key of an entry for this map is a service patter P and the where the key of an entry for this map is a service patter P and the value is a service provider, a service input format, a returning result value is a service provider, a service input format, a returning result format, and a semantics description of the service, i.e., <N, I, R, Y>.format, and a semantics description of the service, i.e., <N, I, R, Y>.

Considering the situations of overloading, a value may consists a list of Considering the situations of overloading, a value may consists a list of <N, I, R, Y>. <N, I, R, Y>.

A service registry should support different kinds of search methods for A service registry should support different kinds of search methods for service requesters to search a service. service requesters to search a service.

Page 17: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1717

Service NegotiationService Negotiation

(1) Concise and understandable: it should be easy to (1) Concise and understandable: it should be easy to understand. This is the same as the requirement for understand. This is the same as the requirement for service interfaces. service interfaces.

(2) Clear and rigid: every item should be clear and without (2) Clear and rigid: every item should be clear and without ambiguity. ambiguity.

(3) Concrete and easily evaluated: for every service it (3) Concrete and easily evaluated: for every service it should be easy to evaluate the quality of a service or to should be easy to evaluate the quality of a service or to check if the service is completed. check if the service is completed.

A contract for a service is defined as x ::= < Sspec, t, cs, A contract for a service is defined as x ::= < Sspec, t, cs, cp>, where, cp>, where, – Sspec is a service specification; Sspec is a service specification; – t is the performance requirement to complete the service; t is the performance requirement to complete the service; – cs is the cost of the service; and cs is the cost of the service; and – cp is the penalty to the service provider’s failing to meet the cp is the penalty to the service provider’s failing to meet the

performance requirement. performance requirement.

Page 18: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1818

Service Service discovery discovery and and negotiationnegotiation

Service discovery and negotiation thread

Search one?

An exact interface is found.

A contract is sent out to the requester.

Bind the service and execute.

Search the available service execution sites.

A new interface is sent out to the requester.

An interface whose parts matched is found.

Does the requester agree?

contract.

No

Reject the request.

Nothing in the service list is matching the request.

Search the request in the storage of service specifications.

Yes

A service request is coming.

Got one? A contract with a

degraded performance is sent out to the service.

requester.

Got the signed contract from the service

requester?

Yes

No

Does the requester agree?

Yes

Yes

Waiting expired!

Waiting expired!

Page 19: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 1919

Service BindingService Binding

When an application is working, there might still be new When an application is working, there might still be new service providers joining the service network. The service service providers joining the service network. The service requester should be able to apply the new service if it costs requester should be able to apply the new service if it costs less or provides better performance. less or provides better performance.

“ “Static” means that the services will be determined before Static” means that the services will be determined before the application is running and “dynamic” means that the the application is running and “dynamic” means that the services might be determined when the application is services might be determined when the application is running. running.

By “dynamic”, we have another meaning which is that the By “dynamic”, we have another meaning which is that the services might be removed and replaced with a new services might be removed and replaced with a new service. In this way, we need a facility to constantly contact service. In this way, we need a facility to constantly contact the service providers and regularly compare and select the the service providers and regularly compare and select the most economic services. most economic services.

Page 20: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 2020

Listening to new servicesListening to new services

Negotiatable?

A relevant contract whose parts matched is found.

No

Yes

Is a new service posted?

Get one? An exact contract is found.

Compare the contracts.

Modify the service identification of the

application.

Nothing in the service list is matching the new service.

Request the contract of the new service and check if a contract is

signed for the same service.

The service discovery thread

Is the new one better?

Yes

No

Send out the service specification and the

service provider will post a new service.

Page 21: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 2121

Service ExecutionService Execution

Call-by-value or call-by-reference?Call-by-value or call-by-reference? If we consider the address space of all the interconnected If we consider the address space of all the interconnected

computers as one logical data space. computers as one logical data space. The service must reside on the computers of the service The service must reside on the computers of the service

provider provider The service is able to be transferred to other computers. The service is able to be transferred to other computers. We may transfer the data to be processed, or we may We may transfer the data to be processed, or we may

transfer the executable code of the service if the service transfer the executable code of the service if the service code is less than the data quantity and the computing code is less than the data quantity and the computing power of the application developer is enough. Transferring power of the application developer is enough. Transferring codes is especially appropriate to the trustworthy service codes is especially appropriate to the trustworthy service providers. providers.

Page 22: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 2222

ConclusionConclusion A service as a reusable unit is more appropriate for reusing A service as a reusable unit is more appropriate for reusing

software, because the logic of a service is generally so software, because the logic of a service is generally so complicated that it is much easier for the service complicated that it is much easier for the service requesters to understand the contract than to implement requesters to understand the contract than to implement the service by themselves. In this way, service requesters the service by themselves. In this way, service requesters do not care and cannot care about the details of service do not care and cannot care about the details of service implementations. This is a large step towards reusable implementations. This is a large step towards reusable components. components.

Potential topics:Potential topics:– Standardize service specification languages;Standardize service specification languages;– Provide more practical mechanisms for service publications;Provide more practical mechanisms for service publications;– Implement high performance service registry and service Implement high performance service registry and service

discovery;discovery;– Provide rigid contract negotiation tools; Provide rigid contract negotiation tools; – Implement dynamic service binding; andImplement dynamic service binding; and– Develop strategies where the service execution should be located.Develop strategies where the service execution should be located.

Page 23: Nipissing University, North Bay, Ontario, Canada 1 Building Reusable Components with Service-Oriented -IBM Eclipse Innovation Grant -IBM Eclipse Innovation.

Nipissing University, North Bay, Ontario, CanadaNipissing University, North Bay, Ontario, Canada 2323

Question and Comments ?Question and Comments ?