Beruflich Dokumente
Kultur Dokumente
Software Construction
Problems and Solutions Software development process and Software Construction Design (Heuristics and Best Practices)
Computational Models Fundamental Concepts Sequential Programming Concurrent Programming Parallel Programming Distributed Programming Classes of Algorithms
Problem - Solution
Decomposition / Construction view
Problem Decomposition Solution Construction
Solution
SET Sub-Problems
SET Sub-Problems
Problem - Solution
Details
Problem Domain (PD) processes data
PD Observable results
abstraction process
improve
SD results
USER - queries
Problem - Solution
Modeling gap
Modeling Classical
Semantic Gap
Modeling OO Modeling
data abstraction and ADTs class dual meaning
Software
Construction
Requirements
Design
Integration / Testing
Level 1 - Overall system design Level 2 - System level design Levels 3,4,5 Detailed Design
The big black box Subsystems and packages Design Level 3 - Subsystem/package level design
for each subsystem: Interfaces, Classes, Relationships
Design Level 4 - Class level design Design Level 5 - Data and function level design
Unit
coding / Unit testing planning / testing (Subsystem level) System integration and testing planning
Integration
9
Design
Objective:
Design
complexity
designers
Use heuristics
10
Design dimensions
1. Find abstractions 2. Encapsulate implementation details 3. Hide secret parts (information hiding) 4. Inherit and / or delegate 5. Anticipate changes 6. Keep coupling loose and cohesion strong 7. Look for common design patterns 8. Think of associating things 9. Design for test
11
Design documentation
UML
diagrams CRC cards (class, responsibility, collaboration) Document the design into the code Wiki pages for collaborative designs
12
13
tolerant
integrity
Consistency Efficiency
14
complexity Ease of maintenance Loose coupling among design (program) parts Extensibility / Scalability Reusability Stratification Standard techniques.
15
16
17
[Wikipedia]
a replicable method or approach for directing one's attention in learning, discovery, or problem-solving.
George
18
the parts of each object that is visible to other objects Define each objects public interface Exercise
Find
a few related real world objects and answer the above questions
19
At each level underlines important features and ignoring the details Examples
At a given level of abstraction house is a combination of bricks, glasses, doors, roof, timber and mortar At another level - door is an abstraction of a collection of rectangular pieces of materials, knob, small window, etc. At a higher level - village - a collection of houses as a is another abstraction Base
Example Encapsulation
21
out the commonalities among objects and organize them in hierarchies The upper abstractions define attributes and behavior that are common to all lower abstractions
22
is a concept related to aggregation A complex object consists of a set of objects of lower complexity A method that is invoked in association with the complex object delegates parts of its functionality to lower level component objects Example
23
hiding
Specific to both structured design and OOD In OOD the concept is close related to abstraction, encapsulation and modularity
OO
information hiding
Each class should hide (keep secret) its design or construction decisions from all other classes Class design decision
What is public and what is secret
Examples
24
and accommodate
changes
attribute of a good program design
Isolate
unstable areas
25
Types
of coupling
Simple data parameter coupling Simple object coupling Object-parameter coupling Semantic coupling (dangerous)
26
the module internal construction A cohesive module (component) performs a single task with very few interactions with routines of other modules Types of cohesion (from high cohesion to low cohesion)
functional (desirable) sequential communicational procedural temporary logical coincidental (non desirable)
27
for common design patterns Design for test Choose carefully binding time Draw diagrams Keep the design modular
28
Design Practices
Iterate Divide
et Impera
Design
29
Design Practices
Divide et Impera - Top Down (Procedural Development)
Stub
Module
Module
Proc
Proc
Proc
Proc
30
Design Practices
Divide et Impera Bottom Up (OO development)
Integration Driver
Integration Driver
Class
Driver
Integration Driver
Driver
Class
Class
Driver
31
Part 2
Programming Objective
Paradigms
32
Programming features
(Computer)
Programming
science of creating software for solving problems both knowledge intensive and labor intensive process
Problem
dimensions
Modern
problem Problem - Programming Language mapping Are there any decision metrics??
Computational Models
Computing Model Main Abstractions
Procedural Oriented Procedures Algorithms Substitution principle Objects and classes
Object Oriented
Rule Oriented
If-then rules
Logic Oriented
Constraint Oriented
Programming paradigms
Procedural programming
features Representative languages: Fortran, Algol 60, Cobol, Pascal, C (partial C++)
OOP
main features Simula, Smalltalk, C++, Java, C#
Concurrent programming
main features PL/I, Algol 68, Modula, Ada83, Ada95
Functional programming
main features Lisp, ML, Haskel
Logic programming:
main features Prolog
Scripting languages
main features Ruby
Sequential Programming
Execution
Concurrent Programming
Concurrent
program
Transform
programming
Assigning the smaller tasks to multiple workers to work on simultaneously. Coordinating the workers
40
Parallel programming
Special
Parallel programming
Approaches
Parallel
Distributed programming
Special
Interprocess
communication
Why concurrent programming is more difficult than sequential programming? A: mainly due to management of
control flow of multiple execution threads data placement and access of global data. synchronizing events
programming
Expressed as functions of n inputs generating m outputs Program behavior depends on program current state and input Can be parallelized
programming
Interact with the environment during execution; Cannot be specified as a function Event driven programming Inherently non-deterministic
Note
The references used for preparing these lecture notes are indicated in the Bibliography folder of the course site
47