Presentation is loading. Please wait.

Presentation is loading. Please wait.

Architectural styles and Case studies 1 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS.

Similar presentations


Presentation on theme: "Architectural styles and Case studies 1 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS."— Presentation transcript:

1 Architectural styles and Case studies 1 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

2 C ASE STUDIES KeyWord In Context -KWIC Instrumentation Software Mobile Robotics Cruise Control Three vignettes in mixed style 2 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

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

4 THE K EYWORD IN C ONTEXT 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. 4 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

5 K EYWORD I N C ONTEXT (KWIC): D ESIGN C ONSIDERATIONS Changes in algorithm: For example, line shifting can be performed i)on each line as it is read from the input device ii)on all the lines after they are read iii)on demand when the alphabetization requires a new set of shifted lines. 5 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

6 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). 6 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS K EYWORD I N C ONTEXT (KWIC): D ESIGN C ONSIDERATIONS

7 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. 7 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS K EYWORD I N C ONTEXT (KWIC): D ESIGN C ONSIDERATIONS

8 Performance : Both space and time. Reuse : To what extent can the components serve as reusable entities. 8 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS K EYWORD I N C ONTEXT (KWIC): D ESIGN C ONSIDERATIONS

9 K EYWORD I N C ONTEXT (KWIC): S OLUTIONS 1: Main program/subroutine with shared data. 2: Abstract data types. 3: Reactive integration. 4: Dataflow. 9 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

10 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 10 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS K EYWORD I N C ONTEXT (KWIC): S OLUTIONS 1 (M AIN PROGRAM / SUBROUTINE WITH SHARED DATA. )

11 S OLUTION 1: M AIN P ROGRAM /S UBROUTINE 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 11 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

12 KWIC: M AIN PROGRAM / SUBROUTINE WITH S HARED D ATA SOLUTION 12 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

13 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. -------------------- 13 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS KWIC: S HARED D ATA SOLUTION

14 ---------------------------------------------------------------------- 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 14 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

15 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. 15 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS KWIC: ABSTRACT DATA TYPES

16 KWIC: S OLUTION 2: A BSTRACT D ATA T YPES Set char Char Word Set char Char Setup Word alph i-th Master control InputOutput CharactersCircular shiftAlphabetic shift 16 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

17 KWIC: S OLUTION 2: A BSTRACT D ATA T YPES 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 17 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

18 KWIC S OLUTION 3: I MPLICIT I NVOCATION InsertDeletei-th Master control Input LinesShifted lines Alphabetize Circ shift InsertDeletei-th 18 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS Output

19 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 19 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS KWIC S OLUTION 3: I MPLICIT I NVOCATION

20 Advantages Supports functional enhancements to the system. Additional modules can be attached Supports reuse. Disadvantage: Uses more space. 20 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

21 KWIC S OLUTION 4: P IPES AND F ILTERS 21 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS

22 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. 22 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS KWIC S OLUTION 4: P IPES AND F ILTERS

23 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. 23 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS KWIC S OLUTION 4: P IPES AND F ILTERS

24 C OMPARISON Change in algorithm Change in data representation Change in function Performance Reuse SharedAbstractImplicitPipe and datadata typeinvocationfilter --++ -+-- --++ ++-- -+-+ www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 24

25 N EXT … Instrumentation Software 25 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS


Download ppt "Architectural styles and Case studies 1 www.bookspar.com | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS."

Similar presentations


Ads by Google