1 / 26

Lecture 8

Lecture 8. Component-Level Design. Component-Level Design. the closest design activity to coding the approach: review the design description for the component use stepwise refinement to develop algorithm use structured programming to implement procedural logic

maddy
Download Presentation

Lecture 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 8 Component-Level Design

  2. Component-Level Design • the closest design activity to coding • the approach: • review the design description for the component • use stepwise refinement to develop algorithm • use structured programming to implement procedural logic • use ‘formal methods’ to prove logic

  3. Stepwise Refinement open walk to door; reach for knob; open door; repeat until door opens turn knob clockwise; walk through; if knob doesn't turn, then close door. take key out; find correct key; insert in lock; endif pull/push door move out of way; end repeat

  4. The Component-Level Design Model • represents the algorithm at a level of detail that can be reviewed for quality • options: • graphical (e.g. flowchart, box diagram) • pseudocode (e.g., PDL) • programming language • decision table • conduct walkthrough to assess quality

  5. Structured Programming uses a limited set of logical constructs: sequence conditional — if-then-else, select-case loops — do-while, repeat until leads to more readable, testable code important for achieving high quality, but not enough

  6. A Structured Procedural Design add a condition Z, if true, exit the program a x 1 b c x 2 d x 3 f e x 4 g x 5

  7. if condition x then process a; else process b; endif if-then-else PDL easy to combine with source code machine readable, no need for graphics input graphics can be generated from PDL enables declaration of data as well as procedure easier to maintain Program Design Language

  8. Why Design Language?

  9. Object-Oriented Design

  10. OOA and OOD

  11. OOA and OOD

  12. OOD • Representation of hierarchy of modules • Specification of data definitions • Specification of procedure logic • Indication of end-to-end processing sequences • Representation of object states and transitions • Definition of classes and hierarchies • Assignment of operations to classes • Detailed definition of operations • Specification of message connections • Identification of exclusive services

  13. Design Issues • decomposability—the facility with which a design method helps the designer to decompose a large problem into sub-problems that are easier to solve; • composability—the degree to which a design method ensures that program components (modules), once designed and built, can be reused to create other systems; • understandability—the ease with which a program component can be understood without reference to other information or other modules; • continuity—the ability to make small changes in a program and have these changes manifest themselves with corresponding changes in just one or a very few modules; • protection—a architectural characteristic that will reduce the propagation of side affects if an error does occur in a given module.

  14. Generic Components for OOD • Problem domain component—the subsystems that are responsible for implementing customer requirements directly; • Human interaction component —the subsystems that implement the user interface (this included reusable GUI subsystems); • Task Management Component—the subsystems that are responsible for controlling and coordinating concurrent tasks that may be packaged within a subsystem or among different subsystems; • Data management component—the subsystem that is responsible for the storage and retrieval of objects.

  15. Object-oriented analysis System design task management design object design data management design human interface design Process Flow for OOD

  16. System Design Process • Partition the analysis model into subsystems. • Identify concurrency that is dictated by the problem. • Allocate subsystems to processors and tasks. • Develop a design for the user interface. • Choose a basic strategy for implementing data management. • Identify global resources and the control mechanisms required to access them. • Design an appropriate control mechanism for the system, including task management. • Consider how boundary conditions should be handled. • Review and consider trade-offs.

  17. request client server subsystem subsystem contract request peer peer subsystem subsystem request contract contract System Design

  18. Control Sensor request for status panel subsystem assign to zone subsystem test status request for alarm notification request for system status periodic check-in specification of type of alarm require for configuration update periodic status check Central communication subsystem Subsystem Example

  19. Subsystem Design Criteria • The subsystem should have a well-defined interface through which all communication with the rest of the system occurs. • With the exception of a small number of “communication classes,” the classes within a subsystem should collaborate only with other classes within the subsystem. • The number of subsystems should be kept small. • A subsystem can be partitioned internally to help reduce complexity.

  20. Subsystem Collaboration Table Contract Type Collaborators Class(es) operation(s) Message Format

  21. Object Design • A protocol description establishes the interface of an object by defining each message that the object can receive and the related operation that the object performs • An implementation description shows implementation details for each operation implied by a message that is passed to an object. • information about the object's private part • internal details about the data structures that describe the object’s attributes • procedural details that describe operations

  22. Design Patterns ... you’ll find recurring patterns of classes and communicating objects in many object-oriented systems. These patterns solve specific design problems and make object-oriented design more flexible, elegant, and ultimately reusable. They help designers reuse successful designs by basing new designs on prior experience. A designer who is familiar with such patterns can apply them immediately to design problems without having to rediscover them. Gamma and his colleagues [GAM95]

  23. Design Pattern Attributes • The design pattern name is an abstraction that conveys significant meaning about it applicability and intent. • The problem description indicates the environment and conditions that must exist to make the design pattern applicable. • The pattern characteristics indicate the attributes of the design that may be adjusted to enable the pattern to accommodate into a variety of problems. • The consequences associated with the use of a design pattern provide an indication of the ramifications of design decisions.

  24. OOD Documentation OOA Use case / use case diagram Object diagram (ERD) Class diagram CRC Collaboration diagram State diagram or Event trace Event flow OOD Use case / use case diagram Object diagram (ERD) Class diagram (including packages) CRC GUI design Collaboration diagram Sequence diagram State diagram Activity diagram

  25. Interaction Diagrams are used to describe how operations and behaviors are handled by the objects in the design. • There are two types of interaction diagrams: sequence and collaboration diagram • Sequence diagram shows the sequence in which activities or behaviors occur (represented by a time line) • Collaboration diagram shows how the objects are connected statically. Sequence of actions are numbered

  26. A state diagram shows the possible states an object can take, the events that trigger the transition from one state to the next, and the actions that result from each state change • An activity diagram models the flow of procedures or activities in a class

More Related