l08-01-s1 stable analysis patterns 2003 & 2204 sjsu -- cmpe component-based & software reuse...

41
2003 & 2204 SJSU -- CmpE L08-01-S1 Stable Analysis Patterns Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

Upload: byron-wright

Post on 21-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 & 2204 SJSU -- CmpE L08-01-S1 Stable Analysis Patterns

Component-Based & Software Reuse

Dr. M.E. Fayad, Professor

Computer Engineering Department, Room #283I

College of Engineering

San José State University

One Washington Square

San José, CA 95192-0180

http://www.engr.sjsu.edu/~fayad

Page 2: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S2 Stable Analysis Patterns

2

Lesson 08-01:Stable Analysis Patterns

Page 3: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S3 Stable Analysis Patterns

Lesson Objectives

Objectives

3

Explore Stable Analysis Patterns Examine Stable Analysis Patterns Discuss the following Stable Analysis Patterns:

Negotiation

Model-View-Mapping (MVM)

Searching

Page 4: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S4 Stable Analysis Patterns

4

The concept of extracting patterns using software stability concepts 

   

ProblemFIRST ABSTRACTION: Apply SSM concepts Define EBTs, BOs, and IOs Create SSM for the problemSECOND ABSTRACTION: Model each EBT using SSM concepts Build natural domain Stable Analysis

Pattern

Page 5: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S5 Stable Analysis Patterns

Timeless Notion Pattern Generality: Generality Patterns Usability and Reusability Patterns Scalability Patterns Presentation of the Core Knowledge Patterns One Presentation of the Problem Space Patterns Configurability and Re-Configurability Patterns Adaptability Patterns Extensibility Patterns Accessibility Patterns Integratability Patterns 5

Stable Analysis Patterns’ Properties

Page 6: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S6 Stable Analysis Patterns

Contribute to Stable Architectures

Aid True Problem Understanding

Provide True Problem Modeling

Enhance Team Dynamic 9

Stable Analysis Patterns Advantages

Page 7: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S7 Stable Analysis Patterns

Negotiation is a general concept that has many applications in various contexts.

In our every day life, there are various situations where negotiation usually takes place. For instance, buying or selling properties usually involves some sort of negotiation (e.g. buying or selling a home or a car).

In addition, negotiation can be used for solving social and political conflicts.

6

Negotiation Analysis Pattern (1)

Page 8: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S8 Stable Analysis Patterns

In software systems, Negotiation also appears frequently in the development of different applications.

For instance, developing software for online auctions and shopping might involve the negotiation of the price and/or the negotiation of different product aspects.

More technically, negotiation becomes an essential part in the development of next generation Web-based devices and appliances. 7

Negotiation Analysis Pattern (2)

Page 9: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S9 Stable Analysis Patterns

Today, devices that need to access the Web diverge greatly in their capabilities, making it highly desirable for the same resource to be available in several different representations (different languages for example).

Negotiation algorithms play a fundamental role in aiding servers to decide which representation of a document a device should be given. In this case, the browser (or the client agent) will indicate its preferences by including a header in the request.

8

Negotiation Analysis Pattern (3)

Page 10: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S10 Stable Analysis Patterns

Pattern Name: Negotiation

Problem: How does one build a negotiation model that can be used to model the negotiation problem in any application?

10

Negotiation Analysis Pattern (4)

Page 11: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S11 Stable Analysis Patterns

Negotiation spans many contexts that are completely different in their natures.

The Negotiation process can take place between two or more persons, between persons and organizations, or between two non-human entities; in each case, the negotiator structure is completely different. How can we handle these different structures using a single model? 11

Forces (1)

Page 12: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S12 Stable Analysis Patterns

The Negotiation entity can be an organization consisting of many persons, each having a role in the negotiation process. For instance, there can be one individual who is responsible for negotiating financial issues, another who is responsible for negotiating issues related to management, and so on. Therefore, our pattern should be flexible enough to handle different negotiator structures.

12

Forces (2)

Page 13: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S13 Stable Analysis Patterns

Negotiation can be conducted through one or more media either simultaneously or consecutively; thus, the pattern should handle the use of multiple media.

Negotiation can be performed on one or more affairs at the same time. For instance, negotiation that takes place in the buying and selling context usually involves more than one subject to be negotiated. For example, in buying a car, one can negotiate the price, the warranty, and so on. Therefore, the pattern should be flexible enough to handle such situations.

13

Forces (3)

Page 14: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S14 Stable Analysis Patterns

The ultimate goal of any negotiation is to reach an agreement between the negotiators. However, the nature of this agreement varies tremendously from one application to another and from one context to another. An agreement that might be reached while negotiating a political conflict is completely different from that reached while buying a car. Therefore, the pattern should be able to handle these wide variations.

14

Forces (4)

Page 15: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S15 Stable Analysis Patterns

