Function-oriented design portions ©Ian Sommerville 1995 Design with functional units which transform inputs to outputs.

Slides:



Advertisements
Similar presentations
Chapter 26 Legacy Systems.
Advertisements

Chapter 7 System Models.
Legacy Systems Older software systems that remain vital to an organisation.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
IFS310: Week 3 BIS310: Structured Analysis and Design 5/4/2015 Process Modeling and Data Flow Diagrams.
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
What is Software Design?  Introduction  Software design consists of two components, modular design and packaging.  Modular design is the decomposition.
Copyright Irwin/McGraw-Hill Software Design Prepared by Kevin C. Dittman for Systems Analysis & Design Methods 4ed by J. L. Whitten & L. D. Bentley.
3/5/2009Computer systems1 Analyzing System Using Data Dictionaries Computer System: 1. Data Dictionary 2. Data Dictionary Categories 3. Creating Data Dictionary.
Systems Analysis and Design 9th Edition
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Chapter 9 Describing Process Specifications and Structured Decisions
Chapter 9 Describing Process Specifications and Structured Decisions Systems Analysis and Design Kendall & Kendall Sixth Edition © 2005 Pearson Prentice.
Chapter 9 Describing Process Specifications and Structured Decisions
Modified from Sommerville’s originalsSoftware Engineering, 5th edition. Chapter 15 Slide 1 Function-oriented design Software Engineering Ian Sommerville.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Modified from Sommerville’s originalsSoftware Engineering, 5th edition. Chapter 15 Slide 1 Function-oriented design Software Engineering Ian Sommerville.
CSEM01 SE Evolution & Management Anne Comer Helen Edwards
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 71 System models l Abstract descriptions of systems whose requirements are being analysed.
Application architectures
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
Chapter 7: System models
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Data Flow Diagrams (DFDs)
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
Function-oriented Design
Chapter 4 System Models A description of the various models that can be used to specify software systems.
System models Abstract descriptions of systems whose requirements are being analysed Abstract descriptions of systems whose requirements are being analysed.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 15Slide 1 Function-oriented Design u Design with functional units which transform inputs.
© Andrew IrelandSoftware Design F28SD2 Function-oriented Design Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt University Edinburgh.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
©Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions.
1 Software Design Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13, 5 th edition and Ch. 10, 6 th edition.
Software Design Deriving a solution which satisfies software requirements.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
Chapter 7 System models.
Elements of Software Analysis and Design - Structured Approaches - Structured Analysis - Functional Oriented Design 10/24/2015ICS 413 – Software Engineering1.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
System models l Abstract descriptions of systems whose requirements are being analysed.
CS 4310: Software Engineering Lecture 4 System Modeling The Analysis Stage.
Modified by Juan M. Gomez Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
Systems Analysis and Design in a Changing World, 3rd Edition
Systems analysis and design, 6th edition Dennis, wixom, and roth
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 15Slide 1 Function-oriented design u Design with functional units which transform inputs.
Software Engineering, 8th edition Chapter 8 1 Courtesy: ©Ian Somerville 2006 April 06 th, 2009 Lecture # 13 System models.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 Chapter 7 System Models.
CCSB223/SAD/CHAPTER131 Chapter 13 Designing the System Internals.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Chapter 12, Slide 1 Concurrency Motivation 1: Mutual Exclusion  John and Mary share a bank acc't  withdraw x = copy balance to local machine subtract.
Systems Design.  Application Design  User Interface Design  Database Design.
Application architectures Advisor : Dr. Moneer Al_Mekhlafi By : Ahmed AbdAllah Al_Homaidi.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Systems Analysis and Design in a Changing World, Fourth Edition
Engineering, 7th edition. Chapter 8 Slide 1 System models.
Coupling and Cohesion Rajni Bhalla.
Software Specification Tools
Problem Solving How do we attack a large problem?
Concurrency Motivation 1: Mutual Exclusion
Software Design Mr. Manoj Kumar Kar.
Abstract descriptions of systems whose requirements are being analysed
Software Design CMSC 345, Version 1/11.
Chapter 7: Data Flow Diagram Structuring System Process Requirements
Chapter 11 Describing Process Specifications and Structured Decisions
Function-oriented Design
Presentation transcript:

Function-oriented design portions ©Ian Sommerville 1995 Design with functional units which transform inputs to outputs

Objectives To explain how a software design may be represented as a set of functions which share state To introduce notations for function-oriented design To illustrate the function-oriented design process by example

Topics covered Data-flow design Structural decomposition Detailed design A comparison of design strategies

