60
Component-Based Component-Based Software Engineering Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to de software systems with componen and system integration.

Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Embed Size (px)

Citation preview

Page 1: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component-Based Component-Based Software EngineeringSoftware Engineering

X LIU, School of Computing, Napier University

TIP This chapter will present

a complete picture of how to develop software systems with components

and system integration.

Page 2: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Reuse: Past and PresentReuse: Past and Present

• reuse is both an old and a new idea. reuse is both an old and a new idea. Programmers have reused ideas, abstractions, Programmers have reused ideas, abstractions, and processes since the earliest days of and processes since the earliest days of computing.computing.

• the early approach to reuse was ad hoc. the early approach to reuse was ad hoc.

• Today, complex, high quality computer-based Today, complex, high quality computer-based systems must be built in very short time systems must be built in very short time periods. This mitigates towards a more periods. This mitigates towards a more organized approach to reuse.organized approach to reuse.

Page 3: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

What is Component-Based What is Component-Based Software Engineering Software Engineering (CBSE)(CBSE)• CBSE is a process that emphasizes the design CBSE is a process that emphasizes the design

and construction of computer-based systems and construction of computer-based systems using reusable software components. using reusable software components.

• CBSE is changing the way large software CBSE is changing the way large software systems are developed. CBSE embodies the systems are developed. CBSE embodies the “buy, do not build” philosophy espoused by “buy, do not build” philosophy espoused by some software engineers.some software engineers.

• CBSE shifts the emphasis from programming CBSE shifts the emphasis from programming software to composing software systems.software to composing software systems.

Page 4: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

What is Component-Based What is Component-Based Software Engineering Software Engineering (CBSE)(CBSE)• Implementation has given way to Implementation has given way to

integration as the focus. integration as the focus.

• The foundation of CBSE is the assumption The foundation of CBSE is the assumption that there is sufficient commonality in that there is sufficient commonality in many large software systems to justify many large software systems to justify developing reusable components to developing reusable components to exploit and satisfy that commonality.exploit and satisfy that commonality.

Page 5: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Architectural design & Architectural design & identification of identification of composition candidatecomposition candidate• CSBE process begins with establishing CSBE process begins with establishing

requirements for the system using requirements for the system using conventional requirements elicitation conventional requirements elicitation techniques. techniques.

• After architectural design established, rather After architectural design established, rather than moving immediately into detailed design than moving immediately into detailed design tasks, the team examines requirements to tasks, the team examines requirements to determine what subsets are directly amenable determine what subsets are directly amenable to to compositioncomposition, rather than construction, rather than construction

Page 6: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Architectural design & Architectural design & identification of identification of composition candidatecomposition candidate• The criteria are:The criteria are:

– Are commercial off-the-shelf (COTS) Are commercial off-the-shelf (COTS) components available to implement the components available to implement the requirement?requirement?

– Are internally-developed reusable components Are internally-developed reusable components available to implement the requirement?available to implement the requirement?

– Are the interfaces for available components Are the interfaces for available components compatible within the architecture of the compatible within the architecture of the system to be built?system to be built?

Page 7: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Architectural design & Architectural design & identification of identification of composition candidatecomposition candidate• The team attempts to modify or remove The team attempts to modify or remove

those system requirements that cannot be those system requirements that cannot be implemented with COTS or in-house implemented with COTS or in-house components. components.

• If the requirement cannot be changed or If the requirement cannot be changed or deleted, conventional or object-oriented deleted, conventional or object-oriented software engineering methods are applied to software engineering methods are applied to develop these new components that must be develop these new components that must be engineered to meet the requirement. engineered to meet the requirement.

Page 8: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component EngineeringComponent Engineering

For those requirements that are addressed For those requirements that are addressed with available components, the following with available components, the following software engineering activities must be done:software engineering activities must be done:

Component qualificationComponent qualification

Component adaptation.Component adaptation.

Component composition. Component composition.

Component update. Component update.

Page 9: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component qualificationComponent qualification

