Software Design Principles and Practices PDF
Document Details
Uploaded by FluentTachisme447
2007
Ts. Dr. Noorayisahbe
Tags
Summary
This document is a lecture, covering software design principles and practices. Topics include various design aspects within software products, abstraction, modeling, and design in the software life cycle.
Full Transcript
Software Design Principles and Practices By Ts. Dr. Noorayisahbe © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2 © 2007 Pearson Education, Inc. Pu...
Software Design Principles and Practices By Ts. Dr. Noorayisahbe © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2 © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3 Objectives ▪ To explain what design is and how various types of design deal with different aspects of a product ▪ To present design as problem solving and outline the roles of abstraction and modeling in design ▪ To place design in the software life cycle ▪ To survey software engineering design methods © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4 Topics ▪ Software products and software design ▪ Abstraction and modeling ▪ Varieties of design ▪ Software design in the life cycle ▪ Software engineering design methods © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5 Importance of Software Design ▪ We live in a designed world. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6 Importance of Software Design ▪ We live in a designed world. ▪ Design is economically important and effects our quality of life. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7 Importance of Software Design Cont. ▪ Software is becoming ubiquitous. ▪ The quality of software design has important consequences that software designers should be aware of and take seriously. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 8 Software Products A software product is an entity comprised of one or more programs, data, and supporting materials and services that satisfies client needs and desires either as an independent artifact or as essential ingredient in some other artifact. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 9 Software Design Defined Software designers do what designers in other disciplines do, except they do it for software products. Software design is the activity of specifying the nature and composition of software products that satisfy client needs and desire, subject to constraints. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 10 Design as Problem Solving ▪ An especially fruitful way to think about design is as problem solving. ▪ Advantages Suggests partitioning information between problem and solution Emphasizes that there may be more than one good solution (design) Suggests techniques such as changing the problem, trial and error, brainstorming, etc. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11 Design Principles ▪ Design principles are foundational guidelines that help developers and designers create well-structured, maintainable, and efficient software systems. ▪ These principles aim to make software easy to understand, flexible, reusable, and resilient to change. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 12 Abstraction Abstraction is an important problem-solving technique, especially in software design. Abstraction is suppressing or ignoring some properties of objects, events, or situations in favor of others. Abstraction is the process of filtering out - ignoring - the characteristics of problems that are not needed in order to concentrate on those that are needed © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 13 Importance of Abstraction ▪ Problem simplification Abstracting allows us to focus on the most important aspects of a problem in (partially) solving it. is the decomposition of a system into smaller parts to comprehend its compositional sub- ▪ Structuring problem solving systems. Top-down strategy: Solve an abstract version of the problem, then add details (refinement) Bottom-up strategy: Solve parts of a problem and connect them for a complete solution is the decomposition of a system into smaller parts to comprehend its compositional sub- systems. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 14 Modeling A model represents a target by having model parts corresponding to target parts, with relationships between model parts corresponding to relationships between target parts. Target Model © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 15 Modeling in Design ▪ Modeling is used for the following purposes: Problem understanding Design creation Design investigation Documentation © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16 Modeling in Design Cont. ▪ Modeling work because models abstract details of the target. ▪ Models can fail if important and relevant details are left out. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 17 Static and Dynamic Models A static design model represents aspects of programs that do not change during program execution. A dynamic model represents what happens during program execution. ▪ Static model examples include class and object models. ▪ Dynamic model examples of include state diagrams and sequence diagrams. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 18 Example of model Sequence Diagram © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 19 Example of model Cont. State Diagram © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 20 Product vs. Engineering Design ▪ Product designers are concerned with styling and aesthetics, function and usability, manufacturability and manageability. Industrial designers, (building) architects, interior designers, graphic designers, etc. ▪ Engineering designers are concerned with technical mechanisms and workings. Structural, mechanical, chemical, and electrical engineers ▪ Design teams often include both product and engineering designers. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 21 Software Product Design Software product design is the activity of specifying software product features, capabilities, and interfaces to satisfy client needs and desires. Requires skills in user interface and interaction design, communications, industrial design, and marketing © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 22 Software Engineering Design Software engineering design is the activity of specifying programs and sub-systems, and their constituent parts and workings, to meet software product specifications. Requires skills in programming, algorithms, data structures, software design principles, practices, processes, techniques, architectures, and patterns © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 23 Waterfall Life Cycle Model Software Product Life Cycle The waterfall model Requirements Specification captures the logical, but not the temporal, Design relationships Implementation between software development Testing activities. Maintenance © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 24 Design Across the Life Cycle Software Product Life Cycle Requirements Product Design Specification Design Engineering Design Implementation Testing Product Redesign and Maintenance Engineering Redesign © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 25 “What” Versus “How” ▪ Traditional way to make the distinction between requirements and design activities ▪ Not adequate because Many “what” specifications turn out to be design decisions Many “how” specifications turn out to be client or customer needs or desires ▪ Distinguish requirements from design based on problem solving: requirements activity formulates a problem solved in design © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 26 Design Problems and Solutions Software Design Problem: Needs, Desires, Constraints Design Features and Capabilities Solution: Features Product and Capabilities Design Solution: Design Interactions Interactions Solution: SRS Create High-Level Design Solution: High- Level Design Engineering Design Create Low-Level Solution: Low- Design Level Design Solution: Design Document Write Code Solution: Code © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 27 Software Design Method A software design method/tool is an orderly procedure for generating a precise and complete software design solution that meets clients needs and constraints. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 28 Design Method Components ▪ Design Process—A collection of related tasks that transforms a set of inputs into a set of outputs ▪ Design Notations—A symbolic representational system © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 29 Design Method Components Cont. ▪ Design Heuristics—Rules providing guidance, but no guarantee, for achieving some end ▪ Design methods also use design principles stating characteristics of design that make them better or worse. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 30 Design practices ▪ Refer to established approaches, techniques, and guidelines used in software design to create efficient, maintainable, and scalable systems. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 31 Design practices ▪ Principles: ▪ SOLID Principles: Guidelines for writing object-oriented code that is flexible and easier to maintain. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 32 Design practices Cont. Design Patterns: Well-known solutions, like the Singleton, Factory, and Observer patterns, that solve specific software design problems. Architectural Patterns: High-level patterns, like MVC (Model-View-Controller) and Microservices, for structuring entire applications. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 33 Design practices Cont. Processes and Techniques: ▪ Abstraction: Simplifying complex systems by focusing on essential details and hiding the rest. ▪ Decomposition: Breaking down a system into smaller, manageable parts (e.g., modules, classes, services). © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 34 Design practices Cont. Processes and Techniques: ▪ Encapsulation: Keeping data and behavior within an object to protect the integrity of the data. ▪ Documentation and Modeling: Creating diagrams, flowcharts, and other visual representations to plan and communicate design decisions. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 35 Why Design Practices Matter: ▪ These practices help ensure that software is built with a clear structure, is easy to test and maintain, and can adapt to changes over time. ▪ By following established design practices, developers can produce higher-quality software © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 36 Why Design Principles Matter: ▪ Design principles help developers write code that is cleaner, more reliable, and easier to work with. ▪ By following these principles, software can be developed with fewer errors, be more flexible to changing requirements, and be more accessible for future developers who need to maintain or extend it. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 37 Design Method Timeline 1971 Niklaus Wirth introduces stepwise refinement. 1974 Stevens, Myers, Constantine introduce structured design. Late 1970s to early 1980s Structured analysis and design methods are dominant. Late 1980s Object-oriented analysis and design methods rise to prominence. 1995 UML 0.8 is released. 2004 UML 2.0 is released… © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 38 Summary ▪ Software design is important. ▪ Software design is best thought of as problem solving. ▪ Abstraction is a fundamental design technique. ▪ Modeling (which relies on abstraction) is a basic design tool. ▪ Software design comprises both product and engineering design. ▪ Product design occurs mainly in the requirements specification phase; engineering design mainly in the design and implementation phases. ▪ OO analysis and design methods are now dominant. © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 39 ▪ Thank you © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 40