Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Implementation Components and Services

Similar presentations


Presentation on theme: "Software Implementation Components and Services"— Presentation transcript:

1 Software Implementation Components and Services

2 Component-based development
Component-based software engineering (CBSE) is an approach to software development that relies on the reuse of entities called ‘software components’. It emerged from the failure of object-oriented development to support effective reuse. Single object classes are too detailed and specific. Components are more abstract than object classes and can be considered to be stand-alone service providers.

3 CBSE essentials Independent components specified by their interfaces. Component standards to facilitate component integration. Middleware that provides support for component inter- operability. A development process that is geared to reuse.

4 CBSE and design principles
Apart from the benefits of reuse, CBSE is based on sound software engineering design principles: Components are independent so do not interfere with each other; Component implementations are hidden; Communication is through well-defined interfaces; One components can be replaced by another if its interface is maintained; Component infrastructures offer a range of standard services.

5 Components Szyperski:
A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third-parties. Components provide a service without regard to where the component is executing or its programming language A component is an independent executable entity that can be made up of one or more executable objects; The component interface is published and all interactions are through the published interface;

6 Component characteristics
Description Composable For a component to be composable, all external interactions must take place through publicly defined interfaces. In addition, it must provide external access to information about itself, such as its methods and attributes. Deployable To be deployable, a component has to be self-contained. It must be able to operate as a stand-alone entity on a component platform that provides an implementation of the component model. This usually means that the component is binary and does not have to be compiled before it is deployed. If a component is implemented as a service, it does not have to be deployed by a user of a component. Rather, it is deployed by the service provider.

7 Component characteristics
Description Documented Components have to be fully documented so that potential users can decide whether or not the components meet their needs. The syntax and, ideally, the semantics of all component interfaces should be specified. Independent A component should be independent—it should be possible to compose and deploy it without having to use other specific components. In situations where the component needs externally provided services, these should be explicitly set out in a ‘requires’ interface specification. Standardized Component standardization means that a component used in a CBSE process has to conform to a standard component model. This model may define component interfaces, component metadata, documentation, composition, and deployment.

8 Component interfaces Provides interface Requires interface
Defines the services that are provided by the component to other components. This interface, essentially, is the component API. It defines the methods that can be called by a user of the component. Requires interface Defines the services that specifies what services must be made available for the component to execute as specified. This does not compromise the independence or deployability of a component The ‘requires’ interface does not define how these services should be provided.

9 Component interfaces UML notation. Ball and sockets fit together.

10 A model of a data collector component

11 Examples of component models
A component model is a definition of standards for component implementation, documentation and deployment. Examples of component models EJB model (Enterprise Java Beans) COM+ model (.NET model) Corba Component Model The component model specifies how interfaces should be defined and the elements that should be included in an interface definition.

12 Elements of a component model
Interfaces Components are defined by specifying their interfaces. The component model specifies how the interfaces should be defined and the elements, such as operation names, parameters and exceptions, which should be included in the interface definition. Usage In order for components to be distributed and accessed remotely, they need to have a unique name or handle associated with them. This has to be globally unique. Deployment The component model includes a specification of how components should be packaged for deployment as independent, executable entities.

13 Component model implementations provide:
Middleware support Component models are the basis for middleware that provides support for executing components. Component model implementations provide: Platform services that allow components written according to the model to communicate; Support services that are application-independent services used by different components. To use services provided by a model, components are deployed in a container. This is a set of interfaces used to access the service implementations.

14 Middleware services defined in a component model

15 Making components reusable
Remove application-specific methods. Change names to make them general. Add methods to broaden coverage. Make exception handling consistent. Add a configuration interface for component adaptation. Integrate required components to reduce dependencies.

16 Component identification issues
Trust. You need to be able to trust the supplier of a component. At best, an untrusted component may not operate as advertised; at worst, it can breach your security. Requirements. Different groups of components will satisfy different requirements. Validation. The component specification may not be detailed enough to allow comprehensive tests to be developed. Components may have unwanted functionality. How can you test this will not interfere with your application?

17 Ariane launcher failure – validation failure?
In 1996, the 1st test flight of the Ariane 5 rocket ended in disaster when the launcher went out of control 37 seconds after take off. The problem was due to a reused component from a previous version of the launcher (the Inertial Navigation System) that failed because assumptions made when that component was developed did not hold for Ariane 5. The functionality that failed in this component was not required in Ariane 5. Let’s watch:

18 Component composition
The process of assembling components to create a system. Composition involves integrating components with each other and with the component infrastructure. Normally you have to write ‘glue code’ to integrate components.

19 Types of composition Sequential composition (1) where the composed components are executed in sequence. This involves composing the provides interfaces of each component. Hierarchical composition (2) where one component calls on the services of another. The provides interface of one component is composed with the requires interface of another. Additive composition (3) where the interfaces of two components are put together to create a new component. Provides and requires interfaces of integrated component is a combination of interfaces of constituent components.

20 Types of component composition

21 Glue code Code that allows components to work together If A and B are composed sequentially, then glue code has to call A, collect its results then call B using these results, transforming them into the format required by B. Glue code may be used to resolve interface incompatibilities.

22 Interface incompatibility
Parameter incompatibility where operations have the same name but are of different types. Operation incompatibility where the names of operations in the composed interfaces are different. Operation incompleteness where the provides interface of one component is a subset of the requires interface of another.

23 Components with incompatible interfaces

24 Adaptor components Address the problem of component incompatibility by reconciling the interfaces of the components that are composed. Different types of adaptor are required depending on the type of composition. An addressFinder and a mapper component may be composed through an adaptor that strips the postal code from an address and passes this to the mapper component.

