72
02-1 © Gunnar Gotshalks Design Context and Principles

Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-1!© Gunnar Gotshalks!

Design!Context and Principles!

Page 2: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-2!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Apply recursively at all levels – from system level to subprogram.!Spiral model and evolutionary development are variations!

Page 3: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-3!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle – 2!

•  What is produced at each level?!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Page 4: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-4!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle – 3!

•  At all stages the artifacts produced are human readable documents!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Page 5: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-5!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle – 4!

•  At all stages the artifacts produced are documents!»  They may be formal

– use mathematics and programming languages!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Page 6: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-6!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle – 5!

•  At all stages the artifacts produced are documents!»  They may be formal

– use mathematics and programming languages!

»  They may be informal – use natural language!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Page 7: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-7!© Gunnar Gotshalks!

Waterfall Model – Software Life Cycle – 6!

•  At all stages the artifacts produced are documents!»  They may be formal

– use mathematics and programming languages!

»  They may be informal – use natural language!

•  At all times strive for correctness and precision!

Needs analysis – requirements!

Architectural design – framework!Detailed design – data, algorithms!

Specification – input/output!

Implementation – program text!Maintenance – corrections, evolution!

Page 8: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-8!© Gunnar Gotshalks!

What is Programming?!

Page 9: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-9!© Gunnar Gotshalks!

What is Programming? – 2!

•  Specifying what to to do and when to do it!

Page 10: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-10!© Gunnar Gotshalks!

What is Programming? – 3!

•  Specifying what to to do and when to do it!

•  The what consists of the following!

»  At the assembler level the hardwired instructions!

>  add, load, store, move, etc.!

Page 11: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-11!© Gunnar Gotshalks!

What is Programming? – 4!

•  Specifying what to to do and when to do it!

•  The what consists of the following!

»  At the assembler level the hardwired instructions!

>  Add, load, store, move, etc.!

»  At the Eiffel, C, Java level!

>  Assignment, arithmetic, read/write!

>  Routines from a Subprogram library, API (Application Program Interface)!

Page 12: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-12!© Gunnar Gotshalks!

What is Programming? – 5!

•  The when consists of specifying in what order to do the "what" operations!

Page 13: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-13!© Gunnar Gotshalks!

What is Programming? – 6!

•  The when consists of specifying in what order to do the "what" operations!

»  Control structures!

Page 14: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-14!© Gunnar Gotshalks!

What is Programming? – 7!

•  The when consists of specifying in what order to do the "what" operations!

»  Control structures!

>  What are the fundamental control structures?!

Page 15: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-15!© Gunnar Gotshalks!

What is Programming? – 8!

•  The when consists of specifying in what order to do the "what" operations!

»  Control structures – these are the only ones!

>  Sequence!

>  Choice!

>  Loop!

Page 16: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-16!© Gunnar Gotshalks!

What is Programming? – 9!

•  The when consists of specifying in what order to do the "what" operations!

»  Control structures – these are the only ones!

>  Sequence!

>  Choice!

>  Loop!

•  What and when are intertwined!

»  Changing one generally requires changing the other!

Page 17: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-17!© Gunnar Gotshalks!

What is Design?!

Page 18: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-18!© Gunnar Gotshalks!

What is Design? – 2!

•  The creation of a plan.!

Page 19: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-19!© Gunnar Gotshalks!

What is Design? – 3!

•  The creation of a plan.!

»  Consider design as imposing constraints on the "when" and "what" of programming.!

Page 20: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-20!© Gunnar Gotshalks!

What is Design? – 4!

•  The creation of a plan.!

»  Consider design as imposing constraints on the "when" and "what" of programming.!

»  From this perspective, the entire life cycle is comprised of design at various levels . !

Page 21: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-21!© Gunnar Gotshalks!

What is Design? – 5!

•  The creation of a plan.!

»  Consider design as imposing constraints on the "when" and "what" of programming.!

»  From this perspective, the entire life cycle is comprised of design at various levels . !

>  Design occurs at all the levels of the Waterfall Model from requirements to implementation!

Page 22: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-22!© Gunnar Gotshalks!

What is Design? – 6!

•  Design comes from the root to designate, to name!

Page 23: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-23!© Gunnar Gotshalks!

What is Design? – 7!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

Page 24: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-24!© Gunnar Gotshalks!

What is Design? – 8!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

