4 A good design Implement all explicit and implicit requirements Be a readable and understandable guide for developers and customersProvide a complete picture of software
5 Design Principles (1)From Davis [DAV95]The design process should not suffer from ‘tunnel vision.’The design should be traceable to the analysis model.The design should not reinvent the wheel.The design should “minimize the intellectual distance” between the software and the problem as it exists in the real world.The design should exhibit uniformity and integration.
6 Design Principles (2)From Davis [DAV95]The design should be structured to accommodate change.The design should be structured to degrade gently, even when aberrant data, events, or operating conditions are encountered.Design is not coding, coding is not design.The design should be assessed for quality as it is being created, not after the fact.The design should be reviewed to minimize conceptual (semantic) errors.
7 Fundamental Concepts Abstraction — data, procedure, control Refinement — elaboration of detail for bstractionsModularity — compartmentalize data and functionArchitecture — overall structure of the softwarePartitioning — partition the program structureData structure — the logical relationship of dataProcedure — the algorithms that achieve functionHiding — controlled interfacesFunction independences — cohesion, coupling
9 Data Abstraction door manufacturer model number type swing direction insertslightstypenumberweightopening mechanismimplemented as a data structure
10 Procedural Abstraction opendetails of enteralgorithmimplemented with a "knowledge" of theobject that is associated with enter
11 Refinement Refinement — elaboration of detail for all abstractions openwalk to door;reach for knob;open door;repeat until door opensturn knob clockwise;walk through;if knob doesn't turn, thenclose door.take key out;find correct key;insert in lock;endifpull/push doormove out of way;end repeat
12 Modular Designmodularity—compartmentalization of data & function
16 An Effective Modular System Modular decomposabilityModular composabilityModular understandabilityModular continuityModular protection
17 Architecture“The overall structure of the software and the ways in which that structure provides conceptual integrity for a system.” [SHA95a]superordinatesubordinate
18 Partitioning the Architecture “horizontal” and “vertical” partitioning are required
19 Horizontal Partitioning define separate branches of the module hierarchy for each major functionuse control modules to coordinate communication between functionsfunction 1function 3function 2
20 software that is easier to test software that is easier to maintainpropagation of fewer side effectssoftware that is easier to extend
21 Vertical Partitioning: Factoring design so that decision making and work are stratifieddecision making modules should reside at the top of the architecturedecision-makersworkers
22 Data Structure Data Structure — a representation of the logical relationshipItem: integer, string…Vector: arraySpace: structureLinked list, node
23 Software ProcedureProcedure — a precise specification ofprocessing
24 Information Hiding Hiding — controlled interfaces module clients "secret"clientsa specific design decision
25 Why Information Hiding? Leads to encapsulation — an attribute of high quality designReduces the likelihood of “side effects”Limits the global impact of local design decisionsEmphasizes communication through controlled interfacesDiscourages the use of global dataResults in higher quality software
26 Functional Independence COHESION - the degree to which amodule performs one and only onefunction.COUPLING - the degree to which amodule is "connected" to othermodules in the system.
27 CohesionThe degree to which a module performs one and only one function
28 CouplingA measure of interconnection among modules
31 Design HeuristicsEvaluate the “first iteration” of the program structure to reduce coupling and improve cohesion.Attempt to minimize structures with high fan-out; strive for fan-in as depth increases.Keep the scope of effect of a module within the scope of control of that module.Evaluate module interfaces to reduce complexity and redundancy and improve consistency.Define modules whose function is predictable, but avoid modules that are overly restrictive.Strive for “controlled entry” modules by avoiding “pathological connections.”