0% found this document useful (0 votes)
24 views40 pages

Components Intro 2022

This document discusses component-based software engineering (CBSE). It defines what components are, describes the advantages of CBSE such as reuse and flexibility, and outlines some key principles and characteristics of CBSE including abstraction, encapsulation, standardization, independence, composability, and documentation of components.

Uploaded by

ims
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
24 views40 pages

Components Intro 2022

This document discusses component-based software engineering (CBSE). It defines what components are, describes the advantages of CBSE such as reuse and flexibility, and outlines some key principles and characteristics of CBSE including abstraction, encapsulation, standardization, independence, composability, and documentation of components.

Uploaded by

ims
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 40

CBSE

Component Based Software Engineering

http://staff.cs.upt.ro/~ioana/cbse/

conf.dr.ing. Ioana Şora


Lecture 1

Component Based Development


Introduction and Basic Concepts
Bibliography (1)
• Components and concepts
– Main text:
• Ian Sommerville, Software Engineering, 10th edition, 2015,
chapter 16 (Component based software engineering)
– Additional reading:
• Ivica Crnkovic, Magnus Larsson. Building reliable component
based software systems, Artech House, 2002. chapter 1 (Basic
Concepts in CBSE)
• Felix Bachmann, Len Bass, Charles Buhman, Santiago Comella-
Dorda, Fred Long, John Robert, Robert Seacord, Kurt Wallnau :
Technical Concepts of Component-Based Software Engineering,
Technical Report CMU/SEI-2000-TR-008 ,
http://www.sei.cmu.edu/library/abstracts/reports/00tr008.cfm
Bibliography (2)
• Introductory Reading:
• Mahesh Dodani: “From Objects to Services: A Journey
in Search of Component Reuse Nirvana”, in Journal of
Object Technology, 2004.
http://www.jot.fm/issues/issue_2004_09/column5/
• Roger Sessions: “Fuzzy Boundaries – Objects,
Components and Web Services”, in ACM Queue
Magazine, 2005.
http://queue.acm.org/detail.cfm?id=1039533
• Doug McIlroy, Mass Produced Software Components,
1969.
https://www.cs.dartmouth.edu/~doug/components.txt

Component based development
• “Systems should be assembled from existing
components”
– Idea dates since 1968: Douglas McIllroy: “Mass produced software
components”

• Component-based software engineering (CBSE) is an


approach to software development that relies on
software reuse – reusing artifacts (software parts)
• Advantages of CBSE:
– Reuse: Development of system = assembly of component
– Flexibility: Maintenance,upgrading=customization, replacement
of components, extensibility by adding components. His may
even happen at run-time with proper infrastructure support !
Advantage 1: Software construction

Application

Software construction vs. creation: application is


developed as an assembly of “integrated circuits”
Advantage 2: Reuse
Application 1
C1

C1

Application 2
C1

Software “integrated circuits”


are reusable entities
It pays off to have as many applications
that reuse an entity
Advantage 3: Maintenance & Evolution

C1new

Application
C1
update

Maintenance and upgrading can


be done by replacing parts, maybe
even at runtime
What are the “Entities” to compose ?
1960 1968: Douglas McIlroy: “Mass Produced
• Functions Software Components”
1970

• Modules 1980

• Objects 1990
1998: Clemens Szyperski: “Component
• Components Software – Beyond Object Oriented
Programming”
2000

• Services
2010
• …
Principles for reuse by composition
• Key requirements for Black-Box reuse:
– Abstraction: an “Entity” is known by its
“interface”
– Encapsulation: the “insides” of an “Entity” are
not exposed to the outside
Commonalities
of Reusable Entities
• All are blobs of code that
can do something
• All have interfaces that
describe what they
can do.
• All live in a process
somewhere.
• All live to do the bidding
of a client.
• All support the concept
of a client making
requests by
“invoking a
method.”
From [ACM Queue]
Reusable Entities
by Location and Environment

Environment: the hosting runtime environment for the


Entity and the Client (Examples: Microsoft .NET, WebSphere EJB)
From [ACM Queue]
From [ACM Queue]
From [ACM Queue]
From [ACM Queue]
Objects-Components-Services
Entities for Reuse and Composition
•Abstraction
•Encapsulation

Objects Components Services


•Location: same process •Location: different •Location: different
•Inheritance processes, same environments
environment •More emphasis on
•Polymorphism
•Usually some runtime interface/contract/service
infrastructure needed agreement
•No state •Mechanisms for
•No shared variables dynamic discovery
•Dynamically
composable
Reusable Entities
made more usable and more
composable
• Issues:
• Interface description – what should contain a complete
description ?
• Composition – how are components glued together ? (do I have
to write much glue code ?)
• Discovery – where and how to find the component/service you
need ?
• Dynamic aspects – when to do discovery/selection/composition
• Less stress on binary implementation – crossing platform/model
boundaries
CBSE reuse
• Component Based Software
Engineering (CBSE) = reuse of:
– Parts (components)
– Infrastructure
Component based software construction
– the ideal case

Application

Software construction vs. creation: application is