»  The difficult part is finding the "right" objects and the "right" relationships!

Page 25: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-25!© Gunnar Gotshalks!

What is Design? – 9!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

»  The difficult part is finding the "right" objects and the "right" relationships!

»  There must be a correspondence between specification and implementation!

Page 26: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-26!© Gunnar Gotshalks!

What is Design? – 10!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

»  The difficult part is finding the "right" objects and the "right" relationships!

»  There must be a correspondence between specification and implementation!

>  The objects and relationships in the specification must correspond to the objects and relationships in the implementation!

Page 27: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-27!© Gunnar Gotshalks!

What is Design? – 11!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

»  The difficult part is finding the "right" objects and the "right" relationships!

»  There must be a correspondence between specification and implementation!

>  The objects and relationships in the specification must correspond to the objects and relationships in the implementation!

>  The Direct Mapping Rule (slides on Modularity)!

Page 28: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-28!© Gunnar Gotshalks!

What is Design? – 12!

•  Design comes from the root to designate, to name!

»  In design one names objects and their relationships!

»  The difficult part is finding the "right" objects and the "right" relationships!

»  There must be a correspondence between specification and implementation!

>  The objects and relationships in the specification must correspond to the objects and relationships in the implementation!

>  The Direct Mapping Rule (slides on Modularity)!>  Purpose of documentation is to show that

correspondence!

Page 29: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-29!© Gunnar Gotshalks!

Design within the Lifecycle!

•  Consider the constraints imposed in the software lifecycle!

Page 30: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-30!© Gunnar Gotshalks!

Design within the Lifecycle – 2!

•  Consider the constraints imposed in the software lifecycle!

»  Putting together a requirements document constrains what can be done from all possible programs to the set of programs corresponding to the requirements!

Page 31: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-31!© Gunnar Gotshalks!

Design within the Lifecycle – 3!

•  Consider the constraints imposed in the software lifecycle!

»  Putting together a requirements document constrains what can be done from all possible programs to the set of programs corresponding to the requirements!

»  The specification formalizes the requirements and in the process adds more constraints.!

Page 32: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-32!© Gunnar Gotshalks!

Design within the Lifecycle – 4!

•  Consider the constraints imposed in the software lifecycle!

»  Putting together a requirements document constrains what can be done from all possible programs to the set of programs corresponding to the requirements!

»  The specification formalizes the requirements and in the process adds more constraints.!

>  The set of possible programs is smaller!

Page 33: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-33!© Gunnar Gotshalks!

Design within the Lifecycle – 5!

•  Consider the constraints imposed in the software lifecycle!

»  Putting together a requirements document constrains what can be done from all possible programs to the set of programs corresponding to the requirements!

»  The specification formalizes the requirements and in the process adds more constraints.!

»  Architectural design adds constraints, and so on.!

Page 34: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-34!© Gunnar Gotshalks!

Design within the Lifecycle – 6!

•  Consider the constraints imposed in the software lifecycle!

»  Putting together a requirements document constrains what can be done from all possible programs to the set of programs corresponding to the requirements!

»  The specification formalizes the requirements and in the process adds more constraints.!

»  Architectural design adds constraints, and so on.!

»  Even implementation (programming) adds constraints by specifying in detail every when and what and so is a part of the design process.!

Page 35: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-35!© Gunnar Gotshalks!

Design within the Lifecycle – 7!

•  At each stage, there are fewer choices for the what and when in the final program text!

Page 36: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-36!© Gunnar Gotshalks!

Design within the Lifecycle – 8!

•  At each stage, there are fewer choices for the what and when in the final program text!

•  At each stage the choices must be made within the constraints imposed by the earlier choice!

Page 37: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-37!© Gunnar Gotshalks!

Design within the Lifecycle – 9!

•  At each stage, there are fewer choices for the what and when in the final program text!

•  At each stage the choices must be made within the constraints imposed by the earlier choices!

»  Or else, backtracking to earlier stages is required!

Page 38: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-38!© Gunnar Gotshalks!

Design within the Lifecycle – 10!

•  At each stage, there are fewer choices for the what and when in the final program text!

•  At each stage the choices must be made within the constraints imposed by the earlier choices!

»  Or else, backtracking to earlier stages is required!

•  At the end of the implementation stage!

»  All constraints have been specified, no choices remain, there is the complete program text defining a single executable system!