• System requirements and architecture define System requirements and architecture define the components that will be required.the components that will be required.

• Reusable components are normally identified by Reusable components are normally identified by the characteristics of their interfaces. That is, the characteristics of their interfaces. That is, “the services that are provided, and the means “the services that are provided, and the means by which consumers access these services”. by which consumers access these services”.

• However, the interface does not provide the However, the interface does not provide the degree to which the component will fit the degree to which the component will fit the architecture and requirements.architecture and requirements.

Page 10: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component adaptationComponent adaptation

• Software architecture represents design patterns Software architecture represents design patterns that are composed of components connections, that are composed of components connections, and coordination. In some cases, existing and coordination. In some cases, existing reusable components may be mismatched to the reusable components may be mismatched to the architecture’s design rules. These components architecture’s design rules. These components must be adapted to meet the needs of the must be adapted to meet the needs of the architecture or discarded and replaced by other architecture or discarded and replaced by other more suitable components.more suitable components.

• For example, some components are configurable For example, some components are configurable through parameterisation.through parameterisation.

Page 11: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

• Architectural style again plays a key role Architectural style again plays a key role in the way in which software components in the way in which software components are integrated to form a working system. are integrated to form a working system.

• By identifying connection and By identifying connection and coordination mechanisms (e.g., run-time coordination mechanisms (e.g., run-time properties of the design), the architecture properties of the design), the architecture dictates the component of the end-dictates the component of the end-product.product.

Page 12: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component updateComponent update

• When systems are implemented with When systems are implemented with COTS components, update is complicated COTS components, update is complicated by the imposition of a third party. The by the imposition of a third party. The organisation that developed the reusable organisation that developed the reusable component may be outside the component may be outside the immediate control of the software immediate control of the software engineering organisation.engineering organisation.

Page 13: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Classification of Classification of ComponentsComponents

• Software components can also be characterised Software components can also be characterised based on their use in the CBSE process. In based on their use in the CBSE process. In addition to COTS components, the CBSE addition to COTS components, the CBSE process yields:process yields:

• Qualified components—assessed by software Qualified components—assessed by software engineers to ensure that not only functionality, engineers to ensure that not only functionality, but also performance, reliability, usability, and but also performance, reliability, usability, and other quality factors conform to the other quality factors conform to the requirements of the system/product to be built.requirements of the system/product to be built.

Page 14: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Classification of Classification of ComponentsComponents

• Adapted components—adapted to modify Adapted components—adapted to modify (wrapping) unwanted or undesired characteristics.(wrapping) unwanted or undesired characteristics.

• Assembled components—integrated into an Assembled components—integrated into an architectural style and interconnected with an architectural style and interconnected with an appropriate component infrastructure that allows appropriate component infrastructure that allows the components to be coordinated and managed the components to be coordinated and managed effectively.effectively.

• Updated components—replacing existing software Updated components—replacing existing software as new versions of components become available.as new versions of components become available.

Page 15: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

The CBSE processThe CBSE process

• The CBSE process includes to identify candidate The CBSE process includes to identify candidate components, to qualify each component’s interface, components, to qualify each component’s interface, to adapt components to remove architectural to adapt components to remove architectural mismatches, to assembly components into a mismatches, to assembly components into a selected architectural style, and to update selected architectural style, and to update components as requirements for the system change.components as requirements for the system change.

• The process model for component-based software The process model for component-based software engineering emphasizes parallel tracks in which engineering emphasizes parallel tracks in which domain engineering occurs concurrently with domain engineering occurs concurrently with component-based development.component-based development.

Page 16: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

The CBSE processThe CBSE processDomain Engineering

Component-BasedDevelopment

DomainAnalysis

TestingComponentEngineering

ArchitecturalDesignAnalysis

ReusableComponent

Development

SoftwareArchitectureDevelopment

DomainModel

StructuralModel

ComponentQualification

ComponentAdaptation

ComponentComposition

ComponentUpdate

