[{"data":1,"prerenderedAt":495},["ShallowReactive",2],{"note:cs\u002Fse\u002Fnotesbychap\u002Fchap7":3,"site-search-catalogue":494},{"id":4,"title":5,"body":6,"description":462,"extension":487,"meta":488,"navigation":489,"path":490,"seo":491,"stem":492,"__hash__":493},"notes\u002Fsource\u002Fcs\u002Fse\u002Fnotesbychap\u002Fchap7.md","Chapter 7: Design and Implementation",{"type":7,"value":8,"toc":461},"minimark",[9,13,16,20,37,39,44,55,58,60,64,76,79,84,123,127,130,134,137,158,180,184,187,213,217,220,238,240,244,254,258,261,287,291,330,332,336,339,343,346,372,376,379,393,397,400,414,416,420,423,427,430,434,437],[10,11,5],"h1",{"id":12},"chapter-7-design-and-implementation",[14,15],"hr",{},[10,17,19],{"id":18},"executive-summary","Executive Summary",[21,22,23,24,28,29,32,33,36],"p",{},"Chapter 7 bridges the gap between requirements engineering and the actual coding of the software. It focuses on the transition from conceptual requirements to an executable system. The chapter emphasizes ",[25,26,27],"strong",{},"object-oriented design"," using the Unified Modeling Language (UML), the utilization of ",[25,30,31],{},"design patterns"," to solve recurring problems, and critical implementation issues that software engineers must manage, such as ",[25,34,35],{},"software reuse, configuration management, and open-source development",".",[14,38],{},[40,41,43],"h2",{"id":42},"_1-introduction-to-design-and-implementation","1. Introduction to Design and Implementation",[21,45,46,47,50,51,54],{},"Software ",[25,48,49],{},"design"," is a creative process where you identify software components and their relationships based on a customer?�s requirements. ",[25,52,53],{},"Implementation"," is the process of realizing this design as an executable program.",[21,56,57],{},"These two activities are inherently linked and invariably interleaved. In agile environments, formal design documentation might be skipped in favor of whiteboard sketches, while plan-driven approaches might mandate detailed UML modeling before any code is written. A critical early decision in this phase is the \"build vs. buy\" dilemma: evaluating whether to build the software from scratch or buy and adapt an off-the-shelf application to save time and money.",[14,59],{},[40,61,63],{"id":62},"_2-object-oriented-design-using-the-uml","2. Object-Oriented Design using the UML",[21,65,66,67,70,71,75],{},"An ",[25,68,69],{},"object-oriented (OO) system"," is composed of interacting objects that maintain their own private, local state and provide operations to manipulate that state. This concept of ",[72,73,74],"em",{},"encapsulation"," ensures that the representation of an object's state cannot be accessed directly from outside the object, meaning modifying one object does not unintentionally break others.",[21,77,78],{},"The OO design process generally involves five sequential (but often iterative) steps:",[80,81,83],"h3",{"id":82},"_21-system-context-and-interactions","2.1 System Context and Interactions",[85,86,87,94],"ul",{},[88,89,90,93],"li",{},[25,91,92],{},"The \"Why\"",": Before designing the internal architecture, you must define the system boundaries to understand what lies outside the system.",[88,95,96,99,100],{},[25,97,98],{},"The \"How\"",":\n",[85,101,102,109],{},[88,103,104,105,108],{},"A ",[25,106,107],{},"System Context Model"," is created to illustrate the external entities (other systems, users, hardware) that interact with the software.",[88,110,104,111,114,115,118,119,122],{},[25,112,113],{},"Use Case Model"," is then used to map out ",[72,116,117],{},"what"," interactions occur without detailing ",[72,120,121],{},"how"," they are processed internally.",[80,124,126],{"id":125},"_22-system-architecture","2.2 System Architecture",[21,128,129],{},"Once the context and external interactions are clear, engineers design the overarching architecture to handle these interactions. This involves identifying the major components that make up the system and organizing them using architectural patterns (like a layered or client-server model).",[80,131,133],{"id":132},"_23-object-class-identification","2.3 Object Class Identification",[21,135,136],{},"Identifying the core objects is one of the most challenging parts of OO design. Engineers use several analytical techniques to discover them:",[138,139,140,146,152],"ol",{},[88,141,142,145],{},[25,143,144],{},"Grammatical Analysis:"," Parsing natural language requirements. Nouns translate to objects or attributes, while verbs translate to operations or services.",[88,147,148,151],{},[25,149,150],{},"Tangible Entities:"," Identifying physical things (e.g., an aircraft), roles (e.g., manager), or events (e.g., a request) in the application domain.",[88,153,154,157],{},[25,155,156],{},"Scenario-Based Analysis:"," Tracing through specific use cases to see what data and actions are required to fulfill a scenario.",[159,160,161],"blockquote",{},[21,162,163,166,167,170,171,175,176,179],{},[25,164,165],{},"Mastery Application (Object Identification):"," Imagine you are designing software for a wilderness weather station. A grammatical analysis of the requirement ",[72,168,169],{},"\"The system must report weather data\""," reveals a ",[172,173,174],"code",{},"WeatherData"," object (from the noun) and a ",[172,177,178],{},"report()"," operation (from the verb).",[80,181,183],{"id":182},"_24-design-models","2.4 Design Models",[21,185,186],{},"Models act as the bridge between abstract requirements and concrete implementation. In UML, two primary categories of models are used to document a design:",[85,188,189,199],{},[88,190,191,194,195,198],{},[25,192,193],{},"Structural (Static) Models:"," Define the system's static structure. Examples include ",[25,196,197],{},"Subsystem Models"," (logical groupings of objects) and Class Diagrams showing inheritance and composition.",[88,200,201,204,205,208,209,212],{},[25,202,203],{},"Dynamic Models:"," Describe runtime interactions. ",[25,206,207],{},"Sequence Models"," chronologically map out the sequence of object interactions for a specific use case , while ",[25,210,211],{},"State Machine Models"," track how an individual object's state changes in response to specific events.",[80,214,216],{"id":215},"_25-interface-specification","2.5 Interface Specification",[21,218,219],{},"Interfaces must be unambiguously defined so that individual objects and subsystems can be developed in parallel by different programmers.",[85,221,222,232],{},[88,223,224,227,228,231],{},[25,225,226],{},"The Golden Rule:"," Interface specifications should ",[72,229,230],{},"never"," expose the internal data representation (attributes).",[88,233,234,237],{},[25,235,236],{},"The \"Why\":"," If data representation is hidden, it can be easily changed (e.g., switching from an array to a linked list) without breaking any external objects that rely on that interface. This leads to inherently more maintainable code.",[14,239],{},[40,241,243],{"id":242},"_3-design-patterns","3. Design Patterns",[21,245,104,246,249,250,253],{},[25,247,248],{},"design pattern"," is a stylized, abstract description of accumulated wisdom?�a well-tried solution to a common, recurring software design problem. Patterns facilitate high-level \"concept reuse.\" When you try to reuse exact executable code, you are constrained by the original programmer's specific algorithms; patterns allow you to reuse the ",[72,251,252],{},"idea"," but adapt the implementation to your unique system.",[80,255,257],{"id":256},"_31-elements-of-a-design-pattern","3.1 Elements of a Design Pattern",[21,259,260],{},"As defined by the \"Gang of Four\" (the pioneers of software design patterns), a pattern includes four essential elements:",[138,262,263,269,275,281],{},[88,264,265,268],{},[25,266,267],{},"Name:"," A meaningful reference to the pattern.",[88,270,271,274],{},[25,272,273],{},"Problem Description:"," Explains the motivation and situations where the pattern is applicable.",[88,276,277,280],{},[25,278,279],{},"Solution Description:"," A template (often graphical) showing the objects, their relationships, and responsibilities.",[88,282,283,286],{},[25,284,285],{},"Consequences:"," The trade-offs and results of applying the pattern.",[80,288,290],{"id":289},"_32-mastery-application-the-observer-pattern","3.2 Mastery Application: The Observer Pattern",[85,292,293,299],{},[88,294,295,298],{},[25,296,297],{},"The Problem:"," You need multiple display formats (e.g., a pie chart and a bar graph) for the exact same underlying dataset, and all of them must update instantly when the data changes.",[88,300,301,304,305,308,309,312,313,316,317,319,320,322,323,325,326,329],{},[25,302,303],{},"The Solution:"," The ",[25,306,307],{},"Observer pattern"," separates the data (the ",[172,310,311],{},"Subject",") from its displays (the ",[172,314,315],{},"Observers","). The ",[172,318,311],{}," maintains the state. When the state changes, the ",[172,321,311],{}," issues a notification to all attached ",[172,324,315],{},". The ",[172,327,328],{},"Observer"," objects then automatically pull the updated data and refresh their specific displays.",[14,331],{},[40,333,335],{"id":334},"_4-implementation-issues","4. Implementation Issues",[21,337,338],{},"Once the design is mapped out, programmers write the code. However, modern software engineering requires managing three major non-programming implementation issues:",[80,340,342],{"id":341},"_41-software-reuse","4.1 Software Reuse",[21,344,345],{},"Developing software entirely from scratch is expensive and risky. Modern software is heavily constructed by reusing existing components.",[85,347,348,354,360,366],{},[88,349,350,353],{},[25,351,352],{},"Abstraction Level:"," Reusing successful design patterns and architectural styles.",[88,355,356,359],{},[25,357,358],{},"Object Level:"," Directly reusing specific objects\u002Fmethods from existing libraries (e.g., using a JavaMail library to process emails).",[88,361,362,365],{},[25,363,364],{},"Component Level:"," Reusing entire frameworks or collections of objects (e.g., a User Interface framework that handles window displays and event handling).",[88,367,368,371],{},[25,369,370],{},"The Trade-off:"," While reuse saves time, it involves costs: the time spent searching for and evaluating the software, purchasing licenses, adapting it to your needs, and integrating conflicting components.",[80,373,375],{"id":374},"_42-configuration-management","4.2 Configuration Management",[21,377,378],{},"Because software changes continuously during development, change management is essential. If a team doesn't track versions, developers will overwrite each other's code.",[85,380,381,387],{},[88,382,383,386],{},[25,384,385],{},"Version Management:"," Tools that keep track of component versions and coordinate team development to stop code conflicts.",[88,388,389,392],{},[25,390,391],{},"System Integration:"," Tools that help developers define exactly which versions of which components are combined to create a specific system release.",[80,394,396],{"id":395},"_43-host-target-development","4.3 Host-Target Development",[21,398,399],{},"Software is rarely executed on the same machine it was coded on.",[85,401,402,408],{},[88,403,404,407],{},[25,405,406],{},"The Host:"," The development platform where the code is written (using an Integrated Development Environment or IDE).",[88,409,410,413],{},[25,411,412],{},"The Target:"," The execution platform where the software will live. Developers must consider the target's specific hardware constraints, physical size, and operating system during implementation.",[14,415],{},[40,417,419],{"id":418},"_5-open-source-development","5. Open-Source Development",[21,421,422],{},"Open-source development involves publishing the source code of a system and inviting a vast community of volunteers to participate in its development and improvement.",[80,424,426],{"id":425},"_51-business-and-practical-considerations","5.1 Business and Practical Considerations",[21,428,429],{},"Making software open-source can reassure customers; if the original company goes out of business, the users know they will still have access to the code and can maintain it themselves. However, open-sourcing a highly specialized application does not guarantee a flood of volunteer developers?�most highly successful open-source projects are broad, foundational platform products.",[80,431,433],{"id":432},"_52-open-source-licensing-models","5.2 Open-Source Licensing Models",[21,435,436],{},"While the code is freely available, the developer still legally owns the code and uses licenses to dictate exactly how it can be reused:",[138,438,439,449,455],{},[88,440,441,444,445,448],{},[25,442,443],{},"GNU General Public License (GPL):"," A \"reciprocal\" license. If you embed GPL-licensed code in your system, your entire system ",[72,446,447],{},"must"," also be made open-source.",[88,450,451,454],{},[25,452,453],{},"GNU Lesser General Public License (LGPL):"," A variant where you can link to LGPL code without open-sourcing your entire system. However, if you modify the LGPL component itself, those specific modifications must be published.",[88,456,457,460],{},[25,458,459],{},"Berkley Standard Distribution (BSD) \u002F MIT:"," Non-reciprocal licenses. You can use the code in proprietary, closed-source commercial systems that you sell, as long as you acknowledge the original creator of the code.",{"title":462,"searchDepth":463,"depth":463,"links":464},"",2,[465,466,474,478,483],{"id":42,"depth":463,"text":43},{"id":62,"depth":463,"text":63,"children":467},[468,470,471,472,473],{"id":82,"depth":469,"text":83},3,{"id":125,"depth":469,"text":126},{"id":132,"depth":469,"text":133},{"id":182,"depth":469,"text":183},{"id":215,"depth":469,"text":216},{"id":242,"depth":463,"text":243,"children":475},[476,477],{"id":256,"depth":469,"text":257},{"id":289,"depth":469,"text":290},{"id":334,"depth":463,"text":335,"children":479},[480,481,482],{"id":341,"depth":469,"text":342},{"id":374,"depth":469,"text":375},{"id":395,"depth":469,"text":396},{"id":418,"depth":463,"text":419,"children":484},[485,486],{"id":425,"depth":469,"text":426},{"id":432,"depth":469,"text":433},"md",{},true,"\u002Fsource\u002Fcs\u002Fse\u002Fnotesbychap\u002Fchap7",{"title":5,"description":462},"source\u002Fcs\u002Fse\u002Fnotesbychap\u002Fchap7","wTQNJBO2s0qK0e8ePQtsaGlou0mnbwdiYuaRxfCVcZI",null,1784032893324]