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

ECE750-Topic11: Component-Based Software Systemsltahvild/courses/ECE750-11/materials/... · ASP.NET Java Server Page (JSP) ... Develop an intial PIM and successive refinement through

  • Upload
    vokien

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Ladan Tahvildari, PEngAssociate Professor

Software Technologies Applied Research (STAR) Group

Dept. of Elect. & Comp. Eng.

University of Waterloo

ECE750-Topic11:Component-Based Software Systems

Final Course Review

ECE750-Topic 11 2November 30, 2011

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

ECE750-Topic 11 3November 30, 2011

Component Frameworks and Models

Interface that satisfies contracts

Component implementation

Component model

Independent deployment

Component-typeSpecific interface

Coordination Services (transactions, persistence..)ComponentFramework

ECE750-Topic 11 4November 30, 2011

The Course Review: Topic 1Specification of Components

UML Meta-Model

Interface Specification

Semantic Specification in UML Meta-Model

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 2Crnkovic et al, CACM, October 2002Brown et al, IEEE Software, September 1998

ECE750-Topic 11 5November 30, 2011

Components and InterfacesComponent

Interface

Operation

*

in-interfaces*

*

*

Name

1

1

1 11

1

Parameter

1

*

Type1 *

OutParameterInParameter

InOutParameter

*

out-interfaces

*

ECE750-Topic 11 6November 30, 2011

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

ECE750-Topic 11 7November 30, 2011

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

ECE750-Topic 11 8November 30, 2011

Extra-Functional PropertiesComponent

Interface

Operation

*

in-interfaces*

*

*

AttributeValueCredibilityIsPostulate : Boolean

Credential

*1

* 1

*

1

Parameter

1

*

Type

1 *

*

out-interfaces

*

ECE750-Topic 11 9November 30, 2011

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: UML Superstructure 2.2 - http://www.omg.org/cgi-bin/doc?formal/09-02-02.pdf

UML Overview - http://www.idt.mdh.se/kurser/cd5490/2009/lectures/UML-overview%202005.pdf

ECE750-Topic 11 10November 30, 2011

Representing Realizations

ECE750-Topic 11 11November 30, 2011

Composite Components in UMLCompound component nameProvided

interface

Provided port

Requiredinterfaceand port

Composite structure:internal workings of compound componentExternal

provided interface

implementedusing

subcomponent’s interface

External required interfaceImplemented using

subcomponent’s interface

ECE750-Topic 11 12November 30, 2011

The Course Review: Topic 3Architectural Styles in CBSE

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

More from: Crnkovic’s Book: Chapter 3Garlan et al, TR CMU-CS, January 94

ECE750-Topic 11 13November 30, 2011

Example – Typical 3 Tiered Architecture

ECE750-Topic 11 14November 30, 2011

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

ECE750-Topic 11 15November 30, 2011

Example: 4 Tiered BB Architecture

ReservationStateBean

AirResServlet

CarResServlet

HotelResServlet

DBConnectivity

<<Publish/Subscribe>>

ReservationWebPageJSPPresentation Tier

Presentation Control tier

Application Logic tier

Data tier

ECE750-Topic 11 16November 30, 2011

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: UML 2.0 OCL Specification - http://www.omg.org/cgi-bin/doc?formal/06-05-01.pdf

ECE750-Topic 11 17November 30, 2011

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.

ECE750-Topic 11 18November 30, 2011

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()

ECE750-Topic 11 19November 30, 2011

The Course Review: Topic 5Enterprise 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

More from:Core J2EE Patterns: Best Practices and Design Strategies

http://www.corej2eepatterns.com/

ECE750-Topic 11 20November 30, 2011

The Course Review: Topic 6Component Models

Java Bean Component ModelCOM, DCOM, MTS and COM+CORBA Component Model (CCM).NET Component ModelOpen Service Gateway Initiative (OSGI) Component Model

More from:Crnkovic’s Book: Chapter 4

ECE750-Topic 11 21November 30, 2011

The Course Review: Topic 7.NET Java

COM+ Components EJBSession Beans (Stateless, Stateful)Entity Beans Message-Driven Beans

Transactions (A means to ensure fault tolerance in a system)

Java Transaction Service (JTS)

Loosely Coupled Events(Publish and Subscribe)

Java Message Service (JMS)

Queued Components(Invoke and execute components asynchronously)

Can be implemented through JMS

Object Pooling(Fat and Expensive Components)

Instance Pooling

JIT Activation(Skinny and Ideal Components)

Activation/Passivate (on stateful beans)

ASP.NET Java Server Page (JSP)

More from:Application Architecture for .NET: http://msdn.microsoft.com/en-us/library/aa308416(v=vs.71).aspx

Designing Enterprise Applications Using J2EE:http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/index.html

Enterprise Services

ECE750-Topic 11 22November 30, 2011

The Course Review: Topic 8MDA and Model Transformations

Facilitate a software development process that is driven by modelling, rather than codingDevelop an intial PIM and successive refinement through PSMs to eventual code implementation

More from:OMG Model-Driven Architecture - http://www.omg.org/mda/

MDA Guide Version 1.0.1 - http://www.omg.org/cgi-bin/doc?omg/03-06-01

Enterprise Architect with Model Driven Architecture -http://www.sparxsystems.com/bin/MDA%20Tool.pdf

ECE750-Topic 11 23November 30, 2011

Example: Transformation

HotelRes

ICCILP

CreditCardBillingLoyaltyProgram

T =