developed as an assembly of “integrated circuits”
Component based software construction
– in practice
Component interactions
Components must obey to common conventions or standards !
Only in this way they will be able to recognise each others interfaces and
connect and communicate to each other
CBSE essentials
• Independent components specified by their interfaces.
– Separation between interface and implementation
– Implementation of a component can be changed without changing the
system
• Component standards to facilitate component integration.
– Component models embody these standards
– Minimum standard operations: how are interfaces specified, how
communicate components
– If components comply to standards, then their operation may be
independent of their programming language
• Middleware that provides support for component inter-operability.
– Provides support for component integration
– Handles component communication, may provide support for resource
allocation, transaction management, security, concurrency
• A development process that is geared to reuse.
CBSE and design principles
• Apart from the benefits of reuse, CBSE is based on
sound software engineering design principles that
support the construction of understandable and
maintainable software:
– Components are independent so they do not interfere with each
other;
– Component implementations are hidden so they can be changed
without affecting others;
– Communication is through well-defined interfaces so if these are
maintained one component can be replaced by another that
provides enhanced functionality;
– Component platforms (infrastructures) are shared and reduce
development costs.
Component definitions
- Szyperski
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.”
Component definitions
– Councill and Heinemann
Councill and Heinmann:
“A software component is a software element that conforms
to a component model and can be independently
deployed and composed without modification according
to a composition standard.”
Component characteristics 1
Standardised Component standardisation means that a component
that is used in a CBSE process has to conform to
some standardised component model. This model
may define component interfaces, component meta-
data, documentation, composition and deployment.
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.
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.
Fig. from [Sommerville]
Component characteristics (cont)

Deployable To be deployable, a component has to be self-


contained and must be able to operate as a stand-
alone entity on some component platform that
implements the component model. This usually
means that the component is a binary component that
does not have to be compiled before it is deployed.
Documented Components have to be fully documented so that
potential users of the component can decide whether
or not they meet their needs. The syntax and, ideally,
the semantics of all component interfaces have to be
specified.

Fig. from [Sommerville]


Component interfaces
• An interface of a component can be defined as a specification of its
access point, offering no implementation for any of its operations.
• This seperation makes it possible to:
– Replace the implementation part without changing the interface;
– Add new interfaces (and implementations) without changing the existing
implementation
• A component has 2 kinds of interfaces:
– Provides interface
• Defines the services that are provided by the component to the
environment / to other components.
• Essentially it is the component API
• Mostly methods that can be called by a client of the component
– Requires interface
• Defines the services that specifies what services must be made available by
the environment for the component to execute as specified.
• If these are not available the component will not work. This does not
compromise the independence or deployability of the component because it
is not required that a specific component should be used to provide these
services
Component interfaces

Requires int erface Provides int erface


Defines the services Defines the services
from the component’s Component that are provided
environment that it by the component
uses to other components

Fig.from [Sommerville]
Example: A data collector component

Requires int erface Provides int erface

addSensor
removeSensor
sensorManagement
star tSensor
Data collector stopSensor
sensorData testSensor
initialise
repor t
listAll

Fig.from [Sommerville]
Component models
• A component model is a definition of standards for component
implementation, documentation and deployment.
• These standards are for:
– component developers to ensure that components can
interoperate
– Providers of component execution infrastructures who provide
middleware to support component operation
• The component model specifies how interfaces should be defined
and the elements that should be included in an interface definition.
Elements of a component model

Customisation
Naming
convention

Composition Documentation

Interface Specific Meta-data Evolution


Packaging
definition inter faces access suppor t

Usage Deployment
Interfaces
information and use
Component model

Fig. 19.4 from [Sommerville]


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

Horizontal services

Component Transaction Resource


management management management
Concurrency Persistence Security

Platform services

Inter face Exception Component


Addressing
definition management communications

Fig. from [Sommerville]


Architecture of Component Models
Platform Services: allow
components written
according to the model to
Component Component Component communicate; locating,
linking, replacing
components
Component platform (component framework)

Middleware
Horizontal Services:
Operating System application-independent
services used by different
components.
Hardware Concurrency, security,
transaction management,
Resource management
Relationships Between Concepts

Interface that satisfies contracts

Component-type Component
Specific interface implementation

Independent Component
deployment model

Component
Coordination Services (transactions, persistence..) Framework

Building Reliable Component-based Systems Page 22


Chapter 1 - Basic Concepts in Component-Based Software
Engineering
Component Frameworks

 While frameworks in general describe a typical and


reusable situation at a model level, a component
framework describes a “circuit-board” with empty slots
into which components can be inserted to create a
working instance.

Component
Coordination Services (transactions, persistence..) Framework

The component framework forces components


to perform their tasks via mechanisms controlled
by the framework
Building Reliable Component-based Systems Page 20
Chapter 1 - Basic Concepts in Component-Based Software
Engineering
Component Models

 The two concepts Component Models and Component


Frameworks are sometimes intermixed.
 A component model defines a set of standards and
conventions used by the component developer whereas
a component framework is a support infrastructure for
the component model.

Component
model

Standards: component types, interfaces,


allowable patterns of interaction
Building Reliable Component-based Systems Page 21
Chapter 1 - Basic Concepts in Component-Based Software
Engineering
Relationships Between Concepts

Interface that satisfies contracts

Component-type Component
Specific interface implementation

Independent Component
deployment model

Component
Coordination Services (transactions, persistence..) Framework

Building Reliable Component-based Systems Page 22


Chapter 1 - Basic Concepts in Component-Based Software
Engineering
Component Based Development –
Summary
•CBSE is about:
–Building a system by composing “entities”
–Reusing “entities”
–Maintaining a system by adding/removing/replacing “entities”
•What are the “entities” ?
–Functions, modules, objects, components, services, ..
•Reusable “entities” are encapsulated abstractions :
provided/required interfaces
•Composition of “entities” has to be supported by
–Standards (component models)
–Middleware (component framework)

You might also like