Object-Oriented Design Choices
Autor Adair Dingleen Limba Engleză Paperback – 19 ian 2021
A given problem may have many solutions. A developer may employ different design techniques – composition, inheritance, dependency injection, delegation, etc. – to solve a particular problem. A skilled developer can determine the costs and benefits of different design responses, even amid competing concerns. A responsible developer documents design choices as a contract with the client, delineating external and internal responsibilities. To promote effective software design, this book examines contractual, object-oriented designs for immediate and sustained use as well as code reuse. The intent of identifying design variants is to recognize and manage conflicting goals such as short versus long-term utility, stability versus flexibility, and storage versus computation. Many examples are given to evaluate and contrast different solutions and to compare C# and C++ effects. No one has a crystal ball; however, deliberate design promotes software longevity. With the prominence of legacy OO code, a clear understanding of different object-oriented designs is essential.
Design questions abound. Is code reuse better with inheritance or composition? Should composition rely on complete encapsulation? Design choices impact flexibility, efficiency, stability, longevity, and reuse, yet compilers do not enforce design and syntax does not necessarily illustrate design. Through deliberate design, or redesign when refactoring, developers construct sustainable, efficient code.
Toate formatele și edițiile | Preț | Express |
---|---|---|
Paperback (1) | 439.75 lei 6-8 săpt. | |
CRC Press – 19 ian 2021 | 439.75 lei 6-8 săpt. | |
Hardback (1) | 1095.77 lei 6-8 săpt. | |
CRC Press – 19 ian 2021 | 1095.77 lei 6-8 săpt. |
Preț: 439.75 lei
Preț vechi: 549.69 lei
-20% Nou
Puncte Express: 660
Preț estimativ în valută:
84.16€ • 87.42$ • 69.91£
84.16€ • 87.42$ • 69.91£
Carte tipărită la comandă
Livrare economică 01-15 februarie 25
Preluare comenzi: 021 569.72.76
Specificații
ISBN-13: 9780367820183
ISBN-10: 0367820188
Pagini: 348
Ilustrații: 21 Tables, black and white; 14 Illustrations, black and white
Dimensiuni: 156 x 234 x 23 mm
Greutate: 0.49 kg
Ediția:1
Editura: CRC Press
Colecția Chapman and Hall/CRC
ISBN-10: 0367820188
Pagini: 348
Ilustrații: 21 Tables, black and white; 14 Illustrations, black and white
Dimensiuni: 156 x 234 x 23 mm
Greutate: 0.49 kg
Ediția:1
Editura: CRC Press
Colecția Chapman and Hall/CRC
Public țintă
Academic and Professional Practice & DevelopmentCuprins
Preface
Detailed Book Outline
Section I: Stable Type Desig
Contractual Design and the Class Construct
Encapsulation
Explicit Design and Constraints
OO Design Principle
Summary
Design Exercises
Ownership – Abstracted but Tracked
The Abstraction of Memory
Heap Memory
Ownership of Heap Objects
Memory Reclamation
OO Design Principle
Summary
Design Exercise
Data Integrity
Data Corruption
Copying
Handle: C++ Smart Pointers
unique_ptr
shared_ptr
weak_ptr
usage
OO Design Principle
Summary
Design Exercises
Section II: Strategic Type Coupling
Composition
Replacement
Postponed instantiation
Echoing an Interface
Dependency Injection
Summary
Design Exercises
Inheritance
Generics
Subtype polymorphism
Function inlining
Costs and Benefits of Polymorphism
Dynamic Binding
Virtual Function table
Abstract Classes
Inheritance designs
OO Design Principle
Summary
Design Exercises
Inheritance vs Composition
When Inheritance Leaks Memory: C++ destructors
Inconsistent Access:
Inheritance with and without Composition
5Software Maintainability
OO Design Principle
Summary
Design Exercises
Section III: Effective Type Reuse
Design Longevity
Type Extraction
Problematic Type Extension
Multiple Inheritance and its Simulation
OO Design Principle
Summary
Design Exercises
Operator Overloading
Operators represent functions
Overloading Addition in C++
Client Expectations
Operator Overloading in C#
Operators Overloaded only in C++
Summary
Design Exercise
Appendix A: The Pointer Construct
Pointer definition
Dereferencing pointers
Inappropriate use of pointers
Transient versus persistent memory
References
The this pointer
Arrays
Summary
Appendix B: Design Examples
Contractual Design
Ownership: C++ class memory management
Copying
Composition
Inheritance
Appendix C: Comparative Design Examples
Composition versus Inheritance
Design longevity
Operator overloading
Glossary
References
Detailed Book Outline
Section I: Stable Type Desig
Contractual Design and the Class Construct
Encapsulation
Explicit Design and Constraints
Class (Type) Functionality
Constructors
Accessors and Mutators
Utility and Public Methods
DestructorsDesign as a Contract
Error Handling
Published Assumptions
InvariantsContractual Expectations
Programming by Contract Example
OO Design Principle
Summary
Design Exercises
Ownership – Abstracted but Tracked
The Abstraction of Memory
Heap Memory
Ownership of Heap Objects
Array Allocation
Design Intervention
Persistent DataClass Design
Memory Reclamation
C++ Explicit Deallocation
Garbage Collection
Reference CountingDesign: Storage vs Computation
OO Design Principle
Summary
Design Exercise
Data Integrity
Data Corruption
Copying
Shallow versus Deep Copying
C++ Copying of Internal Heap MemoryUnseen Aliasing
C# Cloning to Avoid AliasingMove semantics
Handle: C++ Smart Pointers
unique_ptr
shared_ptr
weak_ptr
usage
OO Design Principle
Summary
Design Exercises
Section II: Strategic Type Coupling
Composition
Object-oriented Relationships
Containment (Holds-A)
Composition (Has-A)Modification
Replacement
Postponed instantiation
Echoing an Interface
Interfaces for Design ConsistencyWrappers and Delegates
Dependency Injection
Constructor Injection
Property (Setter) Injection
Method Injection
Dependency Injection Costs and BenefitsOO Design Principle
Summary
Design Exercises
Inheritance
Automate Type Checking
PolymorphismOverloading
Generics
Subtype polymorphism
Function inlining
Costs and Benefits of Polymorphism
Dynamic Binding
whoami() type identification
Keywords for dynamic bindingHeterogeneous Collections
Virtual Function table
Abstract Classes
Inheritance designs
OO Design Principle
Summary
Design Exercises
Inheritance vs Composition
Constrained InheritanceWhen Only Composition is Viable
When Inheritance Leaks Memory: C++ destructors
Inconsistent Access:
C++ accessibility and binding
Code ReuseClass Design: Has-a or Is-a?
Inheritance with and without Composition
5Software Maintainability
OO Design Principle
Summary
Design Exercises
Section III: Effective Type Reuse
Design Longevity
Software Evolution
Disassembler ExampleVirtual Function Table
Type Extraction
Problematic Type Extension
Multiple Inheritance and its Simulation
Design difficulties
Single inheritance with composition
Simulation without inheritanceClass Hierarchies Cross-Products
OO Design Principle
Summary
Design Exercises
Operator Overloading
Operators represent functions
Overloading Addition in C++
Client Expectations
Operator Overloading in C#
Operators Overloaded only in C++
Indexing support
I/O via the stream operators
Type conversion
Transparent accessOO Design Principle
Summary
Design Exercise
Appendix A: The Pointer Construct
Pointer definition
Dereferencing pointers
Inappropriate use of pointers
Transient versus persistent memory
References
The this pointer
Arrays
Summary
Appendix B: Design Examples
Contractual Design
Ownership: C++ class memory management
Copying
Composition
Inheritance
Appendix C: Comparative Design Examples
Composition versus Inheritance
Design longevity
Operator overloading
Glossary
References
Notă biografică
Adair Dingle, PhD, is a professor of computer science at Seattle University, Washington, USA whose previous text, Software Essentials: Design and Construction, received the 2015 Alpha Sigma Nu Book Award. Teaching and research interests focus on algorithms and software design including efficient memory management, patterns, refactoring and tools for software development and education.
Recenzii
"The introduction of object-oriented programming was a pivotal moment in software engineering, leading to a new way of creating systems by modelling their constituents independently and linking them through shared interfaces. Object orientation allows for the creation of more complex systems, better focus on a small subset of components at any given time, and a greater level of component independence; it even facilitates the creation of software product lines. Designing a system using object orientation requires the mastery of several interdependent concepts, such as abstraction, inheritance, composition, and polymorphism. Dingle (Seattle Univ.) provides a cohesive framework for learning object-oriented design from a practical point of view. Concepts are introduced hierarchically, starting from the idea of encapsulation and design as a contract and drilling down to specifics such as virtual function tables and abstract classes. This approach results in an incremental experience of learning object-oriented design that is rarely found in computer science courses, but that is essential for software engineers who wish to harness the power of object-oriented programming languages in practice. Although no book can fully replace hands-on bench experience, this compact guide can ensure that one's practical efforts will be optimally targeted.
--L. Benedicenti, University of New Brunswick
Review in April 2022 Issue of CHOICE
--L. Benedicenti, University of New Brunswick
Review in April 2022 Issue of CHOICE
Descriere
This book compares designs variant and emphasizes the strategic use of types in object-oriented design (OOD). In addition to thorough content coverage, many design problems are presented with sample solutions discussed in appendices. The book is partitioned into three sections that cover type design, coupling and reuse.