15

Pattern Structure and Participants

AnyAgreement<<Pattern-BO>>

AnyContext<<Pattern-BO>>

AnyMedia<<Pattern-BO>>

Negotiation<<EBT>>

AnyParty<<Pattern-BO>>

1..*

1..*1..*

0..*

negotiates

uses

generates

handles

Page 16: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S16 Stable Analysis Patterns

16

CRC Cards (1)

AnyNegotiation (Negotiation Descriptor)

Responsibility Collaboration

  Clients Server

Describes the negotiation rules and regulations to the negotiating parties.

AnyAgreementAnyPartyAnyMediaAnyContext

defineRules()

 

AnyParty (Negotiation handler)

Responsibility Collaboration

Performs and finalizes the negotiation.

Clients Server

AnyNegotiationAnyAgreement

negotiate()approve()agree() 

Page 17: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S17 Stable Analysis Patterns

17

CRC Cards (2)

AnyAgreement (Agreement)

Responsibility Collaboration

Describes agreement terms and conditions.

Clients Server

AnyNegotiationAnyParty

option()sign()execute()insert-option()

 

Media (Connector)

Responsibility Collaboration

Communicates negotiation issues between negotiators.

Clients Server

AnyNegotiation 

connect Parties()display()illustrate()

Page 18: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S18 Stable Analysis Patterns

18

CRC Cards (3)

 

Context (Motivator)

Responsibility Collaboration

Defines the reason of the negotiation process.

Clients Server

AnyNegotiation 

defineBoundary()contextLimit()

 

Page 19: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S19 Stable Analysis Patterns

STABLE MODEL-VIEW MAPPING PATTERN

(MVM)

19

Page 20: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S20 Stable Analysis Patterns

Problem Overview Solution Requirements Current Solutions – Overview Current Solutions- Limitations Proposed Solution Stable Model-View Mapping [MVM] Pattern Stable MVM- Second Abstraction Level Stable MVM Pattern Instantiation Applicability Examples 20

Outline

Page 21: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S21 Stable Analysis Patterns

Today, very heterogeneous devices are required to access the same applications.

PCs, PDAs, WAP phones, and interactive TVs, each has its own limitations and capabilities.

Generating different version of the same application is impractical solution. [Cost, management, time,etc.] 21

Problem Overview (1)

Page 22: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S22 Stable Analysis Patterns

Problem Overview (2)A

pp

lica

tion

1

Ap

pli

cati

on

1

The Internet The Internet

Wireless Network

Server

View 1

View 2

View 4

View 6 View 5

View 3

Different views

Problem: How to map models to different views!

Page 23: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S23 Stable Analysis Patterns

Successful applications will be accessible from several devices.

Complex applications should be built as a composite of multiple models, not as a single complex model.

Therefore, the solution should deal with the situation of having multiple models within the applications. 23

Solution Requirements (1)

Page 24: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S24 Stable Analysis Patterns

Sometimes the required view is constructed from the isolation of different parts from several models within the application. Mapping mechanisms are not predefined.

The pattern needs to be abstract and not tied to any specific technology.

24

Solution Requirements (2)

Page 25: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S25 Stable Analysis Patterns

Developers would prefer a solution that separates the presentation from the application logic.

One common approach that has been suggested is to use the Model-View-Control (MVC) framework to address some of issues regarding multi-device interfaces. [For example: San Francisco, and Java platform for wireless Applications: J2EE and J2ME].

Others approaches propose the use of different design patterns such as: Pipe and Filter patterns.

25

Current Solutions- Overview

Page 26: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S26 Stable Analysis Patterns

None of the current solutions consider the situation of having multiple models within the application.

Therefore, they do not consider the composition of multiple models in a single view and vise versa.

None of them have addressed the way by which an arbitrary numbers of views can be generated from a single abstract model. All existing solutions assume a predefined set of views associated with a single model

26

Current Solutions- Limitations

Page 27: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S27 Stable Analysis Patterns

We propose the Stable Model-View Mapping (MVM) as a solution to the mapping problem.

the Stable MVM is a collection of patterns that deal with the problem of mapping an abstract model to an abstract view.

The pattern handles the situation of having more than one model within the same application.

The pattern is general enough to to deal with mapping problem for different devices with different capabilities. 27

Proposed Solution (1)

Page 28: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S28 Stable Analysis Patterns

No predefined models and predefined views Mapping of Passive Models, such as relations in

RDB and Live Models, such as return of playMovie().

The pattern is applicable for multiple purposes, such scalability, simplicity, viewing, fitting, editing, etc..

The pattern provides a base for building multiple applications.

28

Proposed Solution (2)

Page 29: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S29 Stable Analysis Patterns

Pattern Structure

returns

Applicability<<Pattern-BO>>

maps 1..*gets

mappingmappingmodel view

displays1..*

views

party party