Function-oriented design Practiced informally since programming began Thousands of systems have been developed using this approach Supported directly by most programming languages Most design methods are functional in their approach CASE tools are available for design support

A function-oriented view of design

Functional and object-oriented design For many types of application, object-oriented design is likely to lead to a more reliable and maintainable system Some applications maintain little state - function-oriented design is appropriate Standards, methods and CASE tools for functional design are well-established Existing systems must be maintained - function-oriented design will be practiced well into the 21st century

Natural functional systems Some systems are naturally function-oriented Systems which maintain minimal state information i.e. where the system is concerned with processing independent actions whose outcomes are not affected by previous actions Information sharing through parameter lists Transaction processing systems fall into this category. Each transaction is independent.

An ATM system design (1) loop Print_input_message (” Welcome - Please enter your card”) ; exit when Card_input ; end loop ; Account_number := Read_card ; Get_account_details (PIN, Account_balance, Cash_available) ; if Validate_card (PIN) then loop Print_operation_select_message ; case Get_button is when Cash_only => Dispense_cash (Cash_available, Amount_dispensed) ; when Print_balance => Print_customer_balance (Account_balance) ;

An ATM system design (2) when Statement => Order_statement (Account_number) ; when Check_book => Order_checkbook (Account_number) ; end case ; Eject_card ; Print (“Please take your card or press CONTINUE”) ; exit when Card_removed ; end loop ; Update_account_information (Account_number, Amount_dispensed) ; else Retain_card ; end if ; end loop ;

Functional design process Data-flow design –Model the data processing in the system using data- flow diagrams Structural decomposition –Model how functions are decomposed to sub-functions using graphical structure charts Detailed design –The entities in the design and their interfaces are described in detail. These may be recorded in a data dictionary and the design expressed using a PDL

Data flow diagrams Show how an input data item is functionally transformed by a system into an output data item Are an integral part of many design methods and are supported by many CASE systems May be translated into either a sequential or parallel design. In a sequential design, processing elements are functions or procedures; in a parallel design, processing elements are tasks or processes

DFD notation Rounded rectangle - function or transform Rectangle - data store Circles - user interactions with the system Arrows - show direction of data flow Keywords and/or used to link data flows

Design report generator Sort entity names Get entity names Design database Get design name Design name Look up entity names Data dictionary Sort by type Entity names Sorted names Design entity descriptions Produce node report Produce link report Integrate report Print report Link descriptions Node descriptions Integrated report Node report Link report and

Structural decomposition is concerned with developing a model of the design which shows the dynamic structure i.e. function calls This is not the same as the static composition structure The aim of the designer should be to derive design units which are highly cohesive and loosely coupled In essence, a data flow diagram is converted to a structure chart Structural decomposition

Decomposition guidelines For business applications, the top-level structure chart may have four functions namely input, process, master-file-update and output Data validation functions should be subordinate to an input function Coordination and control should be the responsibility of functions near the top of the hierarchy

Decomposition guidelines The aim of the design process is to identify loosely coupled, highly cohesive functions. Each function should therefore do one thing and one thing only Each node in the structure chart should have between two and seven subordinates

Process steps Identify system processing transformations –Transformations in the DFD which are concerned with processing rather than input/output activities. Group under a single function in the structure chart Identify input transformations –Transformations concerned with reading, validating and formatting inputs. Group under the input function Identify output transformations –Transformations concerned with formatting and writing output. Group under the output function

Initial structure chart Produce design reports Collate entities Generate report Get design entity names Design name Design entity names Design Report entity names entity data entity data entity names

Expanded structure chart Produce design reports Collate entities Generate report Get design entity names entity names sorted entity data names Get design name Get entity names Sort entities by name Get entity data Sort entities by type Produce integrated report Print report design name entity names report entity data design name names sorted names entity data sorted entity data sorted entity data Integrated report sorted entity data

Final structure chart Data dictionary design name entity names report entity data Design database design name entity name Produce link report Produce node report Link data Link report Node data Node report Produce design reports Collate entities Generate report Get design entity names entity names sorted entity data names Get design name Get entity names Sort entities by name Get entity data Sort entities by type Produce integrated report Print report design name names sorted names entity data sorted entity data sorted entity data Integrated report sorted entity data

Detailed design Concerned with producing a short design specification (mini-spec) of each function. This should describe the processing, inputs and outputs These descriptions should be managed in a data dictionary From these descriptions, detailed design descriptions, expressed in a PDL or programming language, can be produced

Data dictionary entries

