25
Architectural styles and Case studies 1 w w w . b o o k s p a r . c o m | W e b s i t e f o r S t u d e n t s | V T U N O T E S | Q U E S T I O N P A P E R S | N E W S | R E S U L T S

Architectural styles and Case studies

  • Upload
    mikkel

  • View
    85

  • Download
    2

Embed Size (px)

DESCRIPTION

Architectural styles and Case studies. Case studies. KeyWord In Context -KWIC Instrumentation Software Mobile Robotics Cruise Control Three vignettes in mixed style. KWIC. the Keyword in Context problem. - PowerPoint PPT Presentation

Citation preview

Page 1: Architectural styles and  Case studies

Architectural styles and Case studies

1

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Page 2: Architectural styles and  Case studies

CASE STUDIESKeyWord In Context -KWICInstrumentation SoftwareMobile RoboticsCruise ControlThree vignettes in mixed style

2www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

Page 3: Architectural styles and  Case studies

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

3

KWIC

Page 4: Architectural styles and  Case studies

4

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

THE KEYWORD IN CONTEXT PROBLEM The KWIC index system accepts an ordered set

of lines, each line is an ordered set of words, and each word is an ordered set of characters.

Any line may be "circularly shifted" by repeatedly removing the first word and appending it at the end of the line.

The KWIC index system outputs a listing of all circular shifts of all lines in alphabetical order.

Page 5: Architectural styles and  Case studies

5

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKEYWORD IN CONTEXT (KWIC): DESIGN CONSIDERATIONS Changes in algorithm: For example, line shifting can be performed i) on each line as it is read from the input

deviceii) on all the lines after they are readiii) on demand when the alphabetization

requires a new set of shifted lines.

Page 6: Architectural styles and  Case studies

6

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Changes in data representation: For example, lines can be stored in various ways. circular shifts can be stored explicitly or implicitly (as index and offsets).

KEYWORD IN CONTEXT (KWIC): DESIGN CONSIDERATIONS

Page 7: Architectural styles and  Case studies

7

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Enhancement to system function: Modify the system to eliminate circular shifts

that starts with certain noise words (such as "a", "an", "and", etc.).

Change the system to be interactive, and allow the user to delete lines from the lists.

KEYWORD IN CONTEXT (KWIC): DESIGN CONSIDERATIONS

Page 8: Architectural styles and  Case studies

8

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Performance: Both space and time. Reuse: To what extent can the components

serve as reusable entities.

KEYWORD IN CONTEXT (KWIC): DESIGN CONSIDERATIONS

Page 9: Architectural styles and  Case studies

9

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKEYWORD IN CONTEXT (KWIC): SOLUTIONS

1: Main program/subroutine with shared data. 2: Abstract data types. 3: Reactive integration. 4: Dataflow.

Page 10: Architectural styles and  Case studies

10

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

This solution decomposes the problem according to the four basic functions performed:

Input: inputs and stores characters Shift which reads characters/writes index Alphabetizer: alphabetizes index Output: prints alphabetized index

KEYWORD IN CONTEXT (KWIC): SOLUTIONS 1 (MAIN PROGRAM/SUBROUTINE WITH SHARED DATA. )

Page 11: Architectural styles and  Case studies

11

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSSOLUTION 1: MAIN PROGRAM/SUBROUTINE With shared memory Master control calls

Input, which inputs and stores characters Circular Shift, which reads characters/writes

index Alphabetize, which alphabetizes index Output, which prints alphabetized index

Page 12: Architectural styles and  Case studies

12

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKWIC: MAIN PROGRAM /SUBROUTINE WITH SHARED DATA SOLUTION

Page 13: Architectural styles and  Case studies

13

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

It decomposes the problem into 4 basic functions Input, Shift, Alphabetize, output

Computational Components are coordinated as subroutines by a main program.

Computations can share the same storage. This allow efficient data representation. Communication between the computational

components and shared data is an unconstrained read-write protocol.

--------------------

KWIC: SHARED DATA SOLUTION

Page 14: Architectural styles and  Case studies

14

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

----------------------------------------------------------------------

Serious drawbacks in handling changes: A change in data storage format will affect

almost all of the modules. Changes in algorithm and enhancements to

system function are not easily handled. Reuse is not well-supported because each

module of the system is tied tightly to this particular application

Page 15: Architectural styles and  Case studies

15

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

It decomposes the system into a similar set of five modules.

Data is no longer directly shared by the computational components.

Each module provides an interface that permits other components to access data only by invoking procedures in that interface.

KWIC: ABSTRACT DATA TYPES

Page 16: Architectural styles and  Case studies

16

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKWIC: SOLUTION 2: ABSTRACT DATA TYPES

Setchar Char Word Set

char CharSetup Word alph i-th

Master control

Input Output

Characters Circular shift Alphabetic shift

Page 17: Architectural styles and  Case studies

17

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKWIC: SOLUTION 2: ABSTRACT DATA TYPES Data is not shared anymore

encapsulated in objects Advantages

Changes in algorithms and data representation in individual components don't affect other components.

More reuse support. Drawbacks

Changes in functionality can be difficult might involve components modification or

addition

Page 18: Architectural styles and  Case studies

18

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKWIC SOLUTION 3: IMPLICIT INVOCATION

Insert Delete i-th

Master control

Input

Lines Shifted lines

AlphabetizeCirc shift

Insert Delete i-th

Output

Page 19: Architectural styles and  Case studies

19

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Uses a form of component integration based on shared data similar to first solution.

Interface to the data is more abstract. Computations are invoked implicitly as data is

modified. An event will be sent to the shift module

whenever there is new line. This allows it to produce circular shifts This causes the alphabetizer to be implicitly

invoked

KWIC SOLUTION 3: IMPLICIT INVOCATION

Page 20: Architectural styles and  Case studies

20

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Advantages Supports functional enhancements to the

system. Additional modules can be attached Supports reuse. Disadvantage: Uses more space.

Page 21: Architectural styles and  Case studies

21

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTSKWIC SOLUTION 4: PIPES AND FILTERS

Page 22: Architectural styles and  Case studies

22

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

It has 4 filters : Input, shift, Alphabetize and Output.

Each filter process processes the data and sends it to the next filter.

Control is distributed Each filter can run whenever it has data on which to

compute. Data sharing between filters is strictly limited on

pipes.

KWIC SOLUTION 4: PIPES AND FILTERS

Page 23: Architectural styles and  Case studies

23

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

Advantages: It maintains the sensitive flow of processing Supports reuse-each filter can function in

isolation New function can easily be added to the system

by inserting filters at the appropriate points. Easy to modify-each filters are logically

independent Disadvantages: Virtually impossible to modify the design

to support interactive system. Uses space inefficiently –since each filter

must copy all of the data to its output ports.

KWIC SOLUTION 4: PIPES AND FILTERS

Page 24: Architectural styles and  Case studies

24

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

COMPARISON

Change in algorithm

Change in datarepresentation

Change infunction

Performance

Reuse

Shared Abstract Implicit Pipe anddata data type invocation filter

- - + +

- + - -

- - + +

+ + - -

- + - +

Page 25: Architectural styles and  Case studies

25

www.bookspar.com | W

ebsite for Students | VTU NOTES | QUESTION PAPERS | NEW

S | RESULTS

NEXT…

Instrumentation Software