25 An adaptor linking a data collector and a sensor

26 Photo library composition

27 Services are platform- and implementation-language independent
Reusable services Services are reusable components that are independent (no requires interface) and are loosely coupled. A web service is: A loosely coupled, reusable software component that encapsulates discrete functionality, which may be distributed and programmatically accessed. A web service is a service that is accessed using standard Internet and XML-based protocols. Services are platform- and implementation-language independent

28 Benefits of service-oriented approach
Services can be offered by any provider Organizations can create applications by integrating services from a range of providers. The service provider makes information about the service public Applications can delay the binding of services until they are deployed or until execution. Applications can be reactive and adapt their operation to cope with changes to their execution environment.

29 Benefits of a service-oriented approach
Opportunistic construction of new services is possible. New services that can be created by linking existing services in innovative ways. Service users can pay for services according to their use rather than their provision. Instead of buying a rarely-used component, developers can use an external service that will be paid for only when required. Applications can be made smaller. Computationally-intensive processing can be offloaded to external services.

30 Services scenario An in-car information system provides drivers with information on weather, road traffic conditions, local information etc. This is linked to car audio system so that information is delivered as a signal on a specific channel. The car is equipped with GPS receiver to discover its position and, based on that position, the system accesses a range of information services. Information may be delivered in the driver’s specified language.

31 A service-based, in-car information system

32 Advantage of services for this app
It is not necessary to decide when the system is programmed or deployed what service provider should be used or what specific services should be accessed. As the car moves around, the in-car software uses the service discovery service to find the most appropriate information service and binds to that. Because of the use of a translation service, it can move across borders and therefore make local information available to people who don’t speak the local language.

33 Service-oriented architectures
A means of developing distributed systems where the components are stand-alone services Services may execute on different computers from different service providers Standard protocols have been developed to support service communication and information exchange

34 Service-oriented architecture

35 Benefits of SOA Services can be provided locally or outsourced to external providers Services are language-independent Investment in legacy systems can be preserved Inter-organisational computing is facilitated through simplified information exchange

36 WSDL (Web Service Definition Language)
Key standards SOAP A message exchange standard that supports service communication WSDL (Web Service Definition Language) This standard allows a service interface and its bindings to be defined WS-BPEL A standard for workflow languages used to define service composition

37 Web service standards

38 Part of a WSDL description for a web service
Define some of the types used. Assume that the namespace prefixes ‘ws’ refers to the namespace URI for XML schemas and the namespace prefix associated with this definition is weathns. <types> <xs: schema targetNameSpace = “ xmlns: weathns = “ > <xs:element name = “PlaceAndDate” type = “pdrec” /> <xs:element name = “MaxMinTemp” type = “mmtrec” /> <xs: element name = “InDataFault” type = “errmess” /> <xs: complexType name = “pdrec” <xs: sequence> <xs:element name = “town” type = “xs:string”/> <xs:element name = “country” type = “xs:string”/> <xs:element name = “day” type = “xs:date” /> </xs:complexType> Definitions of MaxMinType and InDataFault here </schema> </types>

39 Part of a WSDL description for a web service
Now define the interface and its operations. In this case, there is only a single operation to return maximum and minimum temperatures. <interface name = “weatherInfo” > <operation name = “getMaxMinTemps” pattern = “wsdlns: in-out”> <input messageLabel = “In” element = “weathns: PlaceAndDate” /> <output messageLabel = “Out” element = “weathns:MaxMinTemp” /> <outfault messageLabel = “Out” element = “weathns:InDataFault” /> </operation> </interface>

40 RESTful web services Current web services standards have been criticized as ‘heavyweight’ standards that are over-general and inefficient. REST (REpresentational State Transfer) is an architectural style based on transferring representations of resources from a server to a client. This style underlies the web as a whole and is simpler than SOAP/WSDL for implementing web services. RESTful services involve a lower overhead than so-called ‘big web services’ and are used by many organizations implementing service-based systems.

41 The fundamental element in a RESTful architecture is a resource.
Resources The fundamental element in a RESTful architecture is a resource. Essentially, a resource is simply a data element such as a catalog, a medical record, or a document, such as this book chapter. In general, resources may have multiple representations i.e. they can exist in different formats. MS WORD PDF Quark XPress

42 Resource operations Create – bring the resource into existence. Read – return a representation of the resource. Update – change the value of the resource. Delete – make the resource inaccessible.

43 Resources and actions

44 Operation functionality
POST is used to create a resource. It has associated data that defines the resource. GET is used to read the value of a resource and return that to the requestor in the specified representation, such as XHTML, that can be rendered in a web browser. PUT is used to update the value of a resource. DELETE is used to delete the resource.

45 To request the temperatures for a specific date, a URL query is used:
Resource access When a RESTful approach is used, the data is exposed and is accessed using its URL. Therefore, the weather data for each place in the database, might be accessed using URLs such as: Invokes the GET operation and returns a list of maximum and minimum temperatures. To request the temperatures for a specific date, a URL query is used: example.net/temperatures/edinburgh?date=

46 The response to a GET request in a RESTful service may include URLs.
Query results The response to a GET request in a RESTful service may include URLs. If the response to a request is a set of resources, then the URL of each of these may be included. australia maryland

47 Disadvantages of RESTful approach
When a service has a complex interface and is not a simple resource, it can be difficult to design a set of RESTful services to represent this. There are no standards for RESTful interface description so service users must rely on informal documentation to understand the interface. When you use RESTful services, you have to implement your own infrastructure for monitoring and managing the quality of service and the service reliability.


Download ppt "Software Implementation Components and Services"

Similar presentations


Ads by Google