Category: OOP

Pharo by Example

Author Andrew P. Black ,Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet ,Damien Cassou, Marcus Denker
Format Online PDF
Price free

Pharo is a modern open-source development environment and language inspired from Smalltalk. Despite being the first purely object-oriented language and environment, Pharo is in many ways still far ahead of its successors in promoting a vision of an environment where everything is an object, and anything can change at run-time.

Pharo by Example, intended for both students and developers, will guide you gently through the Pharo language and environment by means of a series of examples and exercises.

This book is based on the first release of Pharo. Newer book versions have been released since then.

Continue reading

Taligent’s Guide to Designing Programs: Well-Mannered Object-Oriented Design in C++

My image
  • Author: Taligent Inc.
  • Format: online HTML
  • Price: free

A quick overview of Object-oriented program design, with special regard for operating-system development, this book will be of the greatest interest to those developers who are working with Taligent and its operating partners, as well as many other C++ programmers who are interested in a provocative summary of good OOP techniques.

Chapters include:

  • Architectural goals
  • Object-oriented architecture
  • All interfaces are expressed through objects
  • Commonality is managed through inheritance
  • Objects are leveraged wherever possible
  • Frameworks provide the foundation
  • Let resources find you
  • Putting it all together
  • Reflect the client’s view
  • Let resources find you
  • Express all interfaces through objects
  • Preserve class invariants
  • Object-oriented design with C++
  • C++ doesn’t express full object interface
  • C++ requires definition of special member functions
  • Use type inheritance to share protocol
  • Useimplementation inheritance to override behavior
  • Design the interfaces between the base and derived classes
  • Guarantee use of derived classes as arguments
  • Implement full protocol in derived classes
  • Preserve semantics in a derived class
  • Avoid deep nesting in lightweight objects
  • Be aware of problems with virtual bases
  • Avoid multiple occurrences of a base
  • Design performance in
  • Conduct performance analysis
  • Perform controlled experiments
  • Use static objects instead of temporaries
  • Use chunky iteration for performance
  • Use cache objects
  • Object bloat
  • Lost object focus
  • Hardening of the architecture
  • Structification
  • Modulitis
  • Managers are not objects
  • Collections of functions are not objects
  • Encapsulation leakage
  • Empty base classes
  • Overeducated base classes
  • Overachieving base classes
  • Distinguish is-a from has-a relationships
  • Include copyright notices
  • Use comments
  • Include function prototypes
  • Do not use code names in filenames
  • Enclose definitions in header files
  • Include only related classes in one file
  • Use specific names
  • But use generic names for abstract base classes
  • Avoid abbreviations
  • Use special names for copy, create, and adopt routines
  • Use global names only for classes
  • Follow member function conventions
  • State explicit use of public, private, and protected
  • Use separate class definition sections
  • Avoid raw C types with dimensions
  • Use dimensionless raw C types
  • Avoid type casting
  • Silent coercion
  • Cast operators
  • Use consistent return types for assignment operators
  • State typedef class names before specifications
  • Pass variables when possible
  • Use array arguments instead of pointers
  • Limit default arguments
  • Avoid functions with unspecified arguments (…)
  • Avoid returning pointers without allocation
  • Use pointers to make multiple references
  • Use references for a one-time reference
  • Allocate storage only if you must
  • Pretend everything is a primitive
  • Use const instead of #define constants
  • Use enum instead of sets of constants
  • Use inlines instead of function macros
  • Use templates for specialized functions and classes
  • Don’t use goto
  • Avoid magic numbers
  • Avoid bit flags (& and |)
  • Avoid using arrays as local variables or object fields
  • Avoid homegrown utility classes
  • Use the Name Server
  • Hide allocation inside a class
  • Don’t assume use of a heap
  • Clarify ownership of storage in interfaces
  • Don’t use very large local variables or members
  • Avoid static objects
  • Modifiable statics in a library
  • Consider alternatives to temporary objects
  • Binary compatibility considerations
  • Adding virtual and nonvirtual functions
  • Changing a function from inline to noninline
  • Removing private nonvirtual functions not called by inlines
  • Using classes internal to your implementation
  • Use virtual functions if overrides are possible
  • Rearranging, adding, and removing private data members with restrictions
  • Inlines that call something else
  • Inline function definitions in .C files
  • Inlines for extreme efficiency
  • Don’t write inlines in declarations
  • Inlines for exporting private and protected members
  • Empty special members
  • Virtual inline functions where the type is not known
  • Define class abstractions
  • Decide now what might be overridden later
  • When to use pure virtual functions
  • Private virtual functions to control access
  • Base class constructors cannot call virtual functions
  • Destructors are not automatically virtual
  • Switch statements indicate polymorphism
  • When to use virtual assignment
  • Exceptions checklist
  • Exceptions syntax
  • Avoid interface specification
  • Perform resource recovery
  • Automatic objects
  • Passing exceptions
  • TJanitor
  • What to subclass
  • When to subclass
  • When to signal an exception
  • When to recover an exception
  • Strive for uniform distribution
  • Do not implement Hash via member functions
  • When equality does not apply
  • Equality between different types
  • Taxonomy of surrogates
  • Explicit masters
  • Handle surrogates
  • Hidden masters
  • Surrogates that view masters
  • Follow naming conventions
  • Use copy semantics wherever possible
  • Avoid storage manipulation in open code
  • Allocate subobjects on the heap for debugging
  • Synchronization techniques
  • Synchronization and problems with memory access
  • Synchronization of global and static variables
  • Shared memory between tasks
  • Shared heaps
  • Shared memory problems with const
  • Static destructors for subsystem cleanup
  • Create objects in a valid state
  • Use flattening rather than dynamic class instantiation
  • Check for self-assignment with operator=:
  • Balance overloaded operators
  • Use static members as constructors
  • Differentiate overloaded constructors
  • Hide implementation classes
  • Use nil pointer deletion
  • Issues in overloading and overriding classes
  • Control class access
  • Language and hardware assumptions
  • Safe assumptions
  • Bad assumptions
  • Synchronization
  • Portable data
  • Assembly language
  • Nonportable code
  • Template conventions
  • Include file conventions
  • General rules for implementation classes
  • The example class: an owning stack
  • Sharing the implementation through private inheritance
  • Class definitions
  • Naming conventions
  • Instance variables
  • Type-specific methods and implementation class constructors and destructors
  • Inlining the class template’s public methods
  • Class templates that inherit from specialized classes
  • An implementation sharing example
  • Sharing the implementation by delegating to a member
  • An example of delegating to a member
  • The delegation example’s naming conventions
  • The delegating-to-a-member example

