a brief introduction to structured design errol pelchat csci 360 2-14-2004

15
A Brief Introduction to A Brief Introduction to Structured Design Structured Design Errol Pelchat Errol Pelchat CSCI 360 CSCI 360 2-14-2004 2-14-2004

Post on 22-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

A Brief Introduction toA Brief Introduction to Structured DesignStructured Design

Errol PelchatErrol Pelchat

CSCI 360CSCI 360

2-14-20042-14-2004

Structured Design isStructured Design is

• A programming ParadigmA programming Paradigm

• The opposite of Unstructured DesignThe opposite of Unstructured Design

• A method to help plan your program before A method to help plan your program before you code it.you code it.

• A top-down approach to designA top-down approach to design

• A way to design your program to make it A way to design your program to make it easier to code, change, maintain and easier to code, change, maintain and understand.understand.

General Description

Structured Design isStructured Design is

Specific Description

A methodology for breaking down a problem A methodology for breaking down a problem (goal/task/system) into smaller problems and (goal/task/system) into smaller problems and solving the smaller problems (divide). Sub-solving the smaller problems (divide). Sub-problems are then arranged into a hierarchy problems are then arranged into a hierarchy that forms a sequence of procedures that forms a sequence of procedures (conquer).(conquer).

“Structured design is the art of designing the components of a system and the interrelationship between those components in the best possible way. “

”Successful design is based on a principle known since the days of Julius Caesar: Divide and conquer.”

- Edward Yourdon

Why structured design?Why structured design?

• Good design makes for good programsGood design makes for good programs

• It makes code easier to understand It makes code easier to understand

• Helps to make programs modularHelps to make programs modular

• It is easier to trouble shootIt is easier to trouble shoot

• It makes programming more systematic and less It makes programming more systematic and less ambiguousambiguous

Basic StepsBasic Steps

• Identify Major Components of task/problem/goal/systemIdentify Major Components of task/problem/goal/system

• Decompose it into these components (the components Decompose it into these components (the components represent procedures)represent procedures)

• Group related components Group related components

• Repeat the process as needed on individual components.Repeat the process as needed on individual components.

• Organize components in a way that makes sense (such as a Organize components in a way that makes sense (such as a hierarchy, with and a consideration for data flow)hierarchy, with and a consideration for data flow)

The Big IdeaThe Big Idea

Concern about the quality of programming code, and ways of Concern about the quality of programming code, and ways of making it easier to demonstrate the correctness of a program was making it easier to demonstrate the correctness of a program was needed. Structured Design/Structured Programming was purposed needed. Structured Design/Structured Programming was purposed in the 1960s to promote a more organized approach to in the 1960s to promote a more organized approach to programming, and reduce bad coding habits that can cost excessive programming, and reduce bad coding habits that can cost excessive time and effort ($$$).time and effort ($$$).

The Structured approach purposed a methodology that would allow The Structured approach purposed a methodology that would allow us to better demonstrate correctness and improve quality of program us to better demonstrate correctness and improve quality of program code for long term use.code for long term use.

Structured ProgrammingStructured Programming

• Structured Programming is the Structured Programming is the implementation of a Structured implementation of a Structured design.design.

• 1960s Structured Programming1960s Structured Programming

• 1970s Structured Design1970s Structured Design

• 1980s Structured Analysis1980s Structured Analysis

Structured

Analysis

Structured

Design

Structured

Programming

Structured versus UnstructuredStructured versus Unstructured

Structured Design HeuristicsStructured Design Heuristics

• Design should be as modular as possible where it makes sense.Design should be as modular as possible where it makes sense.

• Parts that are related to one another should be grouped Parts that are related to one another should be grouped together, and unrelated parts should be distanced.together, and unrelated parts should be distanced.

• Black boxes should be used when possible “rule of black boxes”Black boxes should be used when possible “rule of black boxes”

“Whenever a function or capability is seen as being required during the design of a system, define it as a black box and make use of it in the system without concern for its structural or methodological realization. “

-Edward Yourdon

ImplementationImplementation

• The is no one philosophy for The is no one philosophy for implementing a structured design.implementing a structured design.– Use of the Use of the gotogoto statement statement

((Donald Knuth vs. Edsger DijkstraEdsger Dijkstra))

– The invention of abstract data typesThe invention of abstract data types– Object Orientated ProgrammingObject Orientated Programming

The The GotoGoto Statement Statement

• Edsger Dijkstra suggested that it be Edsger Dijkstra suggested that it be banned from higher level banned from higher level programming languagesprogramming languages

• It can break the hierarchy or It can break the hierarchy or sequence of a program reducing sequence of a program reducing modularitymodularity

• Does not need an interface to Does not need an interface to executeexecute

Structured Design & OODStructured Design & OOD

• Similarly suggests breaking down problems Similarly suggests breaking down problems into smaller pieces (procedures , objects)into smaller pieces (procedures , objects)

• OOD designs in terms of objects, Structured OOD designs in terms of objects, Structured Design in terms of procedures.Design in terms of procedures.

• Object Orientated Design has a greater Object Orientated Design has a greater focus on encapsulation, and information focus on encapsulation, and information hiding. Structured design tends (but not hiding. Structured design tends (but not always) focus on separating data from the always) focus on separating data from the procedures.procedures.

SourcesSources

WebWeb • Yourdon, Edward and Constantine, Larry , Yourdon, Edward and Constantine, Larry , Structured Design: Fundamentals of a Discipline Structured Design: Fundamentals of a Discipline

of Computer Program and System Design, of Computer Program and System Design, Selected quotes compiled by Tom VerhoeffSelected quotes compiled by Tom Verhoeff http://www.win.tue.nl/~wstomv/quotes/structured-design.htmlhttp://www.win.tue.nl/~wstomv/quotes/structured-design.html• Wikipedia, Wikipedia, Structured ProgrammingStructured Programming , ,http://en.wikipedia.org/wiki/Structured_programminghttp://en.wikipedia.org/wiki/Structured_programming• Dijkstra, Edgar W., Dijkstra, Edgar W., Go To Statement Consider HarmfulGo To Statement Consider Harmful, ,

http://www.acm.org/classics/oct95/http://www.acm.org/classics/oct95/• Developer.com, Developer.com, Object Lessons: The Future of OO DesignObject Lessons: The Future of OO Design

http://www.developer.com/design/article.php/1450841http://www.developer.com/design/article.php/1450841• Fichman, Robert G. and Kemerer, Chris F. , Object-Oriented and Conventional Analysis

and Design Methodologies Comparison and Critique http://csdl.computer.org/dl/mags/co/1992/10/rx022.pdf

Books• Yourdon, Edward , Modern Structure Analysis, Yourdon Press, 1989

• Klerer, Melvin, Design of Very High-Level Computer Languages, Magraw Hill Inc., 1991

Questions ?Questions ?