specific appl ication

uses

1..*

appears / transmits

searching

1..*1..*

1..* 1..*

generates

Such as:- Viewing- Simplici ty- Model ing- Scalabil ity- Tractabi lity

requests

searching

search

Mapping<<Pattern-EBT>>

AnyMedia<<Pattern-BO>>

AnyParty<<Pattern-BO>>

AnyView<<Pattern-BO>>

Searching<<Pattern-EBT>>

AnyApplication<<Pattern-BO>>

AnyModel<<Pattern-BO>>

1..*

search

search

Page 30: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S30 Stable Analysis Patterns

The participants of the Stable MVM pattern are divided into two kinds: Classes and Patterns.

Classes Applicability. Describes the application and the

purpose for which mapping is needed.

Patterns AnyModel. Describes the models within the application.

The model is a representation of the data within the application. 30

Participants (1)

Page 31: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S31 Stable Analysis Patterns

AnyView. Represents the view of a collection of data (the model).

AnyParty. Represents both the modeler and the viewer. The modeler is responsible for building the data models in the appropriate abstract level. The viewer requests the model and the mapped view of that model.

AnyMedia. Defines the media upon which the models and views are mapped and transmitted. It also represents the media by which the views are to be displayed (Phone, PCs, etc.)

31

Participants (2)

Page 32: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S32 Stable Analysis Patterns

Mapping. Defines the mapping rules between the models and their views. It also determines how this mapping will be performed.

Searching. Searches AnyMedia for the requested application, model, or view.

AnyApplication. Represents the application that is requested by AnyParty.

32

Participants (3)

Page 33: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S33 Stable Analysis Patterns

2nd Level Of Abstraction

Media_1 Media_2 Media_n

Such as:- Desire or appeal- Assessment- Viewing- Advertisment- Mobi li ty

For example:- Institution- Theater- Audiance

For example:- Broadcast media- Audio media- Multimedia- Mobi le media

AnyParty<<BO>>

Applicatbility<<EBT>>

MediaType<<BO>>

AnyMedia<<BO>> 1..* uses

1..* usesspecificappl ication

specificmedia type

1..*

uses

anyMedia

specific appl icationtype

How to build a model that can be used to present any media in any application?

33

Page 34: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S34 Stable Analysis Patterns

Weather Application The weather application provides several services,

such as: the weather for all countries and their cities all over the world, the weather forecast for the next few days, satellite photos, current forecast on video, etc.

In this application, the user wants to view the weather on different devices with different capabilities.

weather applications is developed in terms of smaller models, since having one model that deals with all of these features will be hard to manage and adapt for different devices.

Applicability with Illustrated Example

34

Page 35: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S35 Stable Analysis Patterns

Weather Application (1)

Weather Application

•Weather information•Warning reports

Interactive map model Photo model

Video model Text model

One possible viewFor the weather application

Weather application view on the PC

Page 36: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S36 Stable Analysis Patterns

Weather Application (2)

Weather Application

•Weather information•Warning reports

Interactive map model Photo model

Video model Text model

One possible viewFor the weather application

Page 37: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S37 Stable Analysis Patterns

To show the applicability of the Stable MVM pattern to the weather application, we show show an instance of the pattern.

The pattern instantiation is useful in visualizing each component in the pattern in reality.

The instantiation diagram shows also how the different component of the pattern interact with each other in real applications.

Weather Application (3)

37

Page 38: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S38 Stable Analysis Patterns

Instantiation Symbols Description

Represents the pattern name as given in the pattern object diagram

Points to an instance of the pattern in the current application example.

Represents the typical flow of the interactions within the application example.

Represents a logical interaction between the different pattern within the application example.

AnyView

Page 39: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S39 Stable Analysis Patterns

Weather Application

•Weather information•Warning reports

Interactive map model Photo model

Video model Text model

AnyMedia

Mapping

Applicability

AnyModel

AnyView

AnyParty

Searching

AnyApplication

developer

The

Internet

The

Internet

Wireless Network Server

Mapping

Simplification

Integration View

search

View

search

generate

Forward request

Forward request

Forward view

Forward view

use

search

search

search

Page 40: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S40 Stable Analysis Patterns

1. Generate instance diagrams for another applications of MVM.

2. Model the following concepts: viewing, simplifying, searching, and scalability.

3. Use negotiation pattern to model the following concepts: diplomatic negotiation, negotiating peace settlement, and trade negotiation.

40

Discussion Questions

Page 41: L08-01-S1 Stable Analysis Patterns 2003 & 2204 SJSU -- CmpE Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department,

2003 SJSU – CmpE --- M.E. Fayad L08-01-S41 Stable Analysis Patterns

Task 1: Read chapters on behavior models.

Task 2: Start work on your team Project #2.

Task 3: Prepare for next Design Session.

41

Tasks for Next Lecture