RepositoryReusableArtifacts/

Components

ApplicationSoftware

Page 17: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Domain EngineeringDomain Engineering

• The intent of domain engineering is to The intent of domain engineering is to identify, construct, catalogue, and identify, construct, catalogue, and disseminate a set of software components disseminate a set of software components that have applicability to existing and future that have applicability to existing and future software in a particular application domain. software in a particular application domain.

• The overall goal is to establish mechanisms The overall goal is to establish mechanisms that enable software engineers to share that enable software engineers to share these components—to reuse them.these components—to reuse them.

Page 18: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Domain EngineeringDomain Engineering

• Domain engineering includes three major Domain engineering includes three major activities: activities:

– analysisanalysis

– construction, and construction, and

– dissemination.dissemination.

Page 19: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

The domain analysis The domain analysis processprocess• An 8 step approach to the identification and categorisation of An 8 step approach to the identification and categorisation of

reusable componentsreusable components

– select specific functions/objectsselect specific functions/objects

– abstract functions/objectsabstract functions/objects

– define a taxonomydefine a taxonomy

– identify common featuresidentify common features

– identify specific relationshipsidentify specific relationships

– abstract the relationshipsabstract the relationships

– derive a functional modelderive a functional model

– define a domain languagedefine a domain language

Page 20: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

A guide for identifying A guide for identifying reusable componentsreusable components

• Is the component functionality required Is the component functionality required on future implementation?on future implementation?

• How common is the component’s function How common is the component’s function within the domain?within the domain?

• Is there duplication of the component’s Is there duplication of the component’s function within the domain?function within the domain?

• Is the component hardware-dependent?Is the component hardware-dependent?

Page 21: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

A guide for identifying A guide for identifying reusable componentsreusable components

• Does the hardware remain unchanged Does the hardware remain unchanged between implementations?between implementations?

• Can the hardware specifics be removed to Can the hardware specifics be removed to another components?another components?

• Is the design optimized enough for the next Is the design optimized enough for the next implementation?implementation?

• Can we parameterize a non-reusable Can we parameterize a non-reusable components so that it becomes reusable?components so that it becomes reusable?

Page 22: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

A guide for identifying A guide for identifying reusable componentsreusable components

Is the component reusable in many Is the component reusable in many implementations with only minor implementations with only minor changes?changes?

Is reuse through modification feasible?Is reuse through modification feasible?

Can a non-reusable component be Can a non-reusable component be decomposed to yield reusable decomposed to yield reusable components?components?

Page 23: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Domain CharacteristicsDomain Characteristics• It is sometimes difficult to determine whether a It is sometimes difficult to determine whether a

potentially reusable component is applicable in a potentially reusable component is applicable in a particular situation. A set of domain characteristics particular situation. A set of domain characteristics may be defined to make this determination. may be defined to make this determination.

• A domain characteristic is shared by all software A domain characteristic is shared by all software within a domain. It defines generic attribute of all within a domain. It defines generic attribute of all products that exist within the domain. E.g., generic products that exist within the domain. E.g., generic characteristics might include: the importance of characteristics might include: the importance of safety/reliability, programming language, safety/reliability, programming language, concurrency in processing. concurrency in processing.

Page 24: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component qualification--Component qualification--DefinitionDefinition

• Component qualification ensures that a Component qualification ensures that a candidate component candidate component

– will perform the function required, will perform the function required,

– will properly fit into the architectural will properly fit into the architectural style specified for the system, and style specified for the system, and

– will exhibit the quality characteristics will exhibit the quality characteristics (e.g., performance, reliability, usability) (e.g., performance, reliability, usability) required for the application.required for the application.

Page 25: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component qualification--Component qualification--Factors to be consideredFactors to be considered

• The interface description provides useful The interface description provides useful information about the operation and use of a information about the operation and use of a software component, but it does not provide software component, but it does not provide all of the information required to determine if all of the information required to determine if a proposed component can be reused a proposed component can be reused effectively in a new application.effectively in a new application.

