29
Ladan Tahvildari, PEng Ladan Tahvildari, PEng Assistant Professor Assistant Professor Software Technologies Applied Research (STAR) Group Software Technologies Applied Research (STAR) Group Dept. of Elect. & Comp. Eng. Dept. of Elect. & Comp. Eng. University of Waterloo University of Waterloo ECE750-Topic11: Component-Based Software Systems Final Course Review

ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

Ladan Tahvildari, PEngLadan Tahvildari, PEngAssistant ProfessorAssistant Professor

Software Technologies Applied Research (STAR) Group Software Technologies Applied Research (STAR) Group

Dept. of Elect. & Comp. Eng.Dept. of Elect. & Comp. Eng.

University of WaterlooUniversity of Waterloo

ECE750-Topic11:Component-Based Software Systems

Final Course Review

Page 2: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 2July 26, 2007

The Course Review: TopicsBasic Concepts in CBSE & Specification of ComponentsComponent Models and Technology Architectural Styles in CBSE Enterprise Styles/Patterns.NET/J2EE Enterprise Services Component-Based Development (CBD) Process Component Composition & IntegrationTesting and Evolution of Component-Based Systems

Page 3: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 3July 26, 2007

The Course Review: Topic 1Basic Concepts in CBSE

Different DefinitionsKey Concepts

Contracts InvariantPre-ConditionPost-Condition

Patterns Architectural PatternsDesign Patterns Idioms

Frameworks Relationships between Concepts

More from Crnkovic’s Book: Chapter 1

Page 4: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 4July 26, 2007

Component Frameworks and Models

Interface that satisfies contracts

Component implementation

Component model

Independent deployment

Component-typeSpecific interface

Coordination Services (transactions, persistence..)ComponentFramework

Page 5: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 5July 26, 2007

The Course Review: Topic 1Specification of Components

UML Meta-Model

Interface Specification

Semantic Specification in UML Meta-Model Substitution

A Credential is a triple <Attribute, Value, Credibility>Attribute: is a description of a property of a componentValue: is a measure of that propertyCredibility: is a description of how the measure has been obtained

More from Crnkovic’s Book: Chapter 2 & 3

Page 6: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 6July 26, 2007

Components and InterfacesComponent

Interface

Operation

*

in-interfaces*

*

*

Name

1

1

1 11

1

Parameter

1

*

Type1 *

OutParameterInParameter

InOutParameter

*

out-interfaces

*

Page 7: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 7July 26, 2007

Interface Specification

This model allows the same state to be associated with several interfaces

check(in word : String, out correct : Boolean) : HRESULT

«interface type»ISpellCheck String

1

words

*

add(in word : String) : HRESULTremove(in word : String) : HRESULT

«interface type»ICustomSpellCheck

1

words

*

String

Page 8: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 8July 26, 2007

Semantic Specification in a UML Meta-Model

Interface

Component

*in-interfaces

*

*

out-interfaces

*State

1 *

Constraint

*

*

* 1

Invariant

1

*

1

*

Operation

*

*

Parameter

1

*

PreCondition

* 1PostCondition

1 *

1

*

InParameter OutParameter

*

*

*

*

*

*

*

2

Page 9: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 9July 26, 2007

Extra-Functional PropertiesComponent

Interface

Operation

*

in-interfaces*

*

*

AttributeValueCredibilityIsPostulate : Boolean

Credential

*1

* 1

*

1

Parameter

1

*

Type

1 *

*

out-interfaces

*

Page 10: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 10July 26, 2007

The Course Review: Topic 2Modeling Software Components Using the UML

ComponentsProvided InterfacesRequired Interfaces

Connectors Assembly Delegation

Architectures in UML consist of:Detailed interface specificationsComponents with provided and required interfacesConnections between components

Representing Realizations

More from: http://www.omg.org/docs/formal/05-07-04.pdf

Page 11: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 11July 26, 2007

Representing Realizations

Page 12: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 12July 26, 2007

Composite Components in UMLCompound component nameProvided

interface

Provided port

Requiredinterfaceand port

Composite structure:internal workings of compound component

External provided interface

implementedusing

subcomponent’s interface

External required interfaceImplemented using

subcomponent’s interface

Page 13: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 13July 26, 2007

The Course Review: Topic 3Architectural Styles

Pipes and FiltersAll components use the same external interface

2-Tiered (Client/Server)N-TieredLayered

Each layer exports an interface to be used by above layersEach layer communicates only with its neighbors below it

BlackboardConnections between components have a special semantics –“publish/subscribe”

Model View Controller (MVC)Heterogeneous Styles

Page 14: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 14July 26, 2007

Example – Typical 3 Tiered Architecture

Page 15: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 15July 26, 2007

ReservationState

AirResView

CarResView

HotelResView

DBConnectivity

<<Publish/Subscribe>>

BlackboardHoliday reservation system example: all reservations are ultimately stored on a database

Three components deal with different aspects of holiday reservation logic

Each component could connect to the database separately – especially as a change in one aspect (like date of air reservation) effects another aspect (like valid dates to book a hotel)

Solution: use an intermediate single blackboard component to connect to the database dealing with all data of a user’s reservation

Three reservation logic components can change the blackboard

Components can also subscribe to be notified of important changes to the blackboard data

Dates of aeroplane ticket changed –ReservationState updated

ReservationState sends a notification if car reservation or hotel reservation dates do not lie within aeroplane dates

Page 16: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 16July 26, 2007

Example: 4 Tiered BB Architecture

ReservationStateBean

AirResServlet

CarResServlet

HotelResServlet

DBConnectivity

<<Publish/Subscribe>>

ReservationWebPageJSPPresentation Tier

Presentation Control tier

Application Logic tier

