Upload
mervyn-turner
View
212
Download
0
Embed Size (px)
Citation preview
Design and Planning
Or:
What’s the next thing we should do for our project?
Think about Program Architecture
The organization of code components
The objective of system architecture is to simplify maintenance by
putting code together that will be changed at the same time
Architectural Philosophies
Requirements Driven Data Driven Dialog Driven Event Driven
Coding Standards
StructuredLimit control structures to sequence,
iteration, and selection Event Driven
Interactive systems driven by user actions
Object orientedEncapsulate data and code into objects
that can be called independently
Good Code Maintenance is 80% of the cost of a
large system. Instructions that will be changed
together located together. Finding errors and bugs is
theoretically simplified (fewer possible places to look).
Traditional Design
Traditional Life Cycle ApproachFormal MethodologiesCASE ToolsPurchased Systems
Newer ApproachesRADEvolutionary CodeGUI designObject Oriented Design
Modular Program Design
Goal: software components that can be plugged into any project (like circuits)
Coupling the degree to which each program module
relies on other modules• Loose: modules are independent (roughly)• Tight: one module depends on another
… changes cause ripple effect …
Modular Program Design
Goal: software components that can be plugged into any project (like circuits)
Cohesion Relatedness of actions of a module or class
• Low: module does lots of unrelated things• Hard to maintain, hard to understand
• High: module focused on one task• Aids maintainability and reusability
Good Practice: Loose Coupling
Associations among code modules
Data passed by parametersavoid public variables
Method use of Interfaces as opposed calls to actual method names
Good Practice: Loose Coupling
Measuring level of coupling
How many changes would be needed to do the following:
Changing the order of data elements Changing the names of data elements Changing the structures of data elements
Good Practice: High Cohesion
Functions done by one code module.
A module is a set of code statements that is called and executed together. A cohesive module executes only statements that always go together.
Typical Modules
methods and functions Forms, Reports and Queries Classes
Programming Principles
KISS (Keep it Simple, Stupid)Volatility
Prototyped code will be revised frequently. Simple solutions are much better than elegant ones that are hard to understand.
Clarity over Efficiencymodern optimizing compilers remove many inefficiencies
Programming Principles
Code should be written to be readGood communication principles
White spaceBoxesIndentationExplain complex logic
Modular constructionVery simple control structures
Mnemonic variables
Programming Principles
Minimize external documentationDocument the objective rather than the
procedure. The next programmer can find his own solution too.
Include descriptive and complete title lines
Include an initial statement of program purpose
Line comments hard to maintain
Programming Principles
Fully document data filesUse labels and file descriptionsUse original common data sources where
possibleCreate as few original data tables as
possibleDocument edits and modifications
Programming Principles
Retain natural documentationKeep instructional memos and notes in
fileDocument objectives so that modules
can be reprogrammed as needed
Next Time: Planning/Scheduling Setting a schedule of milestone
dates
How much time for each step and sub-step?
•How to estimate that