• Among the many factors considered during Among the many factors considered during component qualification are:component qualification are:– Application programming interface (API)Application programming interface (API)

Page 26: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component qualification--Component qualification--Factors to be consideredFactors to be considered

– Development and integration tools Development and integration tools required by the componentrequired by the component

– Run-time requirements including Run-time requirements including resource usage, e.g., memory or storage, resource usage, e.g., memory or storage, timing or speed, and network protocoltiming or speed, and network protocol

– Service requirements including operating Service requirements including operating system interfaces and support from other system interfaces and support from other componentscomponents

Page 27: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component qualification--Component qualification--Factors to be consideredFactors to be considered

– Security features including access Security features including access controls and authentication protocolcontrols and authentication protocol

– Embedded design assumptions Embedded design assumptions including the use of specific numerical including the use of specific numerical or non-numerical algorithmsor non-numerical algorithms

– Exception handlingException handling

Page 28: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component adaptation--Component adaptation--ideal situationideal situation• In an ideal setting, domain engineering creates a In an ideal setting, domain engineering creates a

library of components that can be easily integrated library of components that can be easily integrated into application architecture. The implication of “easy into application architecture. The implication of “easy integration” is: integration” is:

– that consistent methods of resource management have that consistent methods of resource management have been implemented for all components in the library;been implemented for all components in the library;

– that common activities such as data management exist that common activities such as data management exist for all components, andfor all components, and

– that interfaces within the architecture and with the that interfaces within the architecture and with the external environment have been implemented in a external environment have been implemented in a consistent manner.consistent manner.

Page 29: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component adaptation--Component adaptation--wrappingwrapping

• In reality, even after a component has In reality, even after a component has been qualified for use in an application been qualified for use in an application architecture, it may exhibit conflicts in architecture, it may exhibit conflicts in one or more of the areas. one or more of the areas.

• To mitigate these conflicts, an adaptation To mitigate these conflicts, an adaptation technique called “component wrapping” technique called “component wrapping” is often used. is often used.

Page 30: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component adaptation--Component adaptation--wrappingwrapping

• When a software team has full access to the When a software team has full access to the internal design and code for a component, internal design and code for a component, white-box wrapping is applied. This wrapping white-box wrapping is applied. This wrapping examines the internal processing details and examines the internal processing details and makes code-level modifications to remove any makes code-level modifications to remove any conflicts. conflicts.

• Grey-box wrapping is applied when the Grey-box wrapping is applied when the component library provides a component component library provides a component extension language or API that enables conflicts extension language or API that enables conflicts to be removed or masked.to be removed or masked.

Page 31: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component adaptation--Component adaptation--wrappingwrapping

• Black-box wrapping requires the Black-box wrapping requires the introduction of pre- and post-processing at introduction of pre- and post-processing at the component interface to remove or the component interface to remove or mask conflicts.mask conflicts.

• The software team must determine The software team must determine whether the effort required to adequately whether the effort required to adequately wrap a component is justified or whether a wrap a component is justified or whether a custom component should be engineered custom component should be engineered instead.instead.

Page 32: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

• The component composition task assembles The component composition task assembles qualified, adapted, and engineered components qualified, adapted, and engineered components to populate the architecture established for an to populate the architecture established for an application. application.

• To accomplish this, an infrastructure (usually a To accomplish this, an infrastructure (usually a library of specialized components) provides a library of specialized components) provides a model for coordination of components and model for coordination of components and specific services that enable components to specific services that enable components to coordinate with each other and perform common coordinate with each other and perform common tasks.tasks.

Page 33: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

Among the many mechanisms for creating Among the many mechanisms for creating an effective infrastructure is a set of four an effective infrastructure is a set of four “architectural ingredients” that should be “architectural ingredients” that should be present to achieve component composition:present to achieve component composition:

