Design in Construction

Slides:



Advertisements
Similar presentations
Software Engineering Key design concepts Design heuristics Design practices.
Advertisements

Software Modeling SWE5441 Lecture 3 Eng. Mohammed Timraz
By Justin Hendrix. Design Challenges Design is the activity that links requirements to coding and debugging. Good design is useful on small project and.
High Quality Code Why it matters. By Ryan Ruzich.
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
High Quality Code – Style Matters  Chapter 5. Design in Construction  Chapter 31. Layout and Style Software Construction by Jeff Nogy.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
The Software Design Process CPSC 315 – Programming Studio Fall 2009.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
An Introduction to Software Architecture
CSE 303 – Software Design and Architecture
CS 350 – Software Design The Object Paradigm – Chapter 1 If you were tasked to write code to access a description of shapes that were stored in a database.
THE SOFTWARE DESIGN PROCESS CSCE 315 – Programming Studio Spring 2010.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
SE: CHAPTER 7 Writing The Program
GRASP: Designing Objects with Responsibilities
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Requirement Engineering Virtusa Training Group 2004 Trainer: Ojitha Kumanayaka Duration : 1 hour.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
High Quality Code – Style Matters  Design in Construction  Layout and Style Software Construction by Jeff Nogy.
Basic Characteristics of Object-Oriented Systems
CSCE 240 – Intro to Software Engineering Lecture 3.
Dillon: CSE470: ANALYSIS1 Requirements l Specify functionality »model objects and resources »model behavior l Specify data interfaces »type, quantity,
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Design Concepts ch-8
Principles of Programming & Software Engineering
Object Oriented Systems Design
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
7. Modular and structured design
CompSci 280 S Introduction to Software Development
Algorithms and Problem Solving
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Systems Analysis and Design With UML 2
Chapter 11 Object-Oriented Design
Unified Modeling Language
System Design.
Lecture 9- Design Concepts and Principles
Principles of Programming and Software Engineering
Chapter 5 Design in Construction
CIS 375 Bruce R. Maxim UM-Dearborn
The Software Design Process
Objects First with Java
Software Engineering Lecture #8.
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Lecture 9- Design Concepts and Principles
Programming Logic and Design Fourth Edition, Comprehensive
An Introduction to Software Architecture
Producing Production Quality Software
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Algorithms and Problem Solving
Software Design Principles
Tonga Institute of Higher Education IT 141: Information Systems
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Tonga Institute of Higher Education IT 141: Information Systems
What Is Good Software(Program)?
Design Yaodong Bi.
CS 2704 Object Oriented Software Design and Construction
Top-Down Design & JSP Skill Area Part D
Chapter 8 - Design Strategies
Jim Fawcett CSE687 – Object Oriented Design Spring 2015
Presentation transcript:

Design in Construction SCMP 391.00 Special Topic: Software Development Spring 2017 James Skon

Why Prepare? The phrase "software design" means the conception, invention, or contrivance of a scheme for turning a specification for computer software into operational software

Design Is a Wicked Problem ‘tame’ problems are not necessarily easy. Instead, what distinguishes them from the wicked kind is that a tame problem tends to be well understood; it can be solved using sequential processes; it begins with an unambiguous problem statement, and, finally, ends with a correct (read: verifiable) solution. a "wicked" problem is one that could be clearly defined only by solving it, or by solving part of it

10 main criteria for wicked problems There is no definitive formulation of a Wicked Problem. Wicked Problems have no stopping rule1. Solutions are not True/False but Good/Bad. There is no ultimate test of a solution to a Wicked Problem. Each solution is a one shot operation. Wicked Problems do not have enumerable (exhaustively describable) solutions. Each problem is unique. Each problem is a symptom of another problem. There are a number of different stakeholders interested in how it is solved. The planner has no right to be wrong. In other words there is a (perhaps) unreasonable expectation that the designers will produce a suitable and sound solution in the first attempt.

Design Design Is a Sloppy Process (Even If it Produces a Tidy Result) Design Is About Tradeoffs and Priorities Design Involves Restrictions Design Is Nondeterministic Design Is a Heuristic Process Design Is Emergent

Key Design Concepts Managing Complexity The human mind is limited in how much detail it can conceive at any one time. There are two ways of constructing a software design: one way is to make it so simple that there are obviously no deficiencies, and the other is to make it so complicated that there are no obvious deficiencies. —C. A. R. Hoare

Managing Complexity complexity of a problem can be reduced by dividing the system into subsystems The goal of all software-design techniques is to break a complicated problem into simple pieces. The more independent the subsystems are, the more you make it safe to focus on one bit of complexity at a time.

How to Attack Complexity Minimize the amount of essential complexity that anyone's brain has to deal with at any one time. Keep accidental complexity from needlessly proliferating.

Desirable Characteristics of a Design Minimal complexity Ease of maintenance Loose coupling Extensibility Reusability High fan-in Low-to-medium fan-out

Desirable Characteristics of a Design Portability Leanness Stratification (layering) Standard techniques

Levels of Design

Level 1: Software System The first level is the entire system. Some programmers jump right from the system level into designing classes, but it's usually beneficial to think through higher level combinations of classes, such as subsystems or packages.

Level 2: Division into Subsystems or Packages Identification of all major subsystems

Level 2: Division into Subsystems or Packages The goal is to design for minimal coupling Excessive coupling