<<COM+>>HotelRes

ICCILP

<<COM+>>CreditCardBilling

<<COM+>>LoyaltyProgram

<<COM+>>Sink_LoyaltyProgram{EventClass = true}

<<COM+>>Sink_CreditCardBilling

{EventClass = true}

<<delegate>> <<delegate>>

ILP ICC

ECE750-Topic 11 24November 30, 2011

Example: Transformation DefinitionThe transformation definition T: UML2 -> COM+ is as follows:

T(C:Component) is C with the stereotype <<COM+>> added. Then, for every PIM component C included in App.components, we proceed as follows:For each Client ranging over App.components->select(Client:Component | IsConnected(C,Client)

We delete all connections from T(C) to each T(Client), A <<COM+>> event class named Sink_C is added with tag {EventClass = true}, providing the interface C.Provided(Client)A connection is made between the required and provided interfaces C.Provided(Client) of T(C) and Sink_C

For each Client ranging over App.components->select(Client:Component | IsConnected(C,Client)

A delegation connector is added between each T(Client) and Sink_C

ECE750-Topic 11 25November 30, 2011

Style TransformationT: UML -> COM+Map all components C to COM+ components: T( C ) = C with the <<COM+>> stereotype addedInitially, let T( I ) = I for all interfacesFor each C in App.Components, each provided interface i in C.provides:

Let newop = i.operations->reject( m | m.isGetter() or m.isSetter())Collect the set of parameters from all getters, params = i.operations->select( m | m.isGetter())->collect(m | m.parameter)Add a new coarsegrain getter method to newop, newop = newop.union{+get(params)}Collect the set of parameters from all setters, params = i.operations->select( m | m.isSetter())->collect(m | m.parameter)Add a new coarse grain setter method to newop, newop = newop.union{+set(params)}Let T(i).operations = newop

Repeat the previous step, but for required interfaces

ECE750-Topic 11 26November 30, 2011

The Course Review: Topic 9Component-Based Development (CBD)

Define the RequirementsDesign the SystemFind and Select the CandidatesAdaptCompose and Integrate Test and Deploy Operation and Maintenance/Evolution

More from:Crnkovic’s Book: Chapter 5

ECE750-Topic 11 27November 30, 2011

The Course Review: Topic 10Component Composition Techniques

Sequential Composition where the composed components are executed in sequence. Hierarchical Composition where one component calls on the services of another. Additive Composition where the interfaces of two components are put together to create a new component.

More from:Garlan et al, IEEE Software, November 1995Inverardi et al, ACM TOSEM, July 2000

ECE750-Topic 11 28November 30, 2011

The Course Review: Topic 10Component 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

ECE750-Topic 11 29November 30, 2011

The Course Review: Topic 11COTS 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:Mancebo et al, ACM SAC, March 2005

ECE750-Topic 11 30November 30, 2011

The Course Review: Topic 12Component 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 ApproachStatistic Verification Approach

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

UML-Based Testing for CBSMore from:

Vincenzi et al, LNCS 2693, November 2003

ECE750-Topic 11 31November 30, 2011

The Course Review: Topic 13Managing Component-Based Systems

Components (e.g. configuration, and replacement)Architecture and Connectors (e.g. adding/removing filters)Context and Resources (e.g. tuning application server parameters)

JMX ArchitectureManager LevelAdaptor LevelAgent Level Instrumentation Level

Management Automation with JMXMore from:

http://www.ibm.com/developerworks/java/library/j-jtp09196/index.html?ca=drshttp://www.jmxguru.com/http://sourceforge.net/projects/starmx/

ECE750-Topic 11 32November 30, 2011

The Course Review: Topic 14Quality Attributes and CBSE

Property DecompositionsAnalysis-oriented DecompositionClassification-oriented DecompositionRealization-oriented Decomposition

Classifications of Properties in CBSDirectly Composable (DIR)Architecture-Related (ART)Derived/Emerging (EMG)Usage-Dependent (USG)System Environment Context (SYS)

More from:Crnkovic et al, LNCS 3549, September 2005Avizienis et al, IEEE TDSC, January 2004Reussener, JSS, June 2003Wohlin et al, IEEE TSE, June 1994

ECE750-Topic 11 33November 30, 2011

The Course Review: Topic 15Software Product Lines (SPL)Product Line Development Process

Domain Engineering Application Engineering

Variability Modeling A graph like an And-Or graphDomain model artefacts

Using UML Profiles

More from:Ziadi et al, LNCS 3014, May 2004

ECE750-Topic 11 34November 30, 2011

Preparation for the Final Exam(December 9, E5 4106/28, 12:30-15:00pm)

First, concentrate on lecture noteshttp://www.stargroup.uwaterloo.ca/~ltahvild/courses/ECE750-11/materials/

Second, study the links or other materialswherever is needed

Third, study your marked assignments

Office HoursLadan: December 5, 10am-12pm (DC2524)Mehdi: December 7, 3-5pm (DC2542)

ECE750-Topic 11 35November 30, 2011

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

Topic: 1

Q2: Modeling Components Using UML and OCL (~15%)Topic: 2, 4, 8

Q3: Architectural and Enterprise Styles/Patterns (~20%) Topic: 3, 5

Q4: Component Models and Technology (~20%)Topic: 6, 7, 10

Q5: Development, Testing, and Management of CBS (~20%)Topic: 9, 11, 12, 13

Q6: Predicting Quality Attributes for CBS/SPL (~10%)Topic: 14, 15