• Data exchange model. Mechanisms that Data exchange model. Mechanisms that enable users and applications to interact and enable users and applications to interact and transfer data (e.g., drag and drop, cut and transfer data (e.g., drag and drop, cut and paste) should be defined for all reusable paste) should be defined for all reusable components. The mechanism should cover: components. The mechanism should cover:

Page 34: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

– human-to-software data transferhuman-to-software data transfer

– component-to-component data transfer, andcomponent-to-component data transfer, and

– data transfer among system resources (e.g., data transfer among system resources (e.g., dragging a file to a printer icon for output).dragging a file to a printer icon for output).

• Automation. A variety of tools, macros, and Automation. A variety of tools, macros, and scripts should be implemented to facilitate scripts should be implemented to facilitate interaction between reusable components.interaction between reusable components.

Page 35: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

• Structured storage. Heterogeneous data Structured storage. Heterogeneous data contained in a compound document should be contained in a compound document should be organized and accessed as a single data organized and accessed as a single data structure. structure.

• Underlying object model. The object model Underlying object model. The object model ensures that components developed in different ensures that components developed in different programming languages that reside on different programming languages that reside on different platforms can be interoperable. I.e., objects platforms can be interoperable. I.e., objects must be capable of communicating across must be capable of communicating across network.network.

Page 36: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component compositionComponent composition

• Most popular existing industrial standards Most popular existing industrial standards for component software include:for component software include:– OMG/CORBAOMG/CORBA

– Microsoft COMMicrosoft COM

– Sun javaBeanSun javaBean

Page 37: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component engineeringComponent engineering

• Component engineering focuses on how to Component engineering focuses on how to build quality reusable software components. build quality reusable software components.

• Though CBSE encourages the use of existing Though CBSE encourages the use of existing components, in many cases building new components, in many cases building new components becomes a must to enhance components becomes a must to enhance the component library. the component library.

• To create software components involves the To create software components involves the integration of the following techniquesintegration of the following techniques

Page 38: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Component engineeringComponent engineering

– AbstractionAbstraction

– HidingHiding

– Functional independenceFunctional independence

– RefinementRefinement

– Structured programmingStructured programming

– Object-oriented methodsObject-oriented methods

– TestingTesting

– SQA and correctness verificationSQA and correctness verification

Page 39: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Analysis and design for Analysis and design for reusereuse

• Automatic tools may be used to browse a Automatic tools may be used to browse a repository in an attempt to match the repository in an attempt to match the requirement noted in the current requirement noted in the current specification with those described for specification with those described for existing reusable components. existing reusable components.

• Characterization functions and keywords Characterization functions and keywords are used to help find potentially reusable are used to help find potentially reusable components.components.

Page 40: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Analysis and design for Analysis and design for reusereuse

• If specification matching yields If specification matching yields components that fit the needs for the components that fit the needs for the current application, the designer can current application, the designer can extract these components from the extract these components from the repository and integrate them in the design repository and integrate them in the design of new system. of new system.

• If no suitable component can be found, If no suitable component can be found, component engineering must be applied to component engineering must be applied to create them.create them.

Page 41: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Analysis and design for Analysis and design for reusereuse

• To create a reusable component, the To create a reusable component, the following key issues need to be considered:following key issues need to be considered:

– Standard data. The application domain Standard data. The application domain should be investigated and standard global should be investigated and standard global data structures (e.g., file structures or data structures (e.g., file structures or database) should be identified. All design database) should be identified. All design components can be characterized to make components can be characterized to make use of these standard data structures.use of these standard data structures.

Page 42: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Analysis and design for Analysis and design for reusereuse

– Standard interface protocols. Three levels Standard interface protocols. Three levels of interface protocol should be of interface protocol should be established: the nature of intra-modular established: the nature of intra-modular interfaces, the design of external technical interfaces, the design of external technical (non-human) interfaces, and the human-(non-human) interfaces, and the human-machine interface.machine interface.

– Program templates. The structure model Program templates. The structure model can serve as a template for the can serve as a template for the architectural design of a new program.architectural design of a new program.

