Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Architecture” The outcome of top-level design, reflecting principal design decisions Can (and should) be modified and updated Analogous to architecture.

Similar presentations


Presentation on theme: "“Architecture” The outcome of top-level design, reflecting principal design decisions Can (and should) be modified and updated Analogous to architecture."— Presentation transcript:

1 “Architecture” The outcome of top-level design, reflecting principal design decisions Can (and should) be modified and updated Analogous to architecture in buildings – Need a plan before construction begins – Need to reconcile opposing interests and constraints But the analogy is not very good – In software there is much less specialization – Software is much more malleable and easy to fix later (even subject to evolutionary development)

2 Principal Design Decisions Structure (e.g. classes and inheritance) Functional behavior (e.g. sequencing of operations) Communication mechanisms (e.g. events vs. procedure calls) Non-functional properties (e.g. how to achieve reliability) Implementation techniques and frameworks

3 Problem Statement The KWIC (Key Word in Context) 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 word in any line may be identified as the index word. The KWIC index system outputs a listing of all lines with all possible index words, in alphabetical order of the index words.

4 KWIC Example Database index Keyword listing Indexing story keywords Telling stories Database index Indexing story keywords Keyword listing Indexing story keywords Keyword listing Telling stories Indexing story keywords Telling stories

5 Your Task Design a system that implements the KWIC index List modules and interfaces between them No shortcuts (don’t use libraries that do everything) What are the main considerations (why done this way)

6 D. L. Parnas, “On the criteria to be used in decomposing a system into modules”. Comm ACM 15(12), pp. 1053-1058, Dec 1972 Major contributor to information hiding and modularization (this paper) Advocate of software development as an engineering discipline Including good documentation! Opponent of “star wars” Fellow of ACM, IEEE

7

8 1970s Flow-Chart Based Solution Read input Cyclic shift Alpha- betize Output Master control Shared memory data manipulation with pointers data index

9 More Common KWIC Format Database Indexing Keyword story Telling Indexing Database index index Indexing story keywords Keyword listing keywords listing stories story keywords Telling stories Change only output module

10 Ignoring Stop Words Provide list of common words that should not be indexed – The – And – A – Of – It – In – As – This The output should not include lines with these words identified as index words Filter them out in cyclic shifter module

11 Identifying All Keywords All at once – Create multiple copies of each line and store them Possible alternative: incremental – Create shifted copies of lines upon request – Not compatible with flow Useful alternatives depend on interface and may affect calling module

12 Alphabetizing Approach All at once – Alphabetize the whole list – Then output the result Alternative: incremental – Upon request, search for first line – Delete it after use Alternative: mixed – Partition data into sorted segments like quicksort – Alphabetize each segment when needed Hidden only if interface provides an iterator; alternatives not suitable if providing a list

13 Alternative ADT Solution Read input Cyclic shift Alpha- betize Output Master control insert Line storage iterate insert copies iterate provide order interface defining logical operations

14 Another Alternative Solution Read input Cyclic shift Alpha- betize Output Master control insert lines Line storage implementation can copy lines or generate them on demand iterator

15 Another Alternative Solution Read input Cyclic shift Dictionary (alphabetized) Output Master control store lines extract lines Line storage read index iterator store index

16 Design Competitions There is more than one solution Different solutions have different strengths and weaknesses Idea: use multiple design teams in parallel – Common in other fields, e.g. architecture Discuss pros and cons of designs Combine solutions if appropriate

17 Storage Format In first approach this is exposed to all modules – All need to know how to manipulate pointers In second approach this is hidden – Line storage interface is naturally in lines – Can also support words or characters Importantly can select different storage media – In memory – Swap to disk as needed – Store on the cloud Might impact performance

18 Information Hiding Provide possibility of easy adaptation – Design decisions isolated within modules – Using a module is oblivious to the decision (= to the chosen implementation) Provide possibility of easy extension Do not add complexity in order to do so – Avoid YAGNI (You Ain’t Gonna Need It)

19 Architecture and Modules Defined by interfaces Just what a user needs to know and no more – What it does and how to us it – Not how it is implemented Just what an implementer needs to know and no more – What it needs to do – Not how or why it will be used – Free to choose implementation


Download ppt "“Architecture” The outcome of top-level design, reflecting principal design decisions Can (and should) be modified and updated Analogous to architecture."

Similar presentations


Ads by Google