C# School: 14 lessons to get you started with C# and .NET

  • Author: Faraz Rasheed
  • Format: PDF (protected – no copying of text to clipboard)
  • Price: free

The book is divided in to three progressive levels. In the first beginner stage the author discusses the .Net Framework, C# Language Fundamentals and Object Oriented Programming.

In the second intermediate section he goes into depth with Object Oriented constructs such as inheritance, polymorphism, abstract classes, interfaces, structures, enumerations and exceptions.
In the third and final advanced section he delves into what is required to implement real world applications using C# with Base Libraries, focusing on topics such as Collections, Delegates, Events and Windows Programming with a number of control, as well as Data Access with ADO.Net, Threads and Streams.

Continue reading

Ada Distilled: An Introduction to Ada Programming for Experienced Computer Programmers

  • Author: Richard Riehle
  • Format: PDF
  • Price: free

This book highlights some key features of the Ada language, with coded examples, that are essential for getting started as an Ada programmer. It emphasizes syntax, control structures, subprogram rules, and how-to coding issues rather than design issues.

Ada Distilled is for experienced programmers new to Ada. Heavily commented example programs help experienced programmer experiment with Ada. This is not a comprehensive book on the entire Ada language. In particular, it says very little about Ada Finalization, Storage Pool Management, Representation Specifications, Concurrency, and other more advanced topics.

Chapters include:

  • What is Ada Distilled?
  • Summary of Language
  • Types and the Type Model
  • Control Structures for Algorithms
  • Access Types (Pointers)
  • Subprograms
  • Package Design
  • Child Library Units
  • Object-Oriented Programming with Packages
  • Using Standard Libraries and Annexes
  • Exception Management
  • Generic Components
  • New Names from Old Ones
  • Concurrency with Tasking

Ada 95: The Craft of Object-Oriented Programming

  • Author: John English
  • Format: HTML
  • Price: free

This book is a beginner’s introduction to Ada 95. It uses an example-driven approach that gradually develops small programs into large case-study type programs. The focus of this book is on using object-oriented approaches to write maintainable, extensive programs. Important and unique ADA features such as exception handling, user-defined types, procedures, functions, and packages are covered early in the text.

Chapters include:

  • Programming concepts
  • Fundamentals of Ada
  • Statements
  • Procedures, functions and packages
  • Defining new data types
  • Composite data types
  • Exceptions
  • Program design and debugging
  • Private types
  • Designing with abstract data types
  • Dynamic memory allocation
  • Generics
  • Building a calculator
  • Tagged types
  • Polymorphism and dispatching
  • Controlled types
  • An object-oriented calculator
  • Designing a spreadsheet
  • Multitasking
  • Loose ends
  • Language summary
  • Selected standard packages
  • Language-defined attributes
  • Package Listings