Page 43: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Describing reuse Describing reuse componentscomponents

• Reusable component description: 3C Reusable component description: 3C model---concept, content and context.model---concept, content and context.

• The concept of a component is a description The concept of a component is a description of what the component does. The interface of what the component does. The interface to the component is fully described and the to the component is fully described and the semantics, represented within the context of semantics, represented within the context of pre- and post-conditions, is defined. The pre- and post-conditions, is defined. The intent of the component should be included intent of the component should be included in the concept.in the concept.

Page 44: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Describing reuse Describing reuse componentscomponents

• The content describes how the concept is realized. The content describes how the concept is realized. In essence, the content is information hidden from In essence, the content is information hidden from casual users and needs be known only to those casual users and needs be known only to those who intend to modify the component.who intend to modify the component.

• The context places a component within its domain The context places a component within its domain of applicability. By specifying conceptual, of applicability. By specifying conceptual, operational, and implementation features, the operational, and implementation features, the context enables a software engineer to find the context enables a software engineer to find the appropriate component to meet application appropriate component to meet application requirements.requirements.

Page 45: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Transfer the 3C model Transfer the 3C model into a concrete schemeinto a concrete scheme

• Library and information science methodsLibrary and information science methods

– Enumerated classificationEnumerated classification

– Faceted classificationFaceted classification

– Attribute-value classificationAttribute-value classification

• Artificial intelligence methodsArtificial intelligence methods

• Hypertext systemsHypertext systems

Page 46: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Enumerated classificationEnumerated classification

• Components are described by a defined Components are described by a defined hierarchical structure in which classes and hierarchical structure in which classes and varying levels of subclasses are defined. varying levels of subclasses are defined. Actual components are at the leaf level. Actual components are at the leaf level.

• E.g., an enumerated hierarchy for window E.g., an enumerated hierarchy for window operations.operations.

• The hierarchical structure is easy to The hierarchical structure is easy to understand and to use, but it lacks of understand and to use, but it lacks of flexibilityflexibility

Page 47: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Enumerated Enumerated classification--exampleclassification--example

Window operationsDisplay

OpenMenu-based

OpenWindowSystem-based

SysWindowClose

Via pointer...

Resizevia command

setWindowSize,stdResize,shinkWindowvia drag

pullWindow,stretchWindowUp/down shuffle

...Move

...Close

...

Page 48: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Faceted classificationFaceted classification

• A domain area is analyzed and a set of basic A domain area is analyzed and a set of basic descriptive features is identified. These descriptive features is identified. These features, named facets, are then prioritized by features, named facets, are then prioritized by importance and connected to a component. importance and connected to a component.

• A facet can describe A facet can describe

– the function of a componentthe function of a component

– the data manipulatedthe data manipulated

– the context in which components appliedthe context in which components applied

Page 49: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Faceted classificationFaceted classification

• The set of facets describing a component is The set of facets describing a component is called the called the facet descriptorfacet descriptor. .

• E.g., E.g., {function, object type, system type} {function, object type, system type}

• Keywords Keywords (values) are assigned to the set of (values) are assigned to the set of facets for each component in a reuse facets for each component in a reuse repository. Software engineers use keywords repository. Software engineers use keywords to search for possible components. Automated to search for possible components. Automated tools can be used to facilitate the search.tools can be used to facilitate the search.

Page 50: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Faceted classificationFaceted classification

• The advantage of faceted classification is The advantage of faceted classification is flexibility. The facets and linked value can flexibility. The facets and linked value can be added, deleted or modified easily.be added, deleted or modified easily.

Page 51: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Attribute-value Attribute-value classificationclassification• A set of attributes is defined for all components in A set of attributes is defined for all components in

domain area. domain area.

• Values are then assigned to these attributes in much the Values are then assigned to these attributes in much the same way a faceted classification. same way a faceted classification.

• Attribute value classification is similar to faceted Attribute value classification is similar to faceted classification with the following exception: classification with the following exception:

