What you will learn in Software Design for Python Programmers
Principles and patterns
Chapter by chapter
Concepts explained in this book
- recursionRecursion is a problem-solving technique that repeatedly applies the same procedure to progressively smaller instances of a problem until a terminating condition is reached.
- lockingMutual exclusion is a synchronization constraint that permits only one thread or execution path at a time to access a protected resource or critical operation.
- critical regionA critical region is a section of concurrent program execution that accesses a shared resource and must be serialized to preserve correct behavior.
- eventAn event is an occurrence defined by an object's behavior that can cause the object to transition from one state to another.
- functional requirementA functional requirement is a requirement specifying an operation that an application must perform or enable a user to perform.
- code duplicationDuplicate code is the presence of multiple substantially similar copies of an implementation in a program.
- nonfunctional requirementA nonfunctional requirement is a requirement specifying a quality, constraint, or condition on how an application operates rather than a specific capability.
- couplingLoose coupling is a relationship between software components in which each has few dependencies on the implementation of the others.
- state design patternThe State Design Pattern is a behavioral design pattern that allows an object to alter its behavior when its internal state changes by delegating state-specific behavior to separate state representations.
- programming by contractProgramming by contract is a software development technique that specifies component obligations through preconditions, postconditions, and invariants.
- visitor design patternThe Visitor pattern is a behavioral design pattern that separates an operation from the object structure on which it operates, allowing operations to be added without changing the structure's classes.
- open-closed principleThe Open-Closed Principle states that a class should be closed to modification but open to extension.
- backtrackingBacktracking is the process of reversing or revising earlier decisions when they lead to an unsatisfactory result.
- producerA producer is a concurrent component that creates values and places them into a shared data structure.
- Law of DemeterThe Principle of Least Knowledge is a design principle that minimizes a class's knowledge of other classes' implementations and thereby reduces dependencies between classes.
- multithreadingA multithreaded program is a program whose execution can involve multiple concurrent threads of control.
- private memberA private instance variable is an object state variable whose implementation access is restricted by a class's private naming convention or interface design.
- preconditionA precondition is a state or event that must hold or have occurred before a use case can begin.
- use caseA use case is a named interaction scenario describing a capability that an external actor can perform with a system.
- requirementsA software requirement is a specified capability, constraint, or quality that a software application must satisfy.
- semaphoreA Python Semaphore object controls concurrent access by maintaining a counter of available permits.
- design patternA design pattern is an industry-proven model for creating a solution to a recurring software design problem.
- observer patternA behavioral design pattern in which dependent objects are notified when an observed object's state changes.
- code to the interface principleThe Code to the Interface Principle structures code to depend on a superclass interface so it can work with any compatible subclass at runtime.
- condition variableA condition object is a synchronization object that lets threads wait for a predicate on shared state and be notified when that predicate may have changed.
- inheritanceInheritance is an object-oriented mechanism through which a subclass derives state and behavior from a superclass.
- factoryA factory function is a function that encapsulates creating and returning objects, often selecting among subclass types based on an input value.
- overrideMethod overriding is the definition of a subclass method with the same operation interface as an inherited superclass method, causing the subclass implementation to be selected for subclass instances.
- instance variableAn instance variable is state associated with an individual object instance.
- Singleton patternThe Singleton Design Pattern is a creational design pattern that restricts a class to at most one object instance and provides access to that instance.
- postconditionA postcondition is a state or Boolean condition that must be true when a function or operation returns.
- delegation principleThe Delegation Principle assigns work to another class whose responsibility and cohesion make it more suitable for performing that work.
- enumAn enumeration type defines a fixed set of named constant values.
- property decoratorThe Python property decorator converts a method into a managed attribute interface backed by getter, setter, or deleter methods.
- date arithmeticDate arithmetic is the calculation of dates by adding or subtracting time intervals and determining differences between dates.
- composite design patternThe Composite Design Pattern is a structural design pattern that represents part-whole hierarchies as tree structures while allowing clients to treat individual objects and compositions uniformly.
- don't repeat yourself principleThe Don't Repeat Yourself Principle states that each piece of knowledge or behavior should have a single authoritative representation in code.
- strategy design patternA strategy is an encapsulated algorithm that provides interchangeable behavior for a client.
- principleA design principle is a general guideline for structuring software to improve qualities such as flexibility, correctness, and performance.
- iteratorAn iterator is an object or interface that provides sequential access to elements of a collection without exposing the collection's implementation.
- don't-care valueA don't-care attribute is a search attribute whose value is unspecified and therefore imposes no matching constraint.
- state transitionA state transition is a change from one object state to another caused by changes in one or more attributes.
- encapsulationImplementation hiding is a software design technique that exposes only a class's necessary interface while concealing its internal representation and operations.
- accessor methodA getter method is a method that reads an object's state through a public access interface without exposing its underlying representation.
- decorator design patternThe Decorator Design Pattern is a structural design pattern that dynamically attaches additional responsibilities to an object by wrapping it with objects that share its interface.
- single responsibility principleThe Single Responsibility Principle states that a class should have one primary responsibility and remain cohesive around it.
- static methodA static method is a class-associated method that receives no implicit instance or class reference and can be called through either the class or an instance.
- cohesive classA cohesive class is a class whose methods and instance variables collectively serve one closely related primary responsibility.
- reader-writer problemThe reader-writer problem is a concurrency problem involving shared access where readers may proceed concurrently but writers require exclusive modification access.
- producer-consumerThe producer-consumer model is a communication pattern in which producers generate content or data and consumers receive and process it.
- invariantThe Class Invariant Principle states that a condition governing a class's valid objects must remain true during runtime.
- template method design patternThe Template Method pattern defines an algorithm's fixed-order skeleton in a superclass while allowing subclasses to implement selected variable steps.
- type signatureA function signature is the specification consisting of a function's name and the number, datatypes, and order of its parameters.
- adapterThe Adapter pattern is a software design pattern that makes incompatible interfaces work together through an intermediary interface translation layer.
- flexibilityFlexibility is the ability of software to change its behavior or accommodate new requirements without modifying its core implementation.
- one-to-many relationshipA one-to-many dependency is a relationship in which one object has multiple dependent objects that can be notified of its changes.
- name manglingPython name mangling is the transformation of double-underscore class attribute names to include the defining class name.
- bounded queueA queue with a fixed maximum capacity that can become full when it contains that many values.
- global interpreter lockThe global interpreter lock is a runtime lock in standard Python implementations that restricts execution of Python bytecode to one thread at a time within a process.
- treeA tree is a hierarchical data structure composed of nodes connected in parent-child relationships.
- sink nodeA subscriber is a software component that receives notifications from a publisher and may request and process the publisher's new content.
- busy-waiting loopBusy waiting is repeatedly consuming execution time while waiting instead of relinquishing control to other threads.
- abstract factory design patternThe Abstract Factory Design Pattern is a creational design pattern that provides an interface for creating families of related objects without specifying their concrete classes.
- function overloadingFunction overloading is providing the same operation through multiple signatures or argument forms with behavior selected according to the call.
- performancePerformance is the measurable operational behavior of software, commonly including response time, throughput, and resource consumption.
- abstract classAn abstract superclass is a superclass intended to define shared structure or required behavior without being instantiated directly.
- Liskov Substitution PrincipleThe Liskov Substitution Principle is a design principle requiring objects of subclasses to be substitutable for objects of their superclass without invalidating program correctness.
- HAS-A relationshipAggregation is a UML whole-part relationship in which a container object refers to contained objects that can exist independently of the container.
- functional specificationA functional specification is an external document that states an application's intended capabilities, requirements, objectives, and use cases without internal implementation details.
- accept methodAn accept method is an operation on a tree element that receives a visitor and dispatches the visitor operation appropriate to that element's type.
- visitor interfaceA visitor interface is an interface declaring operations for visiting each supported element type in an object structure.
- actorAn actor is a person, system, or other entity that interacts with an application through a use case.
- quicksortQuicksort is a comparison-sorting algorithm that selects a pivot, partitions values around it, and recursively sorts the resulting sublists.
- favor composition over inheritance principleThe Favor Composition over Inheritance Principle recommends using composition instead of inheritance when composition provides a more flexible and maintainable design.
- julian day numberA Julian day number is a count of days elapsed since noon on January 1, 4713 BCE, in the Gregorian calendar, optionally including a fractional part for the time of day.
- use case documentationUse case documentation is the collection of artifacts that records use cases, including diagrams and written descriptions.
- facade patternThe Façade pattern is a reusable design model that provides a simplified interface to a complex subsystem.
- eight queens puzzleThe eight queens puzzle is a chessboard-placement problem requiring eight queens to be positioned so that no two can attack each other.
- abstract methodThe abstractmethod decorator marks a method as abstract so that concrete subclasses must implement it.
- Sudoku puzzleA Sudoku puzzle is a constraint puzzle in which digits must be placed in a grid so that each required row, column, and region satisfies distinctness rules.
- pivotA pivot element is the selected list element whose value divides the elements being processed into lower and higher partition regions.
- deadlockA deadlock is a concurrency failure in which threads remain blocked because each is waiting for a resource or synchronization action that cannot become available.
- use case diagramA use case diagram is a UML behavioral diagram that represents an application's externally visible interactions through actors and use cases.
- object familyAn object family is a set of related object types whose instances are designed to work together as a compatible product group.
- defensive programmingDefensive programming is a technique that validates inputs and guards against programming errors to preserve valid program states.
- methodA method is a function defined as part of a class that operates on or describes the behavior of its objects.
- MapA dictionary is a collection that maps unique immutable keys to values.
- context switchingContext switching is the operating-system or runtime operation of saving one thread's execution state and restoring another's so execution can alternate between them.
- alternate action sequenceAn alternate action sequence is an ordered set of interactions describing how a use case proceeds when the normal sequence cannot be followed.
- primary action sequenceA primary action sequence is the normal ordered set of interactions between an actor and an application during a use case.
- triggerA trigger is an actor-initiated event that starts a use case.
- off-by-one errorAn off-by-one error is a computational error in which a value or operation count is exactly one greater or one less than intended.
- publish/subscribe modelThe publisher-subscriber model is a communication pattern in which a publisher produces state or event information and subscribers receive notifications about it.
- hidden implementationA hidden implementation is internal class code that is inaccessible to client code and may change without affecting permitted users of the class.
- runtime checkA runtime check is a conditional inspection of values or types performed while a program is executing.
- sustainable applicationA sustainable application is software designed to remain reliable, flexible, and maintainable over a long life.
- concrete classA concrete subclass is a non-abstract subclass that implements all abstract methods inherited from its superclass.
- assertionAn assert statement evaluates a condition and aborts execution when the condition is false.
- lazy evaluationThe Lazy Evaluation Principle postpones a calculation until its result is required, particularly when the calculation is expensive or time-consuming.
- UML class diagramA UML class diagram is a standardized graphical model that represents classes, their members, and relationships such as aggregation and composition.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