Page 39: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-39!© Gunnar Gotshalks!

Class–ADT Consistency Property!

cf ; a!

Abstract_object_1 Abstract_object_2

Concrete_object_1 Concrete_object_2

a a

af

cf

a ; af ≡

Remember this?

Apply to design documentation

Page 40: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-40!© Gunnar Gotshalks!

Level j –Level k Consistency Property!

cf ; a!

Level_j_object_1 Level_j_object_2

Level_k_object_1 Level_k_object_2

a a

af

cf

a ; af ≡

Levels refer to waterfall levels with j < k

Page 41: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-41!© Gunnar Gotshalks!

Impl–Spec Consistency Property!

cf ; a!

Spec_object_1 Spec_object_2

Impl_object_1 Impl_object_2

a a

af

cf

a ; af ≡Document the boxes at the appropriate level Document correspondence between specification and program text

The blue arrows Do for every pair of levels

Page 42: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-42!© Gunnar Gotshalks!

Seamlessness!

Since design pervades the entire software lifecycle it is important that supporting methods should apply to the entire lifecycle in a way that minimizes the gaps between successive activities!

Page 43: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-43!© Gunnar Gotshalks!

Seamlessness – 2!

Since design pervades the entire software lifecycle it is important that supporting methods should apply to the entire lifecycle in a way that minimizes the gaps between successive activities!

Corollary: Should be easy to move information among different notations formal – program text and mathematics <––> informal – documentation text <––> informal – diagrams!

Page 44: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-44!© Gunnar Gotshalks!

Principles of Public Design!

Page 45: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-45!© Gunnar Gotshalks!

Principles of Public Design – 1!

•  Principle of Use!

»  Programs will be used by people !

Page 46: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-46!© Gunnar Gotshalks!

Principles of Public Design – 2!

•  Principle of Use!

»  Programs will be used by people !

•  Principle of Misuse!

»  Programs will be misused by people !

Page 47: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-47!© Gunnar Gotshalks!

Principles of Public Design – 3!

•  Principle of Use!

»  Programs will be used by people !

•  Principle of Misuse!

»  Programs will be misused by people !

•  Principle of evolution!

»  Programs will be changed by people !

Page 48: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-48!© Gunnar Gotshalks!

Principles of Public Design – 4!

•  Principle of Use!

»  Programs will be used by people !

•  Principle of Misuse!

»  Programs will be misused by people !

•  Principle of evolution!

»  Programs will be changed by people !

•  Principle of migration!

»  Programs will be moved to new environments by people!

Page 49: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-49!© Gunnar Gotshalks!

DSQ* – Readable & Understandable!

•  All Design artifacts – program text included – are primarily to be read and used by people.!

!

*DSQ Design for Software Quality

Page 50: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-50!© Gunnar Gotshalks!

DSQ* – Readable & Understandable – 2!

•  All Design artifacts – program text included – are primarily to be read and used by people.!

•  Execution is incidental!

Page 51: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-51!© Gunnar Gotshalks!

DSQ* – Readable & Understandable!

•  All Design artifacts – program text included – are primarily to be read and used by people.!

•  Execution is incidental!

Primary purpose of design is to communicate with other people – even you are somebody else in the future, so you must communicate with yourself

Page 52: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-52!© Gunnar Gotshalks!

DSQ – Works !

•  Complete – Correct – Usable!

•  Efficient as it needs to be!»  Speed up where necessary after instrumentation!

Page 53: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-53!© Gunnar Gotshalks!

DSQ – Adaptable !

•  All programs evolve over time!

•  Make plausible modifications easy!

»  A sign of a good design is it is easy to modify and adapt to changing circumstances!

»  Could be used in unexpected ways!

Page 54: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-54!© Gunnar Gotshalks!

DSQ – On Time & Budget!

•  Time is money!

»  Pay back on investment!

•  Imbedded systems!

»  Programs are only a part of the system!

»  All systems are part of a larger system!

Page 55: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-55!© Gunnar Gotshalks!

•  The ability of a system to perform according to specification!

»  First write correct programs!

>  Then worry about efficiency!!!!

»  A fast program that is wrong!

>  Is worse than useless!

DSQ – Correctness!

Page 56: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-56!© Gunnar Gotshalks!

•  Use an appropriate amount of resources for the task!