Questions to ask about subsystems How many different parts of the system does a developer need to understand at least a little bit to change something in the graphics subsystem? What happens when you try to use the business rules in another system? What happens when you want to put a new user interface on the system, perhaps a command-line UI for test purposes? What happens when you want to put data storage on a remote machine?

Minimize coupling With a few communication rules, you can simplify subsystem interactions significantly.

Minimize coupling A good general rule is that a system-level diagram should be an acyclic graph. In other words, a program shouldn't contain any circular relationships in which Class A uses Class B, Class B uses Class C, and Class C uses Class A.

Common Subsystems Business rules - laws, regulations, policies, and procedures that you encode into a computer system User interface – should evolve independently Database access – isolate/hide database details System dependencies – Provide a generic interface to make code portable.

Level 3: Division into Classes Classes vs. Objects A class is the static thing you look at in the program listing. An object is the dynamic thing with specific values and attributes you see when you run the program. You could think of the class as the cookie cutter and the object as the cookie.

Level 3: Division into Classes Define the interface for each class.

Level 4: Division into Routines The class interface defined at Level 3 will define some of the routines. There will also be private routines

Level 5: Internal Routine Design laying out the detailed functionality of the individual routines Actually coding and data structure design.

Design Heuristics Design is a nondeterministic, skillful application of an effective set of heuristics. Algorithm – Either correct or not Heuristics – a procedure that often gives good results.

Design Heuristics Find Real-World Objects identify the objects and their attributes (methods and data). Determine what can be done to each object. Determine what each object is allowed to do to other objects. Determine the parts of each object that will be visible to other objects—which parts will be public and which will be private. Define each object's public interface.

Design Heuristics Form Consistent Abstractions Abstraction is the ability to engage with a concept while safely ignoring some of its details—handling different details at different levels. From a complexity point of view, the principal benefit of abstraction is that it allows you to ignore irrelevant details.

Design Heuristics Encapsulate Implementation Details A good abstraction hides the details of of the implementation Using housing-materials analogy: encapsulation is a way of saying that you can look at the outside of the house but you can't get close enough to make out the door's details. You are allowed to know that there's a door, and you're allowed to know whether the door is open or closed, but you're not allowed to know whether the door is made of wood, fiberglass, steel, or some other material, and you're certainly not allowed to look at each individual wood fiber.

Design Heuristics Inherit—When Inheritance Simplifies the Design

Design Heuristics Hide Secrets (Information Hiding) Strive for class interfaces that are complete and minimal. —Scott Meyers This is a type of complexity management This also makes code maintainable and reusable. Example – Same car, different engines.

Design Heuristics - Information Hiding Secrets in information hiding fall into two general camps: Hiding complexity so that your brain doesn't have to deal with it unless you're specifically concerned with it Hiding sources of change so that when change occurs, the effects are localized

Design Heuristics - Information Hiding Barriers to Information Hiding Excessive distribution of information Hard coded literal User interface throughout system Global variables Circular dependencies Class A -> class B -> class A

Design Heuristics Identify Areas Likely to Change Separate items that are likely to change. Isolate items that seem likely to change.

Areas Likely to Change Hardware dependencies Input and output Nonstandard language features Difficult design and construction areas Status variables Use an enumerated types Use access routines rather than checking the variable directly Data-size constraints

Design Heuristics Keep Coupling Loose Allows reusability Keeps things simple

Design Heuristics Keep Coupling Loose Try to create modules that depend little on other modules float Interest( rate, principal ) Too many parameters… float risk( assets, liabilities, health, children, marriage, history, …) Int a, b, c float calc1( info ) { a = b * c – info; …. } float calc1( stuff ) { c = b – a^info ….} Global variables increase coupling…

Coupling Criteria Size - number of connections between modules Visibility - prominence of the connection between two modules Flexibility - how easily you can change the connections between modules.

Kinds of Coupling Simple-data-parameter coupling – passing parameters Simple-object coupling - instantiates an object - good Object-parameter coupling – passing objects - tight Semantic coupling - one module makes use of some semantic knowledge of another module's inner workings – bad!

Design Heuristics Look for Common Design Patterns Don’t reinvent the wheel! Patterns reduce complexity by providing ready-made abstractions Patterns reduce errors by institutionalizing details of common solutions Patterns provide heuristic value by suggesting design alternatives Patterns streamline communication by moving the design dialog to a higher level

Polya’s approach to problem solving Understand the problem Devise a plan Carry out the plan Look back

Major design Practices Iterate Divide and Conquer Top-Down and Bottom-Up Design Approaches Experimental Prototyping Collaborative Design

Argument for Top Down The guiding principle behind the top-down approach is the idea that the human brain can concentrate on only a certain amount of detail at a time. If you start with general classes and decompose them into more specialized classes step by step, your brain isn't forced to deal with too many details at once.

Argument for Bottom Up Sometimes the top-down approach is so abstract that it's hard to get started. Ask yourself what you know the system needs to do. Identify concrete objects and responsibilities from that question. Identify common objects, and group them using subsystem organization, packages, composition within objects, or inheritance, whichever is appropriate. Continue with the next level up, or go back to the top and try again to work down.

Experimental Prototyping Sometimes you can't really know whether a design will work until you better understand some implementation detail. Use simple prototype code to answer questions, reduce risk, and to prove concepts. Must be careful prototype does not become product!

Capturing Your Design Work This is important documentation Insert design documentation into the code itself Capture design discussions and decisions on a Wiki Write e-mail summaries Use a digital camera Save design flip charts