Design entity information Get entity names Design database Sort entity names Data dictionary Get design name Design name Entity names Transform name: Sort entity names (Namelist in out Names) Description: This transform takes a list of entity names and sorts them into ascending alphabetical order. Duplicates are removed from the list. It is anticipated that the names will be randomly ordered and that a maximum of 200 names need be sorted at one time. A quicksort algorithm is recommended.

A comparison of design strategies An example of an office information retrieval system (OIRS) is used to compare different design strategies Functional design, concurrent systems design and object-oriented design are compared The OIRS is an office system for document management. Users can file, maintain and retrieve documents using it

OIRS user interface QuitNewStyle Known Indexes Current Indexes Chapter 15 SE Book Document Name Qualifier Operations Get Document Put Document Search Database Add Index Delete Index Delete Document Clear Documents4 documents in workspace Function-oriented design is an approach to software design where the design is decomposed into a set of interacting units where each unit has a clearly defined function. By comparison with object-oriented design, the design components in this approach are cohesive around a function whereas object- oriented cohesion is around some abstract data entity. Function-oriented design has probably been practiced since programming began, but it was only in the late 1960’s and early 1970’s that it began to

Operation field. –Pull-down menu allowing an operation to be selected. Known and current indexes fields –Pull-down menus of indexes Document name. –Name under which the document is to be filed. Qualifier field –Pattern used in retrieval. Current workspace –Contains the documents currently being used. May be edited with word processor Interface description

OIRS inputs and outputs OIRS Document database Document database Current workspace Current workspace User command Status message and or and

Fetch-execute model procedure Interactive_system is begin loop Command := Get_command; if Command = “quit” then -- Make sure files etc. are closed properly Close_down_system ; exit ; else Input_data := Get_input_data ; Execute_command (Command, Input_data, Output_data) ; end if ; end loop ; end Interactive_system ;

Top-level OIRS DFD Get command Update database Document database Current workspace Execute command Update workspace Current workspace Document database Put status message Status message

What strategy should be adopted in decomposing Execute command? Are the input and output data flows processed independently or are they inter-dependent. If independent, there should be a central transform for each processing unit Is the central transform a series of transforms? If so, each logical element in the series should be a single transformation Design decisions

Execute command DFD Identify command type Update index Update database Update workspace Known indexes User command Index update command Workspace update command Workspace Selected document Status message WorkspaceStatus message Database update request Workspace Selected document DB update command

OIRS design description (1) procedure OIRS is begin User := Login_user ; Workspace := Create_user_workspace (User) ; -- Get the users own document database using the user id DB_id := Open_document_database (User) ; -- get the user’s personal index list; Known_indexes := Get_document_indexes (User) ; Current_indexes := NULL ; -- command fetch and execute loop loop Command := Get_command ; exit when Command = Quit ; Execute_command ( DB_id, Workspace, Command, Status) ;

OIRS design description (2) if Status = Successful then Write_success_message ; else Write_error_message (Command, Status) ; end if ; end loop ; Close_database (DB_id) ; Logout (User) ; end OIRS ;

Data flow diagrams explicitly exclude control information. They can be implemented directly as concurrent processes. Logical groups of transformations can also be implemented as concurrent processes e.g. input data collection and checking The OIRS system can be implemented as a concurrent system with command input, execution and status reporting implemented as separate tasks Concurrent systems design

OIRS process decomposition Execute command Get command Output message Workspace editor User input Message

Detailed process design procedure Office_system is task Get_command ; task Process_command is entry Command_menu ; entry Display_indexes ; entry Edit_qualifier ; -- Additional entries here. One for each command end Process_commands ; task Output_message is entry Message_available ; end Output_message ; task Workspace_editor is entry Enter ; entry Leave ; end Workspace_editor ;

Detailed process design (1) task body Get_command is begin -- Fetch/execute loop loop Cursor_position := Get_cursor_position ; exit when cursor positioned in workspace or (cursor positioned over menu and button pressed) Display_cursor_position ; end loop ; if In_workspace (Cursor_position) then Workspace_editor.Enter ; elseif In_command_menu (Cursor_position) then Process_command.Command_menu ;

Detailed process design (2) elsif In_Known_indexes (Cursor_position) then Process_command.Display_indexes ; elsif In_Current_indexes (Cursor_position) then... Other commands here... end loop ; -- Fetch/execute end Get_command ; -- other task implementations here end Office_system ;

Function-oriented design relies on identifying functions which transform inputs to outputs Many business systems are transaction processing systems which are naturally functional The functional design process involves identifying data transformations, decomposing functions into sub-functions and describing these in detail Key points

Data-flow diagrams are a means of documenting end-to-end data flow. Structure charts represent the dynamic hierarchy of function calls Data flow diagrams can be implemented directly as cooperating sequential processes