Data tier

Page 17: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 17July 26, 2007

The Course Review: Topic 4The Object Constraint Language (OCL)

OCL syntax covers the following aspects of models:Initial values ContractsConstraints

OCL contracts provide a precise definition of how a component must behave if it provides the interface, and what a component needs if it requires the interfacecontext interfacename::methodnamepre: OCL precondition expression post: OCL postcondition expression

More from: http://www.omg.org/docs/ptc/03-10-14.pdf

Page 18: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 18July 26, 2007

An ExampleAny human reader of the model will undoubtedly assume that a number of rules must apply to this model.

A person may have a mortgage on a house only if that house is owned by him- or herself; one cannot obtain a mortgage on the house of one's neighbor or friend.

The start date for any mortgage must be before the end date.

The social security number of all persons must be unique.

A new mortgage will be allowed only when the person's income is sufficient.

Page 19: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 19July 26, 2007

Augmenting Model with OCL Expressions

context Mortgage inv: security.owner = borrower

context Mortgage inv: startDate < endDate

context Person inv: Person::allInstances()-

>isUnique(socSecNr)

context Person::getMortgage(sum : Money, security : House)

pre: self.mortgages.monthlyPayment->sum() <= self.salary * 0.30

context Person::getMortgage(sum : Money, security : House)

pre: security.value >= security.mortgages.principal->sum()

Page 20: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 20July 26, 2007

The Course Review: Topic 5

Activation/Passivate (on stateful beans)JIT Activation(Skinny and Ideal Components)

Java Server Page (JSP) ASP.NET

Instance PoolingObject Pooling(Fat and Expensive Components)

Can be implemented through JMSQueued Components(Invoke and execute components asynchronously)

Java Message Service (JMS)Loosely Coupled Events(Publish and Subscribe)

Java Transaction Service (JTS)Transactions (A means to ensure fault tolerance in a system)

EJBSession Beans (Stateless, Stateful)Entity Beans Message-Driven Beans

COM+ Components

Java.NET

Page 21: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 21July 26, 2007

The Course Review: Topic 6Enterprise Styles/Patterns

Styles that require constraints on presentation tier:

View HelperFront/View ControllerBusiness Delegate

Styles that require constraints on business logic tier:

Session FaçadeCoarse Grain Interfaces

Page 22: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 22July 26, 2007

The Course Review: Topic 7

Identify Candidate

Components

OutlineSystem

Requirements

ModifyRequirements

according to DiscoveredComponents

Identify Candidate

Components

ArchitecturalDesign

ComposeComponents toCreate System

The CBSE Process

More from Crnkovic’s Book: Chapter 5

Page 23: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 23July 26, 2007

The Course Review: Topic 8Component Composition

Sequential Composition where the composed components are executed in sequence. This involves composing the provided interfaces of each component

Hierarchical Composition where one component calls on the services of another. The provided interface of one component is composed with the required interface of another

Additive Composition where the interfaces of two components are put together to create a new component

Page 24: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 24July 26, 2007

The Course Review: Topic 9Component Integration Techniques

Predictable Assembly from Certifiable Components (PACC)

Prediction-Enabled Component Technology (PECT)

Architecture-based AnalysisComponent CertificationArchitectural Styles and Component Models

More from Crnkovic’s Book: Chapter 9

Page 25: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 25July 26, 2007

The Course Review: Topic 10COTS Activities

COTS Assessment is the activity whereby COTS products are evaluated and selected as viable components for a user application

Requirements-Based: Trade Study, Hands-on Evaluation, Final SelectionArchitecture-Based: Choose Architectural Decision, Model Component Market, List Implementation Approaches, Choose Best Implementation Approach

COTS Tailoring is the activity whereby COTS software products are configured for use in a specific context

COTS Glue Code development and integration is the activity whereby code is designed, developed, and used to ensure that COTS products satisfactorily interoperate in support of the user application

More from “A Strategy for Selecting Multiple Components”

Page 26: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 26July 26, 2007

The Course Review: Topic 11Component Testability Approaches

Method #1: Framework-Based Testing FacilityMethod #2: Build-in TestsMethod #3: Systematic Component Wrapping for Testing

Architecture Models for Testable ComponentsVerification of Component Testability

Static Verification Approach Statistic Verification Approach

Measurement of Software TestabilityProgram-Based Measurement MethodsModel-Based Measurement MethodsDependability Assessment Methods

Page 27: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 27July 26, 2007

The Course Review: Topic 11Evolution and Maintenance of CBS

UML-Based Testing

Regression Testing for Corrective MaintenanceImpacts of changes on control sequences

Collaboration DiagramState-Chart Diagram

Impacts of changes on data dependencies

Perfective and Adaptive Maintenance Activities

Page 28: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 28July 26, 2007

Preparation for the ExamFirst, concentrate on lecture notes

http://www.stargroup.uwaterloo.ca/~ltahvild/courses/ECE750-11/materials/

Second, study the links or other materials wherever is needed

http://www.stargroup.uwaterloo.ca/~ltahvild/courses/ECE750-11/resources/

Third, solve examples by yourselfWhen solving, write your solutions down!

Send an email to me for an appointment if you need

Page 29: ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11-S07/... · July 26, 2007 ECE750-Topic 11 2 The Course Review: Topics Basic Concepts in CBSE & Specification

ECE750-Topic 11 29July 26, 2007

Final Exam: Potential StructureQ1: Specifications of Software Components (~25%)

Q2: Modeling Components Using UML and OCL(~15%)

Q3: Architectural Styles (~15%)

Q4: Component Models and Technology (~20%)

Q5: Enterprise Styles/Patterns (~15%)

Q6: Testing and Maintenance of CBS (~10%)