3 Software Components Flashcards
Component Definition
unit of composition can be deployed independently -has provided (and required) interfaces -hides its implementation -is self-contained -adheres to a component model
Informal Definition
A component is a contractually specified
building block for software that can be
readily used by third parties without
understanding its internal structure
Comp and layered Arch.
usually comprise the application and domain layer
infrastructure layers may also use comps
Encapsulation
Information hiding principle:
An interface should describe an abstraction of the implementation. Allows revision of the encapsulated design
-> inheritance is conflicting with the black box principle
Benefits of encapsulation
Comprehensibility
Faster development
Less redundancy
Maintainability/adaptability
Applies to Functions, Procedures Modules Classes Components
BGW Box
Black box:
No Internal Information
Grey Box:
an abstract view of internals
e.g. specification of internal behavior
White box:
all information about a compoinent is given
eg specification and source code
Benefits of Comps
Encapsulation
better construction and maintainability
Block-box reuse development -with reuse: planned (marketplace), unplanned (pragmatic software search) -for reuse: components, product lines better quality, time, costs
Engineering approach to software development
Component Lifecycle
- comp specification
- comp implementation
- installed/deployed comp
- “comp object” (running comp)
- in some comp defs comps can have state
Diff btw Classes and Components - Classes
Class is design time entity
object is run time entity
usable by inheritance and delegation
source code often required for reuse by inherit.
often designed for one system
traditionally, deploymnt context does not change after compilation
Diff btw Classes and Components - Components
Can be design-time or executable run-time entity
may contain several classes
source code may not be available
only usable by delegation
description by interfaces
developed seperately
deployment context is not fixed at compilation time
Modules
a modules encaps.es a design decision
can only be accessed via interfaces
interfaces should provide sufficient information for
using and implementing the module
Module vs Comp similar
Elemts for hierarchical system decomposition
used through interface
often only one isntance available
Module vs Comp different
different goals:
-comps are building block (variation, reuse)
-modules hide design decisions
->may have different levels of granularity
modules are nof (fully) contractually specified entities
import-clause of modules is insufficient for a requires-interface