Visit: Ada 95: The Craft of Object-Oriented Programming

Learning Object Oriented Programming with Delphi

My image
  • Author: John Barrow
  • Format: online HTML
  • Price: free

This course uses Delphi to teach object orientation. Delphi’s roots lie in Pascal, and so it has a sound, structured foundation. It is also strongly object oriented and provides many OO characteristics such as class inheritance, static binding and dynamic binding, and reference semantics.

The module makes extensive use of graded, worked examples to give students hands-on experience in the implementation of OO code. This helps to bridge the gap between the seemingly simple OO principles and the ramifications of these principles in practice. Through the inductive sequencing of concepts and through the extensive use of worked examples, this module strongly supports independent study, and has been prepared with distance learning students in mind.

Chapters include:

  • Introduction to OO basics
  • Introduction to class inheritance
  • Programmer defined classes and objects
  • Accessing an object and its data
  • The Sender parameter and substitution
  • Introducing type inheritance
  • Using and abusing inheritance
  • Indirection
  • Association & Composition
  • Two Patterns Using Composition
  • Some Patterns for varying behaviour
  • Bidirectional links, Callbacks and Linking Classes
  • Factory Patterns
  • A Decorator

Object Orientated Programming in ANSI-C

  • Author: Axel Schreiner
  • Format: PDF
  • Price: free

Object-oriented programming is the current cure-all – although it has been around for much more then ten years. At the core, there is little more to it then finally applying the good programming principles which we have been taught for more then twenty years. C++ (Eiffel, Oberon-2, Smalltalk … take your pick) is the New Language because it is object-oriented – although you need not use it that way if you do not want to (or know how to), and it turns out that you can do just as well with plain ANSI-C. Only object-orientation permits code reuse between projects, although the idea of subroutines is as old as computers and good programmers always carried their toolkits and libraries with them.

This book is not going to praise object-oriented programming or condemn the Old Way. We are simply going to use ANSI-C to discover how object-oriented programming is done, what its techniques are, why they help us solve bigger problems, and how we harness generality and program to catch mistakes earlier. Along the way we encounter all the jargon – classes, inheritance, instances, linkage, methods, objects, polymorphisms, and more – but we take it out of the realm of magic and see how it translates into the things we have known and done all along.

Chapters include:

  • Abstract Data Types — Information Hiding
  • Dynamic Linkage — Generic Functions
  • Programming Savvy — Arithmetic Expressions
  • Inheritance — Code Reuse and Refinement
  • Programming Savvy — Symbol Table
  • Class Hierarchy — Maintainability
  • The ooc Preprocessor — Enforcing a Coding Standard
  • Dynamic Type Checking — Defensive Programming
  • Static Construction— Self-Organization
  • Delegates — Callback Functions
  • Class Methods— Plugging Memory Leaks
  • Persistent Objects — Storing and Loading Data Structures
  • Exceptions — Disciplined Error Recovery
  • Forwarding Messages — A GUI Calculator

Object-Oriented System Development

My image
  • Author: Dennis de Champeaux, Douglas Lea, and Penelope Faure
  • Format: online HTML
  • Price: free

This book is intended to help the reader better understand the role of analysis and design in the object-oriented software development process. Experiments to use structured analysis and design as precursors to an object-oriented implementation have failed. The descriptions produced by the structured methods partition reality along the wrong dimensions. Classes are not recognized and inheritance as an abstraction mechanism is not exploited.

However, we are fortunate that a multitude of object-oriented analysis and design methods have emerged and are still under development. Core OO notions have found their home place in the analysis phase. Abstraction and specialization via inheritance, originally advertised as key ingredients of OO programming, have been abstracted into key ingredients of OO analysis (OOA). Analysis-level property inheritance maps smoothly on the behavior inheritance of the programming realm.

While the book is mostly self-contained, people report that it does not serve as an introductory OO text. It helps to have had some previous exposure to basic OO concepts.

Chapters Include:

Part 1: Analysis

  • Introduction to Analysis
  • Object Statics
  • Object Relationships
  • Object Dynamics
  • Object Interaction
  • Class Relationships
  • Instances
  • Ensembles
  • Constructing a System Model
  • Other Requirements
  • The Analysis Process
  • Domain Analysis
  • The Grady Experience

Part II: Design

  • From Analysis to Design
  • Description and Computation
  • Attributes in Design
  • Relationships in Design
  • Designing Transitions
  • Interaction Designs
  • Dispatching
  • Coordination
  • Clustering Objects
  • Designing Passive Objects
  • Performance Optimization
  • From Design to Implementation