– there is no limit on the number of attributes that can there is no limit on the number of attributes that can be usedbe used

– attributes are not assigned prioritiesattributes are not assigned priorities

– the thesaurus functions are not usedthe thesaurus functions are not used

Page 52: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

The reuse environmentThe reuse environment

• A component database capable of storing software A component database capable of storing software components and the classification information components and the classification information necessary to retrieve them.necessary to retrieve them.

• A library management system that provides access to A library management system that provides access to the database.the database.

• A software component retrieval system that enables a A software component retrieval system that enables a client application to retrieve components and services client application to retrieve components and services from the library server. E.g., object request broker.from the library server. E.g., object request broker.

• CBSE tools that support the integration of reused CBSE tools that support the integration of reused components into a new design or implementation.components into a new design or implementation.

Page 53: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Economics of CBSEEconomics of CBSE

• CBSE should provide a software CBSE should provide a software organisation with advantages in quality organisation with advantages in quality and timeliness.and timeliness.

• Impact on quality, productivity and costImpact on quality, productivity and cost

• Reuse MetricsReuse Metrics

Page 54: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

QualityQuality

• Ideal setting, components for reuse would be Ideal setting, components for reuse would be verified and defect-freeverified and defect-free

• In reality, formal verification is not carried out In reality, formal verification is not carried out routinely. But, with resue, defects are found routinely. But, with resue, defects are found and eliminated. Over time, the component and eliminated. Over time, the component becomes defect free.becomes defect free.

• In a HP study, the defect rate for reused code In a HP study, the defect rate for reused code is 0.9 defects per KLOC, while for newly is 0.9 defects per KLOC, while for newly developed software is 4.1 per KLOC.developed software is 4.1 per KLOC.

Page 55: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

ProductivityProductivity

• Hard to estimate a figureHard to estimate a figure

• Less time spent in creating plans, models, Less time spent in creating plans, models, documents, code and datadocuments, code and data

• It appears that 30-50% reuse can result in It appears that 30-50% reuse can result in 25-40% productivity improvement25-40% productivity improvement

Page 56: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

CostCost

• Net cost saving for reuse = cost if developed Net cost saving for reuse = cost if developed from scatch – cost associated with reusefrom scatch – cost associated with reuse

• The costs associated with reuse include:The costs associated with reuse include:

– Domain analysis and modellingDomain analysis and modelling

– Domain architecture developmentDomain architecture development

– Increased documentation to facilitate reuseIncreased documentation to facilitate reuse

– Support and enhancement of reuse Support and enhancement of reuse componentscomponents

Page 57: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

CostCost

– Royalities and licenses for externally Royalities and licenses for externally acquired componentsacquired components

– Creation or acquisition and operation of Creation or acquisition and operation of a reuse repositorya reuse repository

– Training of personnel in design and Training of personnel in design and construction for reuseconstruction for reuse

Page 58: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Benefits of ReuseBenefits of Reuse

The benefit associated with reuse within a system S can beexpressed as a ration:

noreusereusenoreuseb CCCSR /][)(

where noreuseC is the cost of developing S with no reuse, and

reuseC is the cost of developing S with reuse.

So, 1)(0 SRb

Page 59: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Benefits of ReuseBenefits of Reuse

• RRbb(S)(S) will be affected by the design of will be affected by the design of the systemthe system

• it is important to make a part of an it is important to make a part of an assessment of design alternativesassessment of design alternatives

• the benefit associated with reuse is the benefit associated with reuse is closely aligned to the cost benefit of each closely aligned to the cost benefit of each individual reusable component.individual reusable component.

Page 60: Component-Based Software Engineering X LIU, School of Computing, Napier University TIP This chapter will present a complete picture of how to develop software

Reuse measure for OO Reuse measure for OO systemssystems

builtreusedlev OBJOBJR /

where reusedOBJ is the number of objects reused in a system, and

builtOBJ is the cnumber of objects built for a system.