»  Space for storing data and temporary results!

»  Execution time!

»  Space – time tradeoff!

»  Communications bandwidth!

DSQ – Efficiency!

Page 57: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-57!© Gunnar Gotshalks!

DSQ – Robustness & Ease of Use!

•  Robustness!

»  The ability of a software system to react in a reasonable manner to cases not covered by the specification!

>  Works correctly for defined inputs!

>  Recover gracefully from unexpected inputs!

>  Recover gracefully from hardware and algorithm errors !

•  Ease of use!

»  Including installation!

!

Page 58: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-58!© Gunnar Gotshalks!

DSQ – Reuse!

•  Use variations in different software products!»  Same as ... except …!

>  I.e. make changes, then use!

•  The ability of a software system to react in a reasonable manner when reused !

!!

Page 59: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-59!© Gunnar Gotshalks!

DSQ – Reuse – 2!

•  NOT just using!»  A pot is not reused when boiling water!

>  It is meant to boil water on many different occasions !

•  Reuse !»  Pot is used to bail a boat!

>  Maybe by bending it to fit the shape of the hull!

Page 60: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-60!© Gunnar Gotshalks!

Design Principle (DP) – Abstraction!

•  Extract fundamental parts!

»  Describe what is wanted!

•  Ignore the inessential!

»  Do not describe what is not wanted!

Page 61: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-61!© Gunnar Gotshalks!

Design Principle (DP) – Encapsulation!

•  Information Hiding!

»  Expose only what the user needs to know!

>  The interface !

»  Hide implementation details!

Page 62: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-62!© Gunnar Gotshalks!

DP – Modularity!

•  Handle complexity!»  Use divide and conquer!

•  Minimize interaction between parts!

Page 63: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-63!© Gunnar Gotshalks!

OO Design Techniques (OODT)!

•  Basis consists of!

»  Classes!

>  Define abstract data types !

»  Objects!

>  Are instances of those types!

Page 64: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-64!© Gunnar Gotshalks!

OODT Interfaces & Strong Typing!

•  Interface!

»  Gives the user what they need to know to use objects from a given class!

>  API – Application Program Interface !

•  Strong typing!

»  Enforces objects are used correctly by type!

>  Do not take square root of a colour!

Page 65: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-65!© Gunnar Gotshalks!

OODT Inheritance and Polymorphism!

•  Inheritance!»  Single and multiple!

>  Provides for reuse !

•  Polymorphism!»  Invoke the proper method for an object depending upon

its type!

Page 66: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-66!© Gunnar Gotshalks!

OODT Assertions!

•  Equip a class and its features with!

»  Pre and post conditions!

»  Class invariants!

»  Loop invariants !

•  Use tools to produce documentation from these assertions!

•  Monitor assertions at run time!

Page 67: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-67!© Gunnar Gotshalks!

OODT Information Hiding!

•  Specify what features are available!

»  To all clients!

»  Some clients!

»  No clients!

Page 68: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-68!© Gunnar Gotshalks!

OODT Exception Handling!

•  Support robustness with a mechanism too recover from abnormal situations!

Page 69: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-69!© Gunnar Gotshalks!

OODT Genericity!

•  Genericity!

» Write classes with formal generic parameters representing arbitrary types !

•  Constrained genericity!

»  Arises from genericity and inheritance to constrain formal generic parameters to a specific type!

Page 70: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-70!© Gunnar Gotshalks!

OODT Feature Redefinition!

•  Reuse requires the ability to modify an object for a new environment so features can be redefined !

•  Some design decisions must be deferred so provide a means to specify the interface of a feature without defining how it does it. !

Page 71: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-71!© Gunnar Gotshalks!

Structural Design Aspects!

•  Tokenization!»  What kinds of symbols are in the input and output!

•  Data structures!»  How and what data structures should be selected!

•  Program structures!»  How should a program be structured!

!

Page 72: Design Context and Principles - York University · 2014-09-17 · Design! Context and Principles! ... Software Life Cycle! Needs analysis – requirements! Architectural design –

02-72!© Gunnar Gotshalks!

Structural Design Aspects – 2!

•  Procedure partitioning!»  How should one decide when a set of operations be made into

a procedure!

•  Class partitioning!»  How to decide what goes into a class or module!

•  Correspondence!»  When do structures correspond!

»  